objc2_ui_kit/generated/
UIStepper.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/uistepper?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 UIStepper;
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 UIStepper {}
32
33#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
34unsafe impl NSCoding for UIStepper {}
35
36#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
37unsafe impl NSObjectProtocol for UIStepper {}
38
39#[cfg(all(
40    feature = "UIAppearance",
41    feature = "UIControl",
42    feature = "UIResponder",
43    feature = "UIView"
44))]
45unsafe impl UIAppearance for UIStepper {}
46
47#[cfg(all(
48    feature = "UIAppearance",
49    feature = "UIControl",
50    feature = "UIResponder",
51    feature = "UIView"
52))]
53unsafe impl UIAppearanceContainer for UIStepper {}
54
55#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
56unsafe impl UICoordinateSpace for UIStepper {}
57
58#[cfg(all(
59    feature = "UIControl",
60    feature = "UIDynamicBehavior",
61    feature = "UIResponder",
62    feature = "UIView"
63))]
64unsafe impl UIDynamicItem for UIStepper {}
65
66#[cfg(all(
67    feature = "UIControl",
68    feature = "UIFocus",
69    feature = "UIResponder",
70    feature = "UIView"
71))]
72unsafe impl UIFocusEnvironment for UIStepper {}
73
74#[cfg(all(
75    feature = "UIControl",
76    feature = "UIFocus",
77    feature = "UIResponder",
78    feature = "UIView"
79))]
80unsafe impl UIFocusItem for UIStepper {}
81
82#[cfg(all(
83    feature = "UIControl",
84    feature = "UIFocus",
85    feature = "UIResponder",
86    feature = "UIView"
87))]
88unsafe impl UIFocusItemContainer for UIStepper {}
89
90#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
91unsafe impl UIResponderStandardEditActions for UIStepper {}
92
93#[cfg(all(
94    feature = "UIControl",
95    feature = "UIResponder",
96    feature = "UITraitCollection",
97    feature = "UIView"
98))]
99unsafe impl UITraitEnvironment for UIStepper {}
100
101#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
102impl UIStepper {
103    extern_methods!(
104        #[unsafe(method(isContinuous))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn isContinuous(&self) -> bool;
107
108        /// Setter for [`isContinuous`][Self::isContinuous].
109        #[unsafe(method(setContinuous:))]
110        #[unsafe(method_family = none)]
111        pub unsafe fn setContinuous(&self, continuous: bool);
112
113        #[unsafe(method(autorepeat))]
114        #[unsafe(method_family = none)]
115        pub unsafe fn autorepeat(&self) -> bool;
116
117        /// Setter for [`autorepeat`][Self::autorepeat].
118        #[unsafe(method(setAutorepeat:))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn setAutorepeat(&self, autorepeat: bool);
121
122        #[unsafe(method(wraps))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn wraps(&self) -> bool;
125
126        /// Setter for [`wraps`][Self::wraps].
127        #[unsafe(method(setWraps:))]
128        #[unsafe(method_family = none)]
129        pub unsafe fn setWraps(&self, wraps: bool);
130
131        #[unsafe(method(value))]
132        #[unsafe(method_family = none)]
133        pub unsafe fn value(&self) -> c_double;
134
135        /// Setter for [`value`][Self::value].
136        #[unsafe(method(setValue:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn setValue(&self, value: c_double);
139
140        #[unsafe(method(minimumValue))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn minimumValue(&self) -> c_double;
143
144        /// Setter for [`minimumValue`][Self::minimumValue].
145        #[unsafe(method(setMinimumValue:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn setMinimumValue(&self, minimum_value: c_double);
148
149        #[unsafe(method(maximumValue))]
150        #[unsafe(method_family = none)]
151        pub unsafe fn maximumValue(&self) -> c_double;
152
153        /// Setter for [`maximumValue`][Self::maximumValue].
154        #[unsafe(method(setMaximumValue:))]
155        #[unsafe(method_family = none)]
156        pub unsafe fn setMaximumValue(&self, maximum_value: c_double);
157
158        #[unsafe(method(stepValue))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn stepValue(&self) -> c_double;
161
162        /// Setter for [`stepValue`][Self::stepValue].
163        #[unsafe(method(setStepValue:))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn setStepValue(&self, step_value: c_double);
166
167        #[cfg(feature = "UIImage")]
168        #[unsafe(method(setBackgroundImage:forState:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn setBackgroundImage_forState(
171            &self,
172            image: Option<&UIImage>,
173            state: UIControlState,
174        );
175
176        #[cfg(feature = "UIImage")]
177        #[unsafe(method(backgroundImageForState:))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn backgroundImageForState(
180            &self,
181            state: UIControlState,
182        ) -> Option<Retained<UIImage>>;
183
184        #[cfg(feature = "UIImage")]
185        #[unsafe(method(setDividerImage:forLeftSegmentState:rightSegmentState:))]
186        #[unsafe(method_family = none)]
187        pub unsafe fn setDividerImage_forLeftSegmentState_rightSegmentState(
188            &self,
189            image: Option<&UIImage>,
190            left_state: UIControlState,
191            right_state: UIControlState,
192        );
193
194        #[cfg(feature = "UIImage")]
195        #[unsafe(method(setIncrementImage:forState:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn setIncrementImage_forState(
198            &self,
199            image: Option<&UIImage>,
200            state: UIControlState,
201        );
202
203        #[cfg(feature = "UIImage")]
204        #[unsafe(method(incrementImageForState:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn incrementImageForState(
207            &self,
208            state: UIControlState,
209        ) -> Option<Retained<UIImage>>;
210
211        #[cfg(feature = "UIImage")]
212        #[unsafe(method(setDecrementImage:forState:))]
213        #[unsafe(method_family = none)]
214        pub unsafe fn setDecrementImage_forState(
215            &self,
216            image: Option<&UIImage>,
217            state: UIControlState,
218        );
219
220        #[cfg(feature = "UIImage")]
221        #[unsafe(method(decrementImageForState:))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn decrementImageForState(
224            &self,
225            state: UIControlState,
226        ) -> Option<Retained<UIImage>>;
227    );
228}
229
230/// Methods declared on superclass `UIControl`.
231#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
232impl UIStepper {
233    extern_methods!(
234        #[cfg(feature = "objc2-core-foundation")]
235        #[unsafe(method(initWithFrame:))]
236        #[unsafe(method_family = init)]
237        pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
238
239        #[unsafe(method(initWithCoder:))]
240        #[unsafe(method_family = init)]
241        pub unsafe fn initWithCoder(
242            this: Allocated<Self>,
243            coder: &NSCoder,
244        ) -> Option<Retained<Self>>;
245
246        #[cfg(all(
247            feature = "UIAction",
248            feature = "UIMenuElement",
249            feature = "objc2-core-foundation"
250        ))]
251        /// 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.
252        #[unsafe(method(initWithFrame:primaryAction:))]
253        #[unsafe(method_family = init)]
254        pub unsafe fn initWithFrame_primaryAction(
255            this: Allocated<Self>,
256            frame: CGRect,
257            primary_action: Option<&UIAction>,
258        ) -> Retained<Self>;
259    );
260}
261
262/// Methods declared on superclass `NSObject`.
263#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
264impl UIStepper {
265    extern_methods!(
266        #[unsafe(method(init))]
267        #[unsafe(method_family = init)]
268        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
269
270        #[unsafe(method(new))]
271        #[unsafe(method_family = new)]
272        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
273    );
274}