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"))]
30extern_conformance!(
31 unsafe impl CALayerDelegate for UICalendarView {}
32);
33
34#[cfg(all(feature = "UIResponder", feature = "UIView"))]
35extern_conformance!(
36 unsafe impl NSCoding for UICalendarView {}
37);
38
39#[cfg(all(feature = "UIResponder", feature = "UIView"))]
40extern_conformance!(
41 unsafe impl NSObjectProtocol for UICalendarView {}
42);
43
44#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
45extern_conformance!(
46 unsafe impl UIAppearance for UICalendarView {}
47);
48
49#[cfg(all(feature = "UIAppearance", feature = "UIResponder", feature = "UIView"))]
50extern_conformance!(
51 unsafe impl UIAppearanceContainer for UICalendarView {}
52);
53
54#[cfg(all(feature = "UIResponder", feature = "UIView"))]
55extern_conformance!(
56 unsafe impl UICoordinateSpace for UICalendarView {}
57);
58
59#[cfg(all(
60 feature = "UIDynamicBehavior",
61 feature = "UIResponder",
62 feature = "UIView"
63))]
64extern_conformance!(
65 unsafe impl UIDynamicItem for UICalendarView {}
66);
67
68#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
69extern_conformance!(
70 unsafe impl UIFocusEnvironment for UICalendarView {}
71);
72
73#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
74extern_conformance!(
75 unsafe impl UIFocusItem for UICalendarView {}
76);
77
78#[cfg(all(feature = "UIFocus", feature = "UIResponder", feature = "UIView"))]
79extern_conformance!(
80 unsafe impl UIFocusItemContainer for UICalendarView {}
81);
82
83#[cfg(all(feature = "UIResponder", feature = "UIView"))]
84extern_conformance!(
85 unsafe impl UIResponderStandardEditActions for UICalendarView {}
86);
87
88#[cfg(all(
89 feature = "UIResponder",
90 feature = "UITraitCollection",
91 feature = "UIView"
92))]
93extern_conformance!(
94 unsafe impl UITraitEnvironment for UICalendarView {}
95);
96
97#[cfg(all(feature = "UIResponder", feature = "UIView"))]
98impl UICalendarView {
99 extern_methods!(
100 #[unsafe(method(delegate))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn delegate(
104 &self,
105 ) -> Option<Retained<ProtocolObject<dyn UICalendarViewDelegate>>>;
106
107 #[unsafe(method(setDelegate:))]
110 #[unsafe(method_family = none)]
111 pub unsafe fn setDelegate(
112 &self,
113 delegate: Option<&ProtocolObject<dyn UICalendarViewDelegate>>,
114 );
115
116 #[cfg(feature = "UICalendarSelection")]
117 #[unsafe(method(selectionBehavior))]
119 #[unsafe(method_family = none)]
120 pub unsafe fn selectionBehavior(&self) -> Option<Retained<UICalendarSelection>>;
121
122 #[cfg(feature = "UICalendarSelection")]
123 #[unsafe(method(setSelectionBehavior:))]
125 #[unsafe(method_family = none)]
126 pub unsafe fn setSelectionBehavior(&self, selection_behavior: Option<&UICalendarSelection>);
127
128 #[unsafe(method(locale))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn locale(&self) -> Retained<NSLocale>;
133
134 #[unsafe(method(setLocale:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn setLocale(&self, locale: &NSLocale);
138
139 #[unsafe(method(calendar))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn calendar(&self) -> Retained<NSCalendar>;
144
145 #[unsafe(method(setCalendar:))]
147 #[unsafe(method_family = none)]
148 pub unsafe fn setCalendar(&self, calendar: &NSCalendar);
149
150 #[unsafe(method(timeZone))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
154
155 #[unsafe(method(setTimeZone:))]
157 #[unsafe(method_family = none)]
158 pub unsafe fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
159
160 #[cfg(feature = "UIFontDescriptor")]
161 #[unsafe(method(fontDesign))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn fontDesign(&self) -> Retained<UIFontDescriptorSystemDesign>;
166
167 #[cfg(feature = "UIFontDescriptor")]
168 #[unsafe(method(setFontDesign:))]
170 #[unsafe(method_family = none)]
171 pub unsafe fn setFontDesign(&self, font_design: &UIFontDescriptorSystemDesign);
172
173 #[unsafe(method(availableDateRange))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn availableDateRange(&self) -> Retained<NSDateInterval>;
179
180 #[unsafe(method(setAvailableDateRange:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setAvailableDateRange(&self, available_date_range: &NSDateInterval);
184
185 #[unsafe(method(visibleDateComponents))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn visibleDateComponents(&self) -> Retained<NSDateComponents>;
203
204 #[unsafe(method(setVisibleDateComponents:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setVisibleDateComponents(&self, visible_date_components: &NSDateComponents);
208
209 #[unsafe(method(setVisibleDateComponents:animated:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn setVisibleDateComponents_animated(
226 &self,
227 date_components: &NSDateComponents,
228 animated: bool,
229 );
230
231 #[unsafe(method(wantsDateDecorations))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn wantsDateDecorations(&self) -> bool;
238
239 #[unsafe(method(setWantsDateDecorations:))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn setWantsDateDecorations(&self, wants_date_decorations: bool);
243
244 #[unsafe(method(reloadDecorationsForDateComponents:animated:))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn reloadDecorationsForDateComponents_animated(
250 &self,
251 dates: &NSArray<NSDateComponents>,
252 animated: bool,
253 );
254 );
255}
256
257#[cfg(all(feature = "UIResponder", feature = "UIView"))]
259impl UICalendarView {
260 extern_methods!(
261 #[cfg(feature = "objc2-core-foundation")]
262 #[unsafe(method(initWithFrame:))]
263 #[unsafe(method_family = init)]
264 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
265
266 #[unsafe(method(initWithCoder:))]
267 #[unsafe(method_family = init)]
268 pub unsafe fn initWithCoder(
269 this: Allocated<Self>,
270 coder: &NSCoder,
271 ) -> Option<Retained<Self>>;
272 );
273}
274
275#[cfg(all(feature = "UIResponder", feature = "UIView"))]
277impl UICalendarView {
278 extern_methods!(
279 #[unsafe(method(init))]
280 #[unsafe(method_family = init)]
281 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
282
283 #[unsafe(method(new))]
284 #[unsafe(method_family = new)]
285 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
286 );
287}
288
289extern_protocol!(
290 pub unsafe trait UICalendarViewDelegate: NSObjectProtocol + MainThreadOnly {
292 #[cfg(all(
293 feature = "UICalendarViewDecoration",
294 feature = "UIResponder",
295 feature = "UIView"
296 ))]
297 #[optional]
309 #[unsafe(method(calendarView:decorationForDateComponents:))]
310 #[unsafe(method_family = none)]
311 unsafe fn calendarView_decorationForDateComponents(
312 &self,
313 calendar_view: &UICalendarView,
314 date_components: &NSDateComponents,
315 ) -> Option<Retained<UICalendarViewDecoration>>;
316
317 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
318 #[optional]
326 #[unsafe(method(calendarView:didChangeVisibleDateComponentsFrom:))]
327 #[unsafe(method_family = none)]
328 unsafe fn calendarView_didChangeVisibleDateComponentsFrom(
329 &self,
330 calendar_view: &UICalendarView,
331 previous_date_components: &NSDateComponents,
332 );
333 }
334);