objc2_ui_kit/generated/
UIDatePicker.rs1use 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
15#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct UIDatePickerMode(pub NSInteger);
20impl UIDatePickerMode {
21 #[doc(alias = "UIDatePickerModeTime")]
23 pub const Time: Self = Self(0);
24 #[doc(alias = "UIDatePickerModeDate")]
26 pub const Date: Self = Self(1);
27 #[doc(alias = "UIDatePickerModeDateAndTime")]
29 pub const DateAndTime: Self = Self(2);
30 #[doc(alias = "UIDatePickerModeCountDownTimer")]
32 pub const CountDownTimer: Self = Self(3);
33 #[doc(alias = "UIDatePickerModeYearAndMonth")]
35 pub const YearAndMonth: Self = Self(4);
36}
37
38unsafe impl Encode for UIDatePickerMode {
39 const ENCODING: Encoding = NSInteger::ENCODING;
40}
41
42unsafe impl RefEncode for UIDatePickerMode {
43 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
44}
45
46#[repr(transparent)]
49#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
50pub struct UIDatePickerStyle(pub NSInteger);
51impl UIDatePickerStyle {
52 #[doc(alias = "UIDatePickerStyleAutomatic")]
56 pub const Automatic: Self = Self(0);
57 #[doc(alias = "UIDatePickerStyleWheels")]
59 pub const Wheels: Self = Self(1);
60 #[doc(alias = "UIDatePickerStyleCompact")]
62 pub const Compact: Self = Self(2);
63 #[doc(alias = "UIDatePickerStyleInline")]
65 pub const Inline: Self = Self(3);
66}
67
68unsafe impl Encode for UIDatePickerStyle {
69 const ENCODING: Encoding = NSInteger::ENCODING;
70}
71
72unsafe impl RefEncode for UIDatePickerStyle {
73 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
74}
75
76extern_class!(
77 #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
79 #[thread_kind = MainThreadOnly]
80 #[derive(Debug, PartialEq, Eq, Hash)]
81 #[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
82 pub struct UIDatePicker;
83);
84
85#[cfg(all(
86 feature = "UIControl",
87 feature = "UIResponder",
88 feature = "UIView",
89 feature = "objc2-quartz-core"
90))]
91#[cfg(not(target_os = "watchos"))]
92unsafe impl CALayerDelegate for UIDatePicker {}
93
94#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
95unsafe impl NSCoding for UIDatePicker {}
96
97#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
98unsafe impl NSObjectProtocol for UIDatePicker {}
99
100#[cfg(all(
101 feature = "UIAppearance",
102 feature = "UIControl",
103 feature = "UIResponder",
104 feature = "UIView"
105))]
106unsafe impl UIAppearance for UIDatePicker {}
107
108#[cfg(all(
109 feature = "UIAppearance",
110 feature = "UIControl",
111 feature = "UIResponder",
112 feature = "UIView"
113))]
114unsafe impl UIAppearanceContainer for UIDatePicker {}
115
116#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
117unsafe impl UICoordinateSpace for UIDatePicker {}
118
119#[cfg(all(
120 feature = "UIControl",
121 feature = "UIDynamicBehavior",
122 feature = "UIResponder",
123 feature = "UIView"
124))]
125unsafe impl UIDynamicItem for UIDatePicker {}
126
127#[cfg(all(
128 feature = "UIControl",
129 feature = "UIFocus",
130 feature = "UIResponder",
131 feature = "UIView"
132))]
133unsafe impl UIFocusEnvironment for UIDatePicker {}
134
135#[cfg(all(
136 feature = "UIControl",
137 feature = "UIFocus",
138 feature = "UIResponder",
139 feature = "UIView"
140))]
141unsafe impl UIFocusItem for UIDatePicker {}
142
143#[cfg(all(
144 feature = "UIControl",
145 feature = "UIFocus",
146 feature = "UIResponder",
147 feature = "UIView"
148))]
149unsafe impl UIFocusItemContainer for UIDatePicker {}
150
151#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
152unsafe impl UIResponderStandardEditActions for UIDatePicker {}
153
154#[cfg(all(
155 feature = "UIControl",
156 feature = "UIResponder",
157 feature = "UITraitCollection",
158 feature = "UIView"
159))]
160unsafe impl UITraitEnvironment for UIDatePicker {}
161
162#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
163impl UIDatePicker {
164 extern_methods!(
165 #[unsafe(method(datePickerMode))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn datePickerMode(&self) -> UIDatePickerMode;
168
169 #[unsafe(method(setDatePickerMode:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setDatePickerMode(&self, date_picker_mode: UIDatePickerMode);
173
174 #[unsafe(method(locale))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn locale(&self) -> Option<Retained<NSLocale>>;
177
178 #[unsafe(method(setLocale:))]
180 #[unsafe(method_family = none)]
181 pub unsafe fn setLocale(&self, locale: Option<&NSLocale>);
182
183 #[unsafe(method(calendar))]
184 #[unsafe(method_family = none)]
185 pub unsafe fn calendar(&self) -> Retained<NSCalendar>;
186
187 #[unsafe(method(setCalendar:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn setCalendar(&self, calendar: Option<&NSCalendar>);
191
192 #[unsafe(method(timeZone))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
195
196 #[unsafe(method(setTimeZone:))]
198 #[unsafe(method_family = none)]
199 pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
200
201 #[unsafe(method(date))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn date(&self) -> Retained<NSDate>;
204
205 #[unsafe(method(setDate:))]
207 #[unsafe(method_family = none)]
208 pub unsafe fn setDate(&self, date: &NSDate);
209
210 #[unsafe(method(minimumDate))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn minimumDate(&self) -> Option<Retained<NSDate>>;
213
214 #[unsafe(method(setMinimumDate:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn setMinimumDate(&self, minimum_date: Option<&NSDate>);
218
219 #[unsafe(method(maximumDate))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn maximumDate(&self) -> Option<Retained<NSDate>>;
222
223 #[unsafe(method(setMaximumDate:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn setMaximumDate(&self, maximum_date: Option<&NSDate>);
227
228 #[unsafe(method(countDownDuration))]
229 #[unsafe(method_family = none)]
230 pub unsafe fn countDownDuration(&self) -> NSTimeInterval;
231
232 #[unsafe(method(setCountDownDuration:))]
234 #[unsafe(method_family = none)]
235 pub unsafe fn setCountDownDuration(&self, count_down_duration: NSTimeInterval);
236
237 #[unsafe(method(minuteInterval))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn minuteInterval(&self) -> NSInteger;
240
241 #[unsafe(method(setMinuteInterval:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn setMinuteInterval(&self, minute_interval: NSInteger);
245
246 #[unsafe(method(setDate:animated:))]
247 #[unsafe(method_family = none)]
248 pub unsafe fn setDate_animated(&self, date: &NSDate, animated: bool);
249
250 #[unsafe(method(preferredDatePickerStyle))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn preferredDatePickerStyle(&self) -> UIDatePickerStyle;
254
255 #[unsafe(method(setPreferredDatePickerStyle:))]
257 #[unsafe(method_family = none)]
258 pub unsafe fn setPreferredDatePickerStyle(
259 &self,
260 preferred_date_picker_style: UIDatePickerStyle,
261 );
262
263 #[unsafe(method(datePickerStyle))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn datePickerStyle(&self) -> UIDatePickerStyle;
267
268 #[unsafe(method(roundsToMinuteInterval))]
278 #[unsafe(method_family = none)]
279 pub unsafe fn roundsToMinuteInterval(&self) -> bool;
280
281 #[unsafe(method(setRoundsToMinuteInterval:))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn setRoundsToMinuteInterval(&self, rounds_to_minute_interval: bool);
285 );
286}
287
288#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
290impl UIDatePicker {
291 extern_methods!(
292 #[cfg(feature = "objc2-core-foundation")]
293 #[unsafe(method(initWithFrame:))]
294 #[unsafe(method_family = init)]
295 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
296
297 #[unsafe(method(initWithCoder:))]
298 #[unsafe(method_family = init)]
299 pub unsafe fn initWithCoder(
300 this: Allocated<Self>,
301 coder: &NSCoder,
302 ) -> Option<Retained<Self>>;
303
304 #[cfg(all(
305 feature = "UIAction",
306 feature = "UIMenuElement",
307 feature = "objc2-core-foundation"
308 ))]
309 #[unsafe(method(initWithFrame:primaryAction:))]
311 #[unsafe(method_family = init)]
312 pub unsafe fn initWithFrame_primaryAction(
313 this: Allocated<Self>,
314 frame: CGRect,
315 primary_action: Option<&UIAction>,
316 ) -> Retained<Self>;
317 );
318}
319
320#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
322impl UIDatePicker {
323 extern_methods!(
324 #[unsafe(method(init))]
325 #[unsafe(method_family = init)]
326 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
327
328 #[unsafe(method(new))]
329 #[unsafe(method_family = new)]
330 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
331 );
332}