objc2_ui_kit/generated/
UISlider.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/uislider?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 UISlider;
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 UISlider {}
33);
34
35#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
36extern_conformance!(
37    unsafe impl NSCoding for UISlider {}
38);
39
40#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
41extern_conformance!(
42    unsafe impl NSObjectProtocol for UISlider {}
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 UISlider {}
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 UISlider {}
63);
64
65#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
66extern_conformance!(
67    unsafe impl UICoordinateSpace for UISlider {}
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 UISlider {}
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 UISlider {}
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 UISlider {}
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 UISlider {}
108);
109
110#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
111extern_conformance!(
112    unsafe impl UIResponderStandardEditActions for UISlider {}
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 UISlider {}
123);
124
125#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
126impl UISlider {
127    extern_methods!(
128        #[unsafe(method(value))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn value(&self) -> c_float;
131
132        /// Setter for [`value`][Self::value].
133        #[unsafe(method(setValue:))]
134        #[unsafe(method_family = none)]
135        pub unsafe fn setValue(&self, value: c_float);
136
137        #[unsafe(method(minimumValue))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn minimumValue(&self) -> c_float;
140
141        /// Setter for [`minimumValue`][Self::minimumValue].
142        #[unsafe(method(setMinimumValue:))]
143        #[unsafe(method_family = none)]
144        pub unsafe fn setMinimumValue(&self, minimum_value: c_float);
145
146        #[unsafe(method(maximumValue))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn maximumValue(&self) -> c_float;
149
150        /// Setter for [`maximumValue`][Self::maximumValue].
151        #[unsafe(method(setMaximumValue:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setMaximumValue(&self, maximum_value: c_float);
154
155        #[cfg(feature = "UIImage")]
156        #[unsafe(method(minimumValueImage))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn minimumValueImage(&self) -> Option<Retained<UIImage>>;
159
160        #[cfg(feature = "UIImage")]
161        /// Setter for [`minimumValueImage`][Self::minimumValueImage].
162        #[unsafe(method(setMinimumValueImage:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setMinimumValueImage(&self, minimum_value_image: Option<&UIImage>);
165
166        #[cfg(feature = "UIImage")]
167        #[unsafe(method(maximumValueImage))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn maximumValueImage(&self) -> Option<Retained<UIImage>>;
170
171        #[cfg(feature = "UIImage")]
172        /// Setter for [`maximumValueImage`][Self::maximumValueImage].
173        #[unsafe(method(setMaximumValueImage:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setMaximumValueImage(&self, maximum_value_image: Option<&UIImage>);
176
177        #[unsafe(method(isContinuous))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn isContinuous(&self) -> bool;
180
181        /// Setter for [`isContinuous`][Self::isContinuous].
182        #[unsafe(method(setContinuous:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn setContinuous(&self, continuous: bool);
185
186        #[cfg(feature = "UIColor")]
187        #[unsafe(method(minimumTrackTintColor))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn minimumTrackTintColor(&self) -> Option<Retained<UIColor>>;
190
191        #[cfg(feature = "UIColor")]
192        /// Setter for [`minimumTrackTintColor`][Self::minimumTrackTintColor].
193        #[unsafe(method(setMinimumTrackTintColor:))]
194        #[unsafe(method_family = none)]
195        pub unsafe fn setMinimumTrackTintColor(&self, minimum_track_tint_color: Option<&UIColor>);
196
197        #[cfg(feature = "UIColor")]
198        #[unsafe(method(maximumTrackTintColor))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn maximumTrackTintColor(&self) -> Option<Retained<UIColor>>;
201
202        #[cfg(feature = "UIColor")]
203        /// Setter for [`maximumTrackTintColor`][Self::maximumTrackTintColor].
204        #[unsafe(method(setMaximumTrackTintColor:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn setMaximumTrackTintColor(&self, maximum_track_tint_color: Option<&UIColor>);
207
208        #[cfg(feature = "UIColor")]
209        #[unsafe(method(thumbTintColor))]
210        #[unsafe(method_family = none)]
211        pub unsafe fn thumbTintColor(&self) -> Option<Retained<UIColor>>;
212
213        #[cfg(feature = "UIColor")]
214        /// Setter for [`thumbTintColor`][Self::thumbTintColor].
215        #[unsafe(method(setThumbTintColor:))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn setThumbTintColor(&self, thumb_tint_color: Option<&UIColor>);
218
219        #[unsafe(method(setValue:animated:))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn setValue_animated(&self, value: c_float, animated: bool);
222
223        #[cfg(feature = "UIImage")]
224        #[unsafe(method(setThumbImage:forState:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn setThumbImage_forState(&self, image: Option<&UIImage>, state: UIControlState);
227
228        #[cfg(feature = "UIImage")]
229        #[unsafe(method(setMinimumTrackImage:forState:))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn setMinimumTrackImage_forState(
232            &self,
233            image: Option<&UIImage>,
234            state: UIControlState,
235        );
236
237        #[cfg(feature = "UIImage")]
238        #[unsafe(method(setMaximumTrackImage:forState:))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn setMaximumTrackImage_forState(
241            &self,
242            image: Option<&UIImage>,
243            state: UIControlState,
244        );
245
246        #[cfg(feature = "UIImage")]
247        #[unsafe(method(thumbImageForState:))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn thumbImageForState(&self, state: UIControlState)
250            -> Option<Retained<UIImage>>;
251
252        #[cfg(feature = "UIImage")]
253        #[unsafe(method(minimumTrackImageForState:))]
254        #[unsafe(method_family = none)]
255        pub unsafe fn minimumTrackImageForState(
256            &self,
257            state: UIControlState,
258        ) -> Option<Retained<UIImage>>;
259
260        #[cfg(feature = "UIImage")]
261        #[unsafe(method(maximumTrackImageForState:))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn maximumTrackImageForState(
264            &self,
265            state: UIControlState,
266        ) -> Option<Retained<UIImage>>;
267
268        #[cfg(feature = "UIImage")]
269        #[unsafe(method(currentThumbImage))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn currentThumbImage(&self) -> Option<Retained<UIImage>>;
272
273        #[cfg(feature = "UIImage")]
274        #[unsafe(method(currentMinimumTrackImage))]
275        #[unsafe(method_family = none)]
276        pub unsafe fn currentMinimumTrackImage(&self) -> Option<Retained<UIImage>>;
277
278        #[cfg(feature = "UIImage")]
279        #[unsafe(method(currentMaximumTrackImage))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn currentMaximumTrackImage(&self) -> Option<Retained<UIImage>>;
282
283        #[cfg(feature = "objc2-core-foundation")]
284        #[unsafe(method(minimumValueImageRectForBounds:))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn minimumValueImageRectForBounds(&self, bounds: CGRect) -> CGRect;
287
288        #[cfg(feature = "objc2-core-foundation")]
289        #[unsafe(method(maximumValueImageRectForBounds:))]
290        #[unsafe(method_family = none)]
291        pub unsafe fn maximumValueImageRectForBounds(&self, bounds: CGRect) -> CGRect;
292
293        #[cfg(feature = "objc2-core-foundation")]
294        #[unsafe(method(trackRectForBounds:))]
295        #[unsafe(method_family = none)]
296        pub unsafe fn trackRectForBounds(&self, bounds: CGRect) -> CGRect;
297
298        #[cfg(feature = "objc2-core-foundation")]
299        #[unsafe(method(thumbRectForBounds:trackRect:value:))]
300        #[unsafe(method_family = none)]
301        pub unsafe fn thumbRectForBounds_trackRect_value(
302            &self,
303            bounds: CGRect,
304            rect: CGRect,
305            value: c_float,
306        ) -> CGRect;
307    );
308}
309
310/// Methods declared on superclass `UIControl`.
311#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
312impl UISlider {
313    extern_methods!(
314        #[cfg(feature = "objc2-core-foundation")]
315        #[unsafe(method(initWithFrame:))]
316        #[unsafe(method_family = init)]
317        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
318
319        #[unsafe(method(initWithCoder:))]
320        #[unsafe(method_family = init)]
321        pub unsafe fn initWithCoder(
322            this: Allocated<Self>,
323            coder: &NSCoder,
324        ) -> Option<Retained<Self>>;
325
326        #[cfg(all(
327            feature = "UIAction",
328            feature = "UIMenuElement",
329            feature = "objc2-core-foundation"
330        ))]
331        /// 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.
332        #[unsafe(method(initWithFrame:primaryAction:))]
333        #[unsafe(method_family = init)]
334        pub unsafe fn initWithFrame_primaryAction(
335            this: Allocated<Self>,
336            frame: CGRect,
337            primary_action: Option<&UIAction>,
338        ) -> Retained<Self>;
339    );
340}
341
342/// Methods declared on superclass `NSObject`.
343#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
344impl UISlider {
345    extern_methods!(
346        #[unsafe(method(init))]
347        #[unsafe(method_family = init)]
348        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
349
350        #[unsafe(method(new))]
351        #[unsafe(method_family = new)]
352        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
353    );
354}