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"))]
31unsafe impl CALayerDelegate for UISlider {}
32
33#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
34unsafe impl NSCoding for UISlider {}
35
36#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
37unsafe impl NSObjectProtocol for UISlider {}
38
39#[cfg(all(
40    feature = "UIAppearance",
41    feature = "UIControl",
42    feature = "UIResponder",
43    feature = "UIView"
44))]
45unsafe impl UIAppearance for UISlider {}
46
47#[cfg(all(
48    feature = "UIAppearance",
49    feature = "UIControl",
50    feature = "UIResponder",
51    feature = "UIView"
52))]
53unsafe impl UIAppearanceContainer for UISlider {}
54
55#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
56unsafe impl UICoordinateSpace for UISlider {}
57
58#[cfg(all(
59    feature = "UIControl",
60    feature = "UIDynamicBehavior",
61    feature = "UIResponder",
62    feature = "UIView"
63))]
64unsafe impl UIDynamicItem for UISlider {}
65
66#[cfg(all(
67    feature = "UIControl",
68    feature = "UIFocus",
69    feature = "UIResponder",
70    feature = "UIView"
71))]
72unsafe impl UIFocusEnvironment for UISlider {}
73
74#[cfg(all(
75    feature = "UIControl",
76    feature = "UIFocus",
77    feature = "UIResponder",
78    feature = "UIView"
79))]
80unsafe impl UIFocusItem for UISlider {}
81
82#[cfg(all(
83    feature = "UIControl",
84    feature = "UIFocus",
85    feature = "UIResponder",
86    feature = "UIView"
87))]
88unsafe impl UIFocusItemContainer for UISlider {}
89
90#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
91unsafe impl UIResponderStandardEditActions for UISlider {}
92
93#[cfg(all(
94    feature = "UIControl",
95    feature = "UIResponder",
96    feature = "UITraitCollection",
97    feature = "UIView"
98))]
99unsafe impl UITraitEnvironment for UISlider {}
100
101#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
102impl UISlider {
103    extern_methods!(
104        #[unsafe(method(value))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn value(&self) -> c_float;
107
108        /// Setter for [`value`][Self::value].
109        #[unsafe(method(setValue:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setValue(&self, value: c_float);
112
113        #[unsafe(method(minimumValue))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn minimumValue(&self) -> c_float;
116
117        /// Setter for [`minimumValue`][Self::minimumValue].
118        #[unsafe(method(setMinimumValue:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setMinimumValue(&self, minimum_value: c_float);
121
122        #[unsafe(method(maximumValue))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn maximumValue(&self) -> c_float;
125
126        /// Setter for [`maximumValue`][Self::maximumValue].
127        #[unsafe(method(setMaximumValue:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setMaximumValue(&self, maximum_value: c_float);
130
131        #[cfg(feature = "UIImage")]
132        #[unsafe(method(minimumValueImage))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn minimumValueImage(&self) -> Option<Retained<UIImage>>;
135
136        #[cfg(feature = "UIImage")]
137        /// Setter for [`minimumValueImage`][Self::minimumValueImage].
138        #[unsafe(method(setMinimumValueImage:))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn setMinimumValueImage(&self, minimum_value_image: Option<&UIImage>);
141
142        #[cfg(feature = "UIImage")]
143        #[unsafe(method(maximumValueImage))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn maximumValueImage(&self) -> Option<Retained<UIImage>>;
146
147        #[cfg(feature = "UIImage")]
148        /// Setter for [`maximumValueImage`][Self::maximumValueImage].
149        #[unsafe(method(setMaximumValueImage:))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn setMaximumValueImage(&self, maximum_value_image: Option<&UIImage>);
152
153        #[unsafe(method(isContinuous))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn isContinuous(&self) -> bool;
156
157        /// Setter for [`isContinuous`][Self::isContinuous].
158        #[unsafe(method(setContinuous:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setContinuous(&self, continuous: bool);
161
162        #[cfg(feature = "UIColor")]
163        #[unsafe(method(minimumTrackTintColor))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn minimumTrackTintColor(&self) -> Option<Retained<UIColor>>;
166
167        #[cfg(feature = "UIColor")]
168        /// Setter for [`minimumTrackTintColor`][Self::minimumTrackTintColor].
169        #[unsafe(method(setMinimumTrackTintColor:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setMinimumTrackTintColor(&self, minimum_track_tint_color: Option<&UIColor>);
172
173        #[cfg(feature = "UIColor")]
174        #[unsafe(method(maximumTrackTintColor))]
175        #[unsafe(method_family = none)]
176        pub unsafe fn maximumTrackTintColor(&self) -> Option<Retained<UIColor>>;
177
178        #[cfg(feature = "UIColor")]
179        /// Setter for [`maximumTrackTintColor`][Self::maximumTrackTintColor].
180        #[unsafe(method(setMaximumTrackTintColor:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn setMaximumTrackTintColor(&self, maximum_track_tint_color: Option<&UIColor>);
183
184        #[cfg(feature = "UIColor")]
185        #[unsafe(method(thumbTintColor))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn thumbTintColor(&self) -> Option<Retained<UIColor>>;
188
189        #[cfg(feature = "UIColor")]
190        /// Setter for [`thumbTintColor`][Self::thumbTintColor].
191        #[unsafe(method(setThumbTintColor:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn setThumbTintColor(&self, thumb_tint_color: Option<&UIColor>);
194
195        #[unsafe(method(setValue:animated:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn setValue_animated(&self, value: c_float, animated: bool);
198
199        #[cfg(feature = "UIImage")]
200        #[unsafe(method(setThumbImage:forState:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setThumbImage_forState(&self, image: Option<&UIImage>, state: UIControlState);
203
204        #[cfg(feature = "UIImage")]
205        #[unsafe(method(setMinimumTrackImage:forState:))]
206        #[unsafe(method_family = none)]
207        pub unsafe fn setMinimumTrackImage_forState(
208            &self,
209            image: Option<&UIImage>,
210            state: UIControlState,
211        );
212
213        #[cfg(feature = "UIImage")]
214        #[unsafe(method(setMaximumTrackImage:forState:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn setMaximumTrackImage_forState(
217            &self,
218            image: Option<&UIImage>,
219            state: UIControlState,
220        );
221
222        #[cfg(feature = "UIImage")]
223        #[unsafe(method(thumbImageForState:))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn thumbImageForState(&self, state: UIControlState)
226            -> Option<Retained<UIImage>>;
227
228        #[cfg(feature = "UIImage")]
229        #[unsafe(method(minimumTrackImageForState:))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn minimumTrackImageForState(
232            &self,
233            state: UIControlState,
234        ) -> Option<Retained<UIImage>>;
235
236        #[cfg(feature = "UIImage")]
237        #[unsafe(method(maximumTrackImageForState:))]
238        #[unsafe(method_family = none)]
239        pub unsafe fn maximumTrackImageForState(
240            &self,
241            state: UIControlState,
242        ) -> Option<Retained<UIImage>>;
243
244        #[cfg(feature = "UIImage")]
245        #[unsafe(method(currentThumbImage))]
246        #[unsafe(method_family = none)]
247        pub unsafe fn currentThumbImage(&self) -> Option<Retained<UIImage>>;
248
249        #[cfg(feature = "UIImage")]
250        #[unsafe(method(currentMinimumTrackImage))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn currentMinimumTrackImage(&self) -> Option<Retained<UIImage>>;
253
254        #[cfg(feature = "UIImage")]
255        #[unsafe(method(currentMaximumTrackImage))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn currentMaximumTrackImage(&self) -> Option<Retained<UIImage>>;
258
259        #[cfg(feature = "objc2-core-foundation")]
260        #[unsafe(method(minimumValueImageRectForBounds:))]
261        #[unsafe(method_family = none)]
262        pub unsafe fn minimumValueImageRectForBounds(&self, bounds: CGRect) -> CGRect;
263
264        #[cfg(feature = "objc2-core-foundation")]
265        #[unsafe(method(maximumValueImageRectForBounds:))]
266        #[unsafe(method_family = none)]
267        pub unsafe fn maximumValueImageRectForBounds(&self, bounds: CGRect) -> CGRect;
268
269        #[cfg(feature = "objc2-core-foundation")]
270        #[unsafe(method(trackRectForBounds:))]
271        #[unsafe(method_family = none)]
272        pub unsafe fn trackRectForBounds(&self, bounds: CGRect) -> CGRect;
273
274        #[cfg(feature = "objc2-core-foundation")]
275        #[unsafe(method(thumbRectForBounds:trackRect:value:))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn thumbRectForBounds_trackRect_value(
278            &self,
279            bounds: CGRect,
280            rect: CGRect,
281            value: c_float,
282        ) -> CGRect;
283    );
284}
285
286/// Methods declared on superclass `UIControl`.
287#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
288impl UISlider {
289    extern_methods!(
290        #[cfg(feature = "objc2-core-foundation")]
291        #[unsafe(method(initWithFrame:))]
292        #[unsafe(method_family = init)]
293        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
294
295        #[unsafe(method(initWithCoder:))]
296        #[unsafe(method_family = init)]
297        pub unsafe fn initWithCoder(
298            this: Allocated<Self>,
299            coder: &NSCoder,
300        ) -> Option<Retained<Self>>;
301
302        #[cfg(all(
303            feature = "UIAction",
304            feature = "UIMenuElement",
305            feature = "objc2-core-foundation"
306        ))]
307        /// 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.
308        #[unsafe(method(initWithFrame:primaryAction:))]
309        #[unsafe(method_family = init)]
310        pub unsafe fn initWithFrame_primaryAction(
311            this: Allocated<Self>,
312            frame: CGRect,
313            primary_action: Option<&UIAction>,
314        ) -> Retained<Self>;
315    );
316}
317
318/// Methods declared on superclass `NSObject`.
319#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
320impl UISlider {
321    extern_methods!(
322        #[unsafe(method(init))]
323        #[unsafe(method_family = init)]
324        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
325
326        #[unsafe(method(new))]
327        #[unsafe(method_family = new)]
328        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
329    );
330}