objc2_ui_kit/generated/
UICalendarSelectionSingleDate.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(UICalendarSelection, NSObject))]
13 #[thread_kind = MainThreadOnly]
14 #[derive(Debug, PartialEq, Eq, Hash)]
15 #[cfg(feature = "UICalendarSelection")]
16 pub struct UICalendarSelectionSingleDate;
17);
18
19#[cfg(feature = "UICalendarSelection")]
20extern_conformance!(
21 unsafe impl NSObjectProtocol for UICalendarSelectionSingleDate {}
22);
23
24#[cfg(feature = "UICalendarSelection")]
25impl UICalendarSelectionSingleDate {
26 extern_methods!(
27 #[unsafe(method(delegate))]
29 #[unsafe(method_family = none)]
30 pub fn delegate(
31 &self,
32 ) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>>;
33
34 #[unsafe(method(selectedDate))]
39 #[unsafe(method_family = none)]
40 pub fn selectedDate(&self) -> Option<Retained<NSDateComponents>>;
41
42 #[unsafe(method(setSelectedDate:))]
46 #[unsafe(method_family = none)]
47 pub fn setSelectedDate(&self, selected_date: Option<&NSDateComponents>);
48
49 #[unsafe(method(setSelectedDate:animated:))]
51 #[unsafe(method_family = none)]
52 pub fn setSelectedDate_animated(
53 &self,
54 selected_date: Option<&NSDateComponents>,
55 animated: bool,
56 );
57
58 #[unsafe(method(initWithDelegate:))]
60 #[unsafe(method_family = init)]
61 pub fn initWithDelegate(
62 this: Allocated<Self>,
63 delegate: Option<&ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>,
64 ) -> Retained<Self>;
65 );
66}
67
68#[cfg(feature = "UICalendarSelection")]
70impl UICalendarSelectionSingleDate {
71 extern_methods!(
72 #[unsafe(method(init))]
73 #[unsafe(method_family = init)]
74 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
75
76 #[unsafe(method(new))]
77 #[unsafe(method_family = new)]
78 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
79 );
80}
81
82extern_protocol!(
83 pub unsafe trait UICalendarSelectionSingleDateDelegate:
85 NSObjectProtocol + MainThreadOnly
86 {
87 #[cfg(feature = "UICalendarSelection")]
88 #[unsafe(method(dateSelection:didSelectDate:))]
97 #[unsafe(method_family = none)]
98 fn dateSelection_didSelectDate(
99 &self,
100 selection: &UICalendarSelectionSingleDate,
101 date_components: Option<&NSDateComponents>,
102 );
103
104 #[cfg(feature = "UICalendarSelection")]
105 #[optional]
118 #[unsafe(method(dateSelection:canSelectDate:))]
119 #[unsafe(method_family = none)]
120 fn dateSelection_canSelectDate(
121 &self,
122 selection: &UICalendarSelectionSingleDate,
123 date_components: Option<&NSDateComponents>,
124 ) -> bool;
125 }
126);