objc2_app_kit/generated/
NSColorPicking.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_protocol!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorpickingdefault?language=objc)
12    pub unsafe trait NSColorPickingDefault: MainThreadOnly {
13        #[cfg(all(
14            feature = "NSColorPanel",
15            feature = "NSPanel",
16            feature = "NSResponder",
17            feature = "NSWindow"
18        ))]
19        #[unsafe(method(initWithPickerMask:colorPanel:))]
20        #[unsafe(method_family = init)]
21        fn initWithPickerMask_colorPanel(
22            this: Allocated<Self>,
23            mask: NSUInteger,
24            owning_color_panel: &NSColorPanel,
25        ) -> Option<Retained<Self>>;
26
27        #[cfg(feature = "NSImage")]
28        #[unsafe(method(provideNewButtonImage))]
29        #[unsafe(method_family = none)]
30        fn provideNewButtonImage(&self) -> Retained<NSImage>;
31
32        #[cfg(all(
33            feature = "NSActionCell",
34            feature = "NSButtonCell",
35            feature = "NSCell",
36            feature = "NSImage"
37        ))]
38        #[unsafe(method(insertNewButtonImage:in:))]
39        #[unsafe(method_family = none)]
40        fn insertNewButtonImage_in(&self, new_button_image: &NSImage, button_cell: &NSButtonCell);
41
42        /// # Safety
43        ///
44        /// `sender` should be of the correct type.
45        #[unsafe(method(viewSizeChanged:))]
46        #[unsafe(method_family = none)]
47        unsafe fn viewSizeChanged(&self, sender: Option<&AnyObject>);
48
49        /// # Safety
50        ///
51        /// `sender` should be of the correct type.
52        #[unsafe(method(alphaControlAddedOrRemoved:))]
53        #[unsafe(method_family = none)]
54        unsafe fn alphaControlAddedOrRemoved(&self, sender: Option<&AnyObject>);
55
56        #[cfg(feature = "NSColorList")]
57        #[unsafe(method(attachColorList:))]
58        #[unsafe(method_family = none)]
59        fn attachColorList(&self, color_list: &NSColorList);
60
61        #[cfg(feature = "NSColorList")]
62        #[unsafe(method(detachColorList:))]
63        #[unsafe(method_family = none)]
64        fn detachColorList(&self, color_list: &NSColorList);
65
66        #[cfg(feature = "NSColorPanel")]
67        #[unsafe(method(setMode:))]
68        #[unsafe(method_family = none)]
69        fn setMode(&self, mode: NSColorPanelMode);
70
71        #[unsafe(method(buttonToolTip))]
72        #[unsafe(method_family = none)]
73        fn buttonToolTip(&self) -> Retained<NSString>;
74
75        #[unsafe(method(minContentSize))]
76        #[unsafe(method_family = none)]
77        fn minContentSize(&self) -> NSSize;
78    }
79);
80
81extern_protocol!(
82    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nscolorpickingcustom?language=objc)
83    pub unsafe trait NSColorPickingCustom: NSColorPickingDefault + MainThreadOnly {
84        #[cfg(feature = "NSColorPanel")]
85        #[unsafe(method(supportsMode:))]
86        #[unsafe(method_family = none)]
87        fn supportsMode(&self, mode: NSColorPanelMode) -> bool;
88
89        #[cfg(feature = "NSColorPanel")]
90        #[unsafe(method(currentMode))]
91        #[unsafe(method_family = none)]
92        fn currentMode(&self) -> NSColorPanelMode;
93
94        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
95        #[unsafe(method(provideNewView:))]
96        #[unsafe(method_family = none)]
97        fn provideNewView(&self, initial_request: bool) -> Retained<NSView>;
98
99        #[cfg(feature = "NSColor")]
100        #[unsafe(method(setColor:))]
101        #[unsafe(method_family = none)]
102        fn setColor(&self, new_color: &NSColor);
103    }
104);