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"))]
92extern_conformance!(
93 unsafe impl CALayerDelegate for UIDatePicker {}
94);
95
96#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
97extern_conformance!(
98 unsafe impl NSCoding for UIDatePicker {}
99);
100
101#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
102extern_conformance!(
103 unsafe impl NSObjectProtocol for UIDatePicker {}
104);
105
106#[cfg(all(
107 feature = "UIAppearance",
108 feature = "UIControl",
109 feature = "UIResponder",
110 feature = "UIView"
111))]
112extern_conformance!(
113 unsafe impl UIAppearance for UIDatePicker {}
114);
115
116#[cfg(all(
117 feature = "UIAppearance",
118 feature = "UIControl",
119 feature = "UIResponder",
120 feature = "UIView"
121))]
122extern_conformance!(
123 unsafe impl UIAppearanceContainer for UIDatePicker {}
124);
125
126#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
127extern_conformance!(
128 unsafe impl UICoordinateSpace for UIDatePicker {}
129);
130
131#[cfg(all(
132 feature = "UIControl",
133 feature = "UIDynamicBehavior",
134 feature = "UIResponder",
135 feature = "UIView"
136))]
137extern_conformance!(
138 unsafe impl UIDynamicItem for UIDatePicker {}
139);
140
141#[cfg(all(
142 feature = "UIControl",
143 feature = "UIFocus",
144 feature = "UIResponder",
145 feature = "UIView"
146))]
147extern_conformance!(
148 unsafe impl UIFocusEnvironment for UIDatePicker {}
149);
150
151#[cfg(all(
152 feature = "UIControl",
153 feature = "UIFocus",
154 feature = "UIResponder",
155 feature = "UIView"
156))]
157extern_conformance!(
158 unsafe impl UIFocusItem for UIDatePicker {}
159);
160
161#[cfg(all(
162 feature = "UIControl",
163 feature = "UIFocus",
164 feature = "UIResponder",
165 feature = "UIView"
166))]
167extern_conformance!(
168 unsafe impl UIFocusItemContainer for UIDatePicker {}
169);
170
171#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
172extern_conformance!(
173 unsafe impl UIResponderStandardEditActions for UIDatePicker {}
174);
175
176#[cfg(all(
177 feature = "UIControl",
178 feature = "UIResponder",
179 feature = "UITraitCollection",
180 feature = "UIView"
181))]
182extern_conformance!(
183 unsafe impl UITraitEnvironment for UIDatePicker {}
184);
185
186#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
187impl UIDatePicker {
188 extern_methods!(
189 #[unsafe(method(datePickerMode))]
190 #[unsafe(method_family = none)]
191 pub fn datePickerMode(&self) -> UIDatePickerMode;
192
193 #[unsafe(method(setDatePickerMode:))]
195 #[unsafe(method_family = none)]
196 pub fn setDatePickerMode(&self, date_picker_mode: UIDatePickerMode);
197
198 #[unsafe(method(locale))]
199 #[unsafe(method_family = none)]
200 pub fn locale(&self) -> Option<Retained<NSLocale>>;
201
202 #[unsafe(method(setLocale:))]
204 #[unsafe(method_family = none)]
205 pub fn setLocale(&self, locale: Option<&NSLocale>);
206
207 #[unsafe(method(calendar))]
208 #[unsafe(method_family = none)]
209 pub fn calendar(&self) -> Retained<NSCalendar>;
210
211 #[unsafe(method(setCalendar:))]
215 #[unsafe(method_family = none)]
216 pub fn setCalendar(&self, calendar: Option<&NSCalendar>);
217
218 #[unsafe(method(timeZone))]
219 #[unsafe(method_family = none)]
220 pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
221
222 #[unsafe(method(setTimeZone:))]
224 #[unsafe(method_family = none)]
225 pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
226
227 #[unsafe(method(date))]
228 #[unsafe(method_family = none)]
229 pub fn date(&self) -> Retained<NSDate>;
230
231 #[unsafe(method(setDate:))]
233 #[unsafe(method_family = none)]
234 pub fn setDate(&self, date: &NSDate);
235
236 #[unsafe(method(minimumDate))]
237 #[unsafe(method_family = none)]
238 pub fn minimumDate(&self) -> Option<Retained<NSDate>>;
239
240 #[unsafe(method(setMinimumDate:))]
242 #[unsafe(method_family = none)]
243 pub fn setMinimumDate(&self, minimum_date: Option<&NSDate>);
244
245 #[unsafe(method(maximumDate))]
246 #[unsafe(method_family = none)]
247 pub fn maximumDate(&self) -> Option<Retained<NSDate>>;
248
249 #[unsafe(method(setMaximumDate:))]
251 #[unsafe(method_family = none)]
252 pub fn setMaximumDate(&self, maximum_date: Option<&NSDate>);
253
254 #[unsafe(method(countDownDuration))]
255 #[unsafe(method_family = none)]
256 pub fn countDownDuration(&self) -> NSTimeInterval;
257
258 #[unsafe(method(setCountDownDuration:))]
260 #[unsafe(method_family = none)]
261 pub fn setCountDownDuration(&self, count_down_duration: NSTimeInterval);
262
263 #[unsafe(method(minuteInterval))]
264 #[unsafe(method_family = none)]
265 pub fn minuteInterval(&self) -> NSInteger;
266
267 #[unsafe(method(setMinuteInterval:))]
269 #[unsafe(method_family = none)]
270 pub fn setMinuteInterval(&self, minute_interval: NSInteger);
271
272 #[unsafe(method(setDate:animated:))]
273 #[unsafe(method_family = none)]
274 pub fn setDate_animated(&self, date: &NSDate, animated: bool);
275
276 #[unsafe(method(preferredDatePickerStyle))]
278 #[unsafe(method_family = none)]
279 pub fn preferredDatePickerStyle(&self) -> UIDatePickerStyle;
280
281 #[unsafe(method(setPreferredDatePickerStyle:))]
283 #[unsafe(method_family = none)]
284 pub fn setPreferredDatePickerStyle(&self, preferred_date_picker_style: UIDatePickerStyle);
285
286 #[unsafe(method(datePickerStyle))]
288 #[unsafe(method_family = none)]
289 pub fn datePickerStyle(&self) -> UIDatePickerStyle;
290
291 #[unsafe(method(roundsToMinuteInterval))]
301 #[unsafe(method_family = none)]
302 pub fn roundsToMinuteInterval(&self) -> bool;
303
304 #[unsafe(method(setRoundsToMinuteInterval:))]
306 #[unsafe(method_family = none)]
307 pub fn setRoundsToMinuteInterval(&self, rounds_to_minute_interval: bool);
308 );
309}
310
311#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
313impl UIDatePicker {
314 extern_methods!(
315 #[cfg(feature = "objc2-core-foundation")]
316 #[unsafe(method(initWithFrame:))]
317 #[unsafe(method_family = init)]
318 pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
319
320 #[unsafe(method(initWithCoder:))]
324 #[unsafe(method_family = init)]
325 pub unsafe fn initWithCoder(
326 this: Allocated<Self>,
327 coder: &NSCoder,
328 ) -> Option<Retained<Self>>;
329
330 #[cfg(all(
331 feature = "UIAction",
332 feature = "UIMenuElement",
333 feature = "objc2-core-foundation"
334 ))]
335 #[unsafe(method(initWithFrame:primaryAction:))]
337 #[unsafe(method_family = init)]
338 pub fn initWithFrame_primaryAction(
339 this: Allocated<Self>,
340 frame: CGRect,
341 primary_action: Option<&UIAction>,
342 ) -> Retained<Self>;
343 );
344}
345
346#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
348impl UIDatePicker {
349 extern_methods!(
350 #[unsafe(method(init))]
351 #[unsafe(method_family = init)]
352 pub fn init(this: Allocated<Self>) -> Retained<Self>;
353 );
354}
355
356#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
358impl UIDatePicker {
359 extern_methods!(
360 #[unsafe(method(new))]
361 #[unsafe(method_family = new)]
362 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
363 );
364}