use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-quartz-core")]
#[cfg(not(target_os = "watchos"))]
use objc2_quartz_core::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDatePickerMode(pub NSInteger);
impl UIDatePickerMode {
#[doc(alias = "UIDatePickerModeTime")]
pub const Time: Self = Self(0);
#[doc(alias = "UIDatePickerModeDate")]
pub const Date: Self = Self(1);
#[doc(alias = "UIDatePickerModeDateAndTime")]
pub const DateAndTime: Self = Self(2);
#[doc(alias = "UIDatePickerModeCountDownTimer")]
pub const CountDownTimer: Self = Self(3);
#[doc(alias = "UIDatePickerModeYearAndMonth")]
pub const YearAndMonth: Self = Self(4);
}
unsafe impl Encode for UIDatePickerMode {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIDatePickerMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDatePickerStyle(pub NSInteger);
impl UIDatePickerStyle {
#[doc(alias = "UIDatePickerStyleAutomatic")]
pub const Automatic: Self = Self(0);
#[doc(alias = "UIDatePickerStyleWheels")]
pub const Wheels: Self = Self(1);
#[doc(alias = "UIDatePickerStyleCompact")]
pub const Compact: Self = Self(2);
#[doc(alias = "UIDatePickerStyleInline")]
pub const Inline: Self = Self(3);
}
unsafe impl Encode for UIDatePickerStyle {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for UIDatePickerStyle {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
pub struct UIDatePicker;
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UIView",
feature = "objc2-quartz-core"
))]
#[cfg(not(target_os = "watchos"))]
extern_conformance!(
unsafe impl CALayerDelegate for UIDatePicker {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSCoding for UIDatePicker {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for UIDatePicker {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIAppearance for UIDatePicker {}
);
#[cfg(all(
feature = "UIAppearance",
feature = "UIControl",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIAppearanceContainer for UIDatePicker {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UICoordinateSpace for UIDatePicker {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIDynamicBehavior",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIDynamicItem for UIDatePicker {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusEnvironment for UIDatePicker {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusItem for UIDatePicker {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIFocus",
feature = "UIResponder",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UIFocusItemContainer for UIDatePicker {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
extern_conformance!(
unsafe impl UIResponderStandardEditActions for UIDatePicker {}
);
#[cfg(all(
feature = "UIControl",
feature = "UIResponder",
feature = "UITraitCollection",
feature = "UIView"
))]
extern_conformance!(
unsafe impl UITraitEnvironment for UIDatePicker {}
);
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIDatePicker {
extern_methods!(
#[unsafe(method(datePickerMode))]
#[unsafe(method_family = none)]
pub fn datePickerMode(&self) -> UIDatePickerMode;
#[unsafe(method(setDatePickerMode:))]
#[unsafe(method_family = none)]
pub fn setDatePickerMode(&self, date_picker_mode: UIDatePickerMode);
#[unsafe(method(locale))]
#[unsafe(method_family = none)]
pub fn locale(&self) -> Option<Retained<NSLocale>>;
#[unsafe(method(setLocale:))]
#[unsafe(method_family = none)]
pub fn setLocale(&self, locale: Option<&NSLocale>);
#[unsafe(method(calendar))]
#[unsafe(method_family = none)]
pub fn calendar(&self) -> Retained<NSCalendar>;
#[unsafe(method(setCalendar:))]
#[unsafe(method_family = none)]
pub fn setCalendar(&self, calendar: Option<&NSCalendar>);
#[unsafe(method(timeZone))]
#[unsafe(method_family = none)]
pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
#[unsafe(method(setTimeZone:))]
#[unsafe(method_family = none)]
pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
#[unsafe(method(date))]
#[unsafe(method_family = none)]
pub fn date(&self) -> Retained<NSDate>;
#[unsafe(method(setDate:))]
#[unsafe(method_family = none)]
pub fn setDate(&self, date: &NSDate);
#[unsafe(method(minimumDate))]
#[unsafe(method_family = none)]
pub fn minimumDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(setMinimumDate:))]
#[unsafe(method_family = none)]
pub fn setMinimumDate(&self, minimum_date: Option<&NSDate>);
#[unsafe(method(maximumDate))]
#[unsafe(method_family = none)]
pub fn maximumDate(&self) -> Option<Retained<NSDate>>;
#[unsafe(method(setMaximumDate:))]
#[unsafe(method_family = none)]
pub fn setMaximumDate(&self, maximum_date: Option<&NSDate>);
#[unsafe(method(countDownDuration))]
#[unsafe(method_family = none)]
pub fn countDownDuration(&self) -> NSTimeInterval;
#[unsafe(method(setCountDownDuration:))]
#[unsafe(method_family = none)]
pub fn setCountDownDuration(&self, count_down_duration: NSTimeInterval);
#[unsafe(method(minuteInterval))]
#[unsafe(method_family = none)]
pub fn minuteInterval(&self) -> NSInteger;
#[unsafe(method(setMinuteInterval:))]
#[unsafe(method_family = none)]
pub fn setMinuteInterval(&self, minute_interval: NSInteger);
#[unsafe(method(setDate:animated:))]
#[unsafe(method_family = none)]
pub fn setDate_animated(&self, date: &NSDate, animated: bool);
#[unsafe(method(preferredDatePickerStyle))]
#[unsafe(method_family = none)]
pub fn preferredDatePickerStyle(&self) -> UIDatePickerStyle;
#[unsafe(method(setPreferredDatePickerStyle:))]
#[unsafe(method_family = none)]
pub fn setPreferredDatePickerStyle(&self, preferred_date_picker_style: UIDatePickerStyle);
#[unsafe(method(datePickerStyle))]
#[unsafe(method_family = none)]
pub fn datePickerStyle(&self) -> UIDatePickerStyle;
#[unsafe(method(roundsToMinuteInterval))]
#[unsafe(method_family = none)]
pub fn roundsToMinuteInterval(&self) -> bool;
#[unsafe(method(setRoundsToMinuteInterval:))]
#[unsafe(method_family = none)]
pub fn setRoundsToMinuteInterval(&self, rounds_to_minute_interval: bool);
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIDatePicker {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(
this: Allocated<Self>,
coder: &NSCoder,
) -> Option<Retained<Self>>;
#[cfg(all(
feature = "UIAction",
feature = "UIMenuElement",
feature = "objc2-core-foundation"
))]
#[unsafe(method(initWithFrame:primaryAction:))]
#[unsafe(method_family = init)]
pub fn initWithFrame_primaryAction(
this: Allocated<Self>,
frame: CGRect,
primary_action: Option<&UIAction>,
) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIDatePicker {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "UIControl", feature = "UIResponder", feature = "UIView"))]
impl UIDatePicker {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}