objc2_app_kit/generated/
NSColorPicker.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorpicker?language=objc)
12    #[unsafe(super(NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct NSColorPicker;
16);
17
18#[cfg(feature = "NSColorPicking")]
19unsafe impl NSColorPickingDefault for NSColorPicker {}
20
21unsafe impl NSObjectProtocol for NSColorPicker {}
22
23impl NSColorPicker {
24    extern_methods!(
25        #[cfg(all(
26            feature = "NSColorPanel",
27            feature = "NSPanel",
28            feature = "NSResponder",
29            feature = "NSWindow"
30        ))]
31        #[unsafe(method(initWithPickerMask:colorPanel:))]
32        #[unsafe(method_family = init)]
33        pub unsafe fn initWithPickerMask_colorPanel(
34            this: Allocated<Self>,
35            mask: NSUInteger,
36            owning_color_panel: &NSColorPanel,
37        ) -> Option<Retained<Self>>;
38
39        #[cfg(all(
40            feature = "NSColorPanel",
41            feature = "NSPanel",
42            feature = "NSResponder",
43            feature = "NSWindow"
44        ))]
45        #[unsafe(method(colorPanel))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn colorPanel(&self) -> Retained<NSColorPanel>;
48
49        #[cfg(feature = "NSImage")]
50        #[unsafe(method(provideNewButtonImage))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn provideNewButtonImage(&self) -> Retained<NSImage>;
53
54        #[cfg(all(
55            feature = "NSActionCell",
56            feature = "NSButtonCell",
57            feature = "NSCell",
58            feature = "NSImage"
59        ))]
60        #[unsafe(method(insertNewButtonImage:in:))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn insertNewButtonImage_in(
63            &self,
64            new_button_image: &NSImage,
65            button_cell: &NSButtonCell,
66        );
67
68        #[unsafe(method(viewSizeChanged:))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn viewSizeChanged(&self, sender: Option<&AnyObject>);
71
72        #[cfg(feature = "NSColorList")]
73        #[unsafe(method(attachColorList:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn attachColorList(&self, color_list: &NSColorList);
76
77        #[cfg(feature = "NSColorList")]
78        #[unsafe(method(detachColorList:))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn detachColorList(&self, color_list: &NSColorList);
81
82        #[cfg(feature = "NSColorPanel")]
83        #[unsafe(method(setMode:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setMode(&self, mode: NSColorPanelMode);
86
87        #[unsafe(method(buttonToolTip))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn buttonToolTip(&self) -> Retained<NSString>;
90
91        #[unsafe(method(minContentSize))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn minContentSize(&self) -> NSSize;
94    );
95}
96
97/// Methods declared on superclass `NSObject`.
98impl NSColorPicker {
99    extern_methods!(
100        #[unsafe(method(init))]
101        #[unsafe(method_family = init)]
102        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
103
104        #[unsafe(method(new))]
105        #[unsafe(method_family = new)]
106        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
107    );
108}