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 fn delegate(&self) -> Option<Retained<ProtocolObject<dyn UICalendarViewDelegate>>>;
104
105 #[unsafe(method(setDelegate:))]
109 #[unsafe(method_family = none)]
110 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn UICalendarViewDelegate>>);
111
112 #[cfg(feature = "UICalendarSelection")]
113 #[unsafe(method(selectionBehavior))]
115 #[unsafe(method_family = none)]
116 pub fn selectionBehavior(&self) -> Option<Retained<UICalendarSelection>>;
117
118 #[cfg(feature = "UICalendarSelection")]
119 #[unsafe(method(setSelectionBehavior:))]
121 #[unsafe(method_family = none)]
122 pub fn setSelectionBehavior(&self, selection_behavior: Option<&UICalendarSelection>);
123
124 #[unsafe(method(locale))]
127 #[unsafe(method_family = none)]
128 pub fn locale(&self) -> Retained<NSLocale>;
129
130 #[unsafe(method(setLocale:))]
132 #[unsafe(method_family = none)]
133 pub fn setLocale(&self, locale: &NSLocale);
134
135 #[unsafe(method(calendar))]
138 #[unsafe(method_family = none)]
139 pub fn calendar(&self) -> Retained<NSCalendar>;
140
141 #[unsafe(method(setCalendar:))]
145 #[unsafe(method_family = none)]
146 pub fn setCalendar(&self, calendar: &NSCalendar);
147
148 #[unsafe(method(timeZone))]
150 #[unsafe(method_family = none)]
151 pub fn timeZone(&self) -> Option<Retained<NSTimeZone>>;
152
153 #[unsafe(method(setTimeZone:))]
155 #[unsafe(method_family = none)]
156 pub fn setTimeZone(&self, time_zone: Option<&NSTimeZone>);
157
158 #[cfg(feature = "UIFontDescriptor")]
159 #[unsafe(method(fontDesign))]
162 #[unsafe(method_family = none)]
163 pub fn fontDesign(&self) -> Retained<UIFontDescriptorSystemDesign>;
164
165 #[cfg(feature = "UIFontDescriptor")]
166 #[unsafe(method(setFontDesign:))]
170 #[unsafe(method_family = none)]
171 pub fn setFontDesign(&self, font_design: &UIFontDescriptorSystemDesign);
172
173 #[unsafe(method(availableDateRange))]
177 #[unsafe(method_family = none)]
178 pub fn availableDateRange(&self) -> Retained<NSDateInterval>;
179
180 #[unsafe(method(setAvailableDateRange:))]
184 #[unsafe(method_family = none)]
185 pub fn setAvailableDateRange(&self, available_date_range: &NSDateInterval);
186
187 #[unsafe(method(visibleDateComponents))]
203 #[unsafe(method_family = none)]
204 pub fn visibleDateComponents(&self) -> Retained<NSDateComponents>;
205
206 #[unsafe(method(setVisibleDateComponents:))]
210 #[unsafe(method_family = none)]
211 pub fn setVisibleDateComponents(&self, visible_date_components: &NSDateComponents);
212
213 #[unsafe(method(setVisibleDateComponents:animated:))]
228 #[unsafe(method_family = none)]
229 pub fn setVisibleDateComponents_animated(
230 &self,
231 date_components: &NSDateComponents,
232 animated: bool,
233 );
234
235 #[unsafe(method(wantsDateDecorations))]
240 #[unsafe(method_family = none)]
241 pub fn wantsDateDecorations(&self) -> bool;
242
243 #[unsafe(method(setWantsDateDecorations:))]
245 #[unsafe(method_family = none)]
246 pub fn setWantsDateDecorations(&self, wants_date_decorations: bool);
247
248 #[unsafe(method(reloadDecorationsForDateComponents:animated:))]
252 #[unsafe(method_family = none)]
253 pub fn reloadDecorationsForDateComponents_animated(
254 &self,
255 dates: &NSArray<NSDateComponents>,
256 animated: bool,
257 );
258 );
259}
260
261#[cfg(all(feature = "UIResponder", feature = "UIView"))]
263impl UICalendarView {
264 extern_methods!(
265 #[cfg(feature = "objc2-core-foundation")]
266 #[unsafe(method(initWithFrame:))]
267 #[unsafe(method_family = init)]
268 pub fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
269
270 #[unsafe(method(initWithCoder:))]
274 #[unsafe(method_family = init)]
275 pub unsafe fn initWithCoder(
276 this: Allocated<Self>,
277 coder: &NSCoder,
278 ) -> Option<Retained<Self>>;
279
280 #[unsafe(method(init))]
281 #[unsafe(method_family = init)]
282 pub fn init(this: Allocated<Self>) -> Retained<Self>;
283 );
284}
285
286#[cfg(all(feature = "UIResponder", feature = "UIView"))]
288impl UICalendarView {
289 extern_methods!(
290 #[unsafe(method(new))]
291 #[unsafe(method_family = new)]
292 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
293 );
294}
295
296extern_protocol!(
297 pub unsafe trait UICalendarViewDelegate: NSObjectProtocol + MainThreadOnly {
299 #[cfg(all(
300 feature = "UICalendarViewDecoration",
301 feature = "UIResponder",
302 feature = "UIView"
303 ))]
304 #[optional]
316 #[unsafe(method(calendarView:decorationForDateComponents:))]
317 #[unsafe(method_family = none)]
318 fn calendarView_decorationForDateComponents(
319 &self,
320 calendar_view: &UICalendarView,
321 date_components: &NSDateComponents,
322 ) -> Option<Retained<UICalendarViewDecoration>>;
323
324 #[cfg(all(feature = "UIResponder", feature = "UIView"))]
325 #[optional]
333 #[unsafe(method(calendarView:didChangeVisibleDateComponentsFrom:))]
334 #[unsafe(method_family = none)]
335 fn calendarView_didChangeVisibleDateComponentsFrom(
336 &self,
337 calendar_view: &UICalendarView,
338 previous_date_components: &NSDateComponents,
339 );
340 }
341);