objc2_ui_kit/generated/
UICalendarView.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
15extern_class!(
16 #[unsafe(super(UIView, UIResponder, NSObject))]
18 #[thread_kind = MainThreadOnly]
19 #[derive(Debug, PartialEq, Eq, Hash)]
20 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
21 pub struct UICalendarView;
22);
23
24#[cfg(all(
25 feature = "UIResponder",
26 feature = "UIView",
27 feature = "objc2-quartz-core"
28))]
29#[cfg(not(target_os = "watchos"))]
30unsafe impl CALayerDelegate for UICalendarView {}
31
32#[cfg(all(feature = "UIResponder", feature = "UIView"))]
33unsafe impl NSCoding for UICalendarView {}
34
35#[cfg(all(feature = "UIResponder", feature = "UIView"))]
36unsafe impl NSObjectProtocol for UICalendarView {}
37
38#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
39unsafe impl UIAppearance for UICalendarView {}
40
41#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
42unsafe impl UIAppearanceContainer for UICalendarView {}
43
44#[cfg(all(feature = "UIResponder", feature = "UIView"))]
45unsafe impl UICoordinateSpace for UICalendarView {}
46
47#[cfg(all(
48 feature = "UIDynamicBehavior",
49 feature = "UIResponder",
50 feature = "UIView"
51))]
52unsafe impl UIDynamicItem for UICalendarView {}
53
54#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
55unsafe impl UIFocusEnvironment for UICalendarView {}
56
57#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
58unsafe impl UIFocusItem for UICalendarView {}
59
60#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
61unsafe impl UIFocusItemContainer for UICalendarView {}
62
63#[cfg(all(feature = "UIResponder", feature = "UIView"))]
64unsafe impl UIResponderStandardEditActions for UICalendarView {}
65
66#[cfg(all(
67 feature = "UIResponder",
68 feature = "UITraitCollection",
69 feature = "UIView"
70))]
71unsafe impl UITraitEnvironment for UICalendarView {}
72
73#[cfg(all(feature = "UIResponder", feature = "UIView"))]
74impl UICalendarView {
75 extern_methods!(
76 #[unsafe(method(delegate))]
78 #[unsafe(method_family = none)]
79 pub unsafe fn delegate(
80 &self,
81 ) -> Option<Retained<ProtocolObject<dyn UICalendarViewDelegate>>>;
82
83 #[unsafe(method(setDelegate:))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn setDelegate(
88 &self,
89 delegate: Option<&ProtocolObject<dyn UICalendarViewDelegate>>,
90 );
91
92 #[cfg(feature = "UICalendarSelection")]
93 #[unsafe(method(selectionBehavior))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn selectionBehavior(&self) -> Option<Retained<UICalendarSelection>>;
97
98 #[cfg(feature = "UICalendarSelection")]
99 #[unsafe(method(setSelectionBehavior:))]
101 #[unsafe(method_family = none)]
102 pub unsafe fn setSelectionBehavior(&self, selection_behavior: Option<&UICalendarSelection>);
103
104 #[unsafe(method(locale))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn locale(&self) -> Retained<NSLocale>;
109
110 #[unsafe(method(setLocale:))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn setLocale(&self, locale: &NSLocale);
114
115 #[unsafe(method(calendar))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn calendar(&self) -> Retained<NSCalendar>;
120
121 #[unsafe(method(setCalendar:))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn setCalendar(&self, calendar: &NSCalendar);
125
126 #[unsafe(method(timeZone))]
128 #[unsafe(method_family = none)]
129 pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
130
131 #[unsafe(method(setTimeZone:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
135
136 #[cfg(feature = "UIFontDescriptor")]
137 #[unsafe(method(fontDesign))]
140 #[unsafe(method_family = none)]
141 pub unsafe fn fontDesign(&self) -> Retained<UIFontDescriptorSystemDesign>;
142
143 #[cfg(feature = "UIFontDescriptor")]
144 #[unsafe(method(setFontDesign:))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn setFontDesign(&self, font_design: &UIFontDescriptorSystemDesign);
148
149 #[unsafe(method(availableDateRange))]
153 #[unsafe(method_family = none)]
154 pub unsafe fn availableDateRange(&self) -> Retained<NSDateInterval>;
155
156 #[unsafe(method(setAvailableDateRange:))]
158 #[unsafe(method_family = none)]
159 pub unsafe fn setAvailableDateRange(&self, available_date_range: &NSDateInterval);
160
161 #[unsafe(method(visibleDateComponents))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn visibleDateComponents(&self) -> Retained<NSDateComponents>;
179
180 #[unsafe(method(setVisibleDateComponents:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setVisibleDateComponents(&self, visible_date_components: &NSDateComponents);
184
185 #[unsafe(method(setVisibleDateComponents:animated:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn setVisibleDateComponents_animated(
202 &self,
203 date_components: &NSDateComponents,
204 animated: bool,
205 );
206
207 #[unsafe(method(wantsDateDecorations))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn wantsDateDecorations(&self) -> bool;
214
215 #[unsafe(method(setWantsDateDecorations:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn setWantsDateDecorations(&self, wants_date_decorations: bool);
219
220 #[unsafe(method(reloadDecorationsForDateComponents:animated:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn reloadDecorationsForDateComponents_animated(
226 &self,
227 dates: &NSArray<NSDateComponents>,
228 animated: bool,
229 );
230 );
231}
232
233#[cfg(all(feature = "UIResponder", feature = "UIView"))]
235impl UICalendarView {
236 extern_methods!(
237 #[cfg(feature = "objc2-core-foundation")]
238 #[unsafe(method(initWithFrame:))]
239 #[unsafe(method_family = init)]
240 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
241
242 #[unsafe(method(initWithCoder:))]
243 #[unsafe(method_family = init)]
244 pub unsafe fn initWithCoder(
245 this: Allocated<Self>,
246 coder: &NSCoder,
247 ) -> Option<Retained<Self>>;
248 );
249}
250
251#[cfg(all(feature = "UIResponder", feature = "UIView"))]
253impl UICalendarView {
254 extern_methods!(
255 #[unsafe(method(init))]
256 #[unsafe(method_family = init)]
257 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
258
259 #[unsafe(method(new))]
260 #[unsafe(method_family = new)]
261 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
262 );
263}
264
265extern_protocol!(
266 pub unsafe trait UICalendarViewDelegate: NSObjectProtocol {
268 #[cfg(all(
269 feature = "UICalendarViewDecoration",
270 feature = "UIResponder",
271 feature = "UIView"
272 ))]
273 #[optional]
285 #[unsafe(method(calendarView:decorationForDateComponents:))]
286 #[unsafe(method_family = none)]
287 unsafe fn calendarView_decorationForDateComponents(
288 &self,
289 calendar_view: &UICalendarView,
290 date_components: &NSDateComponents,
291 ) -> Option<Retained<UICalendarViewDecoration>>;
292
293 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
294 #[optional]
302 #[unsafe(method(calendarView:didChangeVisibleDateComponentsFrom:))]
303 #[unsafe(method_family = none)]
304 unsafe fn calendarView_didChangeVisibleDateComponentsFrom(
305 &self,
306 calendar_view: &UICalendarView,
307 previous_date_components: &NSDateComponents,
308 );
309 }
310);