objc2_ui_kit/generated/
UICalendarSelectionMultiDate.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 UICalendarSelectionMultiDate;
17);
18
19#[cfg(feature = "UICalendarSelection")]
20extern_conformance!(
21 unsafe impl NSObjectProtocol for UICalendarSelectionMultiDate {}
22);
23
24#[cfg(feature = "UICalendarSelection")]
25impl UICalendarSelectionMultiDate {
26 extern_methods!(
27 #[unsafe(method(selectedDates))]
29 #[unsafe(method_family = none)]
30 pub fn selectedDates(&self) -> Retained<NSArray<NSDateComponents>>;
31
32 #[unsafe(method(setSelectedDates:))]
36 #[unsafe(method_family = none)]
37 pub fn setSelectedDates(&self, selected_dates: &NSArray<NSDateComponents>);
38
39 #[unsafe(method(setSelectedDates:animated:))]
41 #[unsafe(method_family = none)]
42 pub fn setSelectedDates_animated(
43 &self,
44 selected_dates: &NSArray<NSDateComponents>,
45 animated: bool,
46 );
47
48 #[unsafe(method(delegate))]
50 #[unsafe(method_family = none)]
51 pub fn delegate(
52 &self,
53 ) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionMultiDateDelegate>>>;
54
55 #[unsafe(method(initWithDelegate:))]
57 #[unsafe(method_family = init)]
58 pub fn initWithDelegate(
59 this: Allocated<Self>,
60 delegate: Option<&ProtocolObject<dyn UICalendarSelectionMultiDateDelegate>>,
61 ) -> Retained<Self>;
62 );
63}
64
65#[cfg(feature = "UICalendarSelection")]
67impl UICalendarSelectionMultiDate {
68 extern_methods!(
69 #[unsafe(method(init))]
70 #[unsafe(method_family = init)]
71 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
72
73 #[unsafe(method(new))]
74 #[unsafe(method_family = new)]
75 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
76 );
77}
78
79extern_protocol!(
80 pub unsafe trait UICalendarSelectionMultiDateDelegate:
82 NSObjectProtocol + MainThreadOnly
83 {
84 #[cfg(feature = "UICalendarSelection")]
85 #[unsafe(method(multiDateSelection:didSelectDate:))]
92 #[unsafe(method_family = none)]
93 fn multiDateSelection_didSelectDate(
94 &self,
95 selection: &UICalendarSelectionMultiDate,
96 date_components: &NSDateComponents,
97 );
98
99 #[cfg(feature = "UICalendarSelection")]
100 #[unsafe(method(multiDateSelection:didDeselectDate:))]
107 #[unsafe(method_family = none)]
108 fn multiDateSelection_didDeselectDate(
109 &self,
110 selection: &UICalendarSelectionMultiDate,
111 date_components: &NSDateComponents,
112 );
113
114 #[cfg(feature = "UICalendarSelection")]
115 #[optional]
125 #[unsafe(method(multiDateSelection:canSelectDate:))]
126 #[unsafe(method_family = none)]
127 fn multiDateSelection_canSelectDate(
128 &self,
129 selection: &UICalendarSelectionMultiDate,
130 date_components: &NSDateComponents,
131 ) -> bool;
132
133 #[cfg(feature = "UICalendarSelection")]
134 #[optional]
144 #[unsafe(method(multiDateSelection:canDeselectDate:))]
145 #[unsafe(method_family = none)]
146 fn multiDateSelection_canDeselectDate(
147 &self,
148 selection: &UICalendarSelectionMultiDate,
149 date_components: &NSDateComponents,
150 ) -> bool;
151 }
152);