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")]
20unsafe impl NSObjectProtocol for UICalendarSelectionSingleDate {}
21
22#[cfg(feature = "UICalendarSelection")]
23impl UICalendarSelectionSingleDate {
24 extern_methods!(
25 #[unsafe(method(delegate))]
27 #[unsafe(method_family = none)]
28 pub unsafe fn delegate(
29 &self,
30 ) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>>;
31
32 #[unsafe(method(selectedDate))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn selectedDate(&self) -> Option<Retained<NSDateComponents>>;
39
40 #[unsafe(method(setSelectedDate:))]
42 #[unsafe(method_family = none)]
43 pub unsafe fn setSelectedDate(&self, selected_date: Option<&NSDateComponents>);
44
45 #[unsafe(method(setSelectedDate:animated:))]
47 #[unsafe(method_family = none)]
48 pub unsafe fn setSelectedDate_animated(
49 &self,
50 selected_date: Option<&NSDateComponents>,
51 animated: bool,
52 );
53
54 #[unsafe(method(initWithDelegate:))]
56 #[unsafe(method_family = init)]
57 pub unsafe fn initWithDelegate(
58 this: Allocated<Self>,
59 delegate: Option<&ProtocolObject<dyn UICalendarSelectionSingleDateDelegate>>,
60 ) -> Retained<Self>;
61 );
62}
63
64#[cfg(feature = "UICalendarSelection")]
66impl UICalendarSelectionSingleDate {
67 extern_methods!(
68 #[unsafe(method(init))]
69 #[unsafe(method_family = init)]
70 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
71
72 #[unsafe(method(new))]
73 #[unsafe(method_family = new)]
74 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
75 );
76}
77
78extern_protocol!(
79 pub unsafe trait UICalendarSelectionSingleDateDelegate: NSObjectProtocol {
81 #[cfg(feature = "UICalendarSelection")]
82 #[unsafe(method(dateSelection:didSelectDate:))]
91 #[unsafe(method_family = none)]
92 unsafe fn dateSelection_didSelectDate(
93 &self,
94 selection: &UICalendarSelectionSingleDate,
95 date_components: Option<&NSDateComponents>,
96 );
97
98 #[cfg(feature = "UICalendarSelection")]
99 #[optional]
112 #[unsafe(method(dateSelection:canSelectDate:))]
113 #[unsafe(method_family = none)]
114 unsafe fn dateSelection_canSelectDate(
115 &self,
116 selection: &UICalendarSelectionSingleDate,
117 date_components: Option<&NSDateComponents>,
118 ) -> bool;
119 }
120);