objc2_ui_kit/generated/
UIColorWell.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12
13use crate::*;
14
15extern_class!(
16    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicolorwell?language=objc)
17    #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
18    #[thread_kind = MainThreadOnly]
19    #[derive(Debug, PartialEq, Eq, Hash)]
20    #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
21    pub struct UIColorWell;
22);
23
24#[cfg(all(
25    feature = "UIControl",
26    feature = "UIResponder",
27    feature = "UIView",
28    feature = "objc2-quartz-core"
29))]
30#[cfg(not(target_os = "watchos"))]
31extern_conformance!(
32    unsafe impl CALayerDelegate for UIColorWell {}
33);
34
35#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
36extern_conformance!(
37    unsafe impl NSCoding for UIColorWell {}
38);
39
40#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
41extern_conformance!(
42    unsafe impl NSObjectProtocol for UIColorWell {}
43);
44
45#[cfg(all(
46    feature = "UIAppearance",
47    feature = "UIControl",
48    feature = "UIResponder",
49    feature = "UIView"
50))]
51extern_conformance!(
52    unsafe impl UIAppearance for UIColorWell {}
53);
54
55#[cfg(all(
56    feature = "UIAppearance",
57    feature = "UIControl",
58    feature = "UIResponder",
59    feature = "UIView"
60))]
61extern_conformance!(
62    unsafe impl UIAppearanceContainer for UIColorWell {}
63);
64
65#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
66extern_conformance!(
67    unsafe impl UICoordinateSpace for UIColorWell {}
68);
69
70#[cfg(all(
71    feature = "UIControl",
72    feature = "UIDynamicBehavior",
73    feature = "UIResponder",
74    feature = "UIView"
75))]
76extern_conformance!(
77    unsafe impl UIDynamicItem for UIColorWell {}
78);
79
80#[cfg(all(
81    feature = "UIControl",
82    feature = "UIFocus",
83    feature = "UIResponder",
84    feature = "UIView"
85))]
86extern_conformance!(
87    unsafe impl UIFocusEnvironment for UIColorWell {}
88);
89
90#[cfg(all(
91    feature = "UIControl",
92    feature = "UIFocus",
93    feature = "UIResponder",
94    feature = "UIView"
95))]
96extern_conformance!(
97    unsafe impl UIFocusItem for UIColorWell {}
98);
99
100#[cfg(all(
101    feature = "UIControl",
102    feature = "UIFocus",
103    feature = "UIResponder",
104    feature = "UIView"
105))]
106extern_conformance!(
107    unsafe impl UIFocusItemContainer for UIColorWell {}
108);
109
110#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
111extern_conformance!(
112    unsafe impl UIResponderStandardEditActions for UIColorWell {}
113);
114
115#[cfg(all(
116    feature = "UIControl",
117    feature = "UIResponder",
118    feature = "UITraitCollection",
119    feature = "UIView"
120))]
121extern_conformance!(
122    unsafe impl UITraitEnvironment for UIColorWell {}
123);
124
125#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
126impl UIColorWell {
127    extern_methods!(
128        /// Title for the color picker.
129        ///
130        /// Should explain what kind of color to pick. Example values are "Stroke Color" or "Fill Color".
131        #[unsafe(method(title))]
132        #[unsafe(method_family = none)]
133        pub fn title(&self) -> Option<Retained<NSString>>;
134
135        /// Setter for [`title`][Self::title].
136        ///
137        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
138        #[unsafe(method(setTitle:))]
139        #[unsafe(method_family = none)]
140        pub fn setTitle(&self, title: Option<&NSString>);
141
142        /// Controls whether alpha is supported or not.
143        ///
144        /// If set to `NO` users are only able to pick fully opaque colors.
145        #[unsafe(method(supportsAlpha))]
146        #[unsafe(method_family = none)]
147        pub fn supportsAlpha(&self) -> bool;
148
149        /// Setter for [`supportsAlpha`][Self::supportsAlpha].
150        #[unsafe(method(setSupportsAlpha:))]
151        #[unsafe(method_family = none)]
152        pub fn setSupportsAlpha(&self, supports_alpha: bool);
153
154        #[cfg(feature = "UIColor")]
155        /// Sets the selected color on the color picker and is updated when the user changes the selection.
156        /// Does support KVO and does send `UIControlEventValueChanged`.
157        #[unsafe(method(selectedColor))]
158        #[unsafe(method_family = none)]
159        pub fn selectedColor(&self) -> Option<Retained<UIColor>>;
160
161        #[cfg(feature = "UIColor")]
162        /// Setter for [`selectedColor`][Self::selectedColor].
163        #[unsafe(method(setSelectedColor:))]
164        #[unsafe(method_family = none)]
165        pub fn setSelectedColor(&self, selected_color: Option<&UIColor>);
166
167        /// If set to `NO` the eyedropper functionality is not supported for this color well.
168        #[unsafe(method(supportsEyedropper))]
169        #[unsafe(method_family = none)]
170        pub fn supportsEyedropper(&self) -> bool;
171
172        /// Setter for [`supportsEyedropper`][Self::supportsEyedropper].
173        #[unsafe(method(setSupportsEyedropper:))]
174        #[unsafe(method_family = none)]
175        pub fn setSupportsEyedropper(&self, supports_eyedropper: bool);
176
177        #[cfg(feature = "objc2-core-foundation")]
178        /// The maximum exposure to apply to a color when returned by the color well.
179        #[unsafe(method(maximumLinearExposure))]
180        #[unsafe(method_family = none)]
181        pub fn maximumLinearExposure(&self) -> CGFloat;
182
183        #[cfg(feature = "objc2-core-foundation")]
184        /// Setter for [`maximumLinearExposure`][Self::maximumLinearExposure].
185        #[unsafe(method(setMaximumLinearExposure:))]
186        #[unsafe(method_family = none)]
187        pub fn setMaximumLinearExposure(&self, maximum_linear_exposure: CGFloat);
188    );
189}
190
191/// Methods declared on superclass `UIControl`.
192#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
193impl UIColorWell {
194    extern_methods!(
195        #[cfg(feature = "objc2-core-foundation")]
196        #[unsafe(method(initWithFrame:))]
197        #[unsafe(method_family = init)]
198        pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
199
200        /// # Safety
201        ///
202        /// `coder` possibly has further requirements.
203        #[unsafe(method(initWithCoder:))]
204        #[unsafe(method_family = init)]
205        pub unsafe fn initWithCoder(
206            this: Allocated<Self>,
207            coder: &NSCoder,
208        ) -> Option<Retained<Self>>;
209
210        #[cfg(all(
211            feature = "UIAction",
212            feature = "UIMenuElement",
213            feature = "objc2-core-foundation"
214        ))]
215        /// Initializes the control and adds primaryAction for the UIControlEventPrimaryActionTriggered control event. Subclasses of UIControl may alter or add behaviors around the usage of primaryAction, see subclass documentation of this initializer for additional information.
216        #[unsafe(method(initWithFrame:primaryAction:))]
217        #[unsafe(method_family = init)]
218        pub fn initWithFrame_primaryAction(
219            this: Allocated<Self>,
220            frame: CGRect,
221            primary_action: Option<&UIAction>,
222        ) -> Retained<Self>;
223    );
224}
225
226/// Methods declared on superclass `UIView`.
227#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
228impl UIColorWell {
229    extern_methods!(
230        #[unsafe(method(init))]
231        #[unsafe(method_family = init)]
232        pub fn init(this: Allocated<Self>) -> Retained<Self>;
233    );
234}
235
236/// Methods declared on superclass `NSObject`.
237#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
238impl UIColorWell {
239    extern_methods!(
240        #[unsafe(method(new))]
241        #[unsafe(method_family = new)]
242        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
243    );
244}