objc2_ui_kit/generated/
UICalendarSelectionWeekOfYear.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 UICalendarSelectionWeekOfYear;
17);
18
19#[cfg(feature = "UICalendarSelection")]
20extern_conformance!(
21 unsafe impl NSObjectProtocol for UICalendarSelectionWeekOfYear {}
22);
23
24#[cfg(feature = "UICalendarSelection")]
25impl UICalendarSelectionWeekOfYear {
26 extern_methods!(
27 #[unsafe(method(selectedWeekOfYear))]
29 #[unsafe(method_family = none)]
30 pub fn selectedWeekOfYear(&self) -> Option<Retained<NSDateComponents>>;
31
32 #[unsafe(method(setSelectedWeekOfYear:))]
36 #[unsafe(method_family = none)]
37 pub fn setSelectedWeekOfYear(&self, selected_week_of_year: Option<&NSDateComponents>);
38
39 #[unsafe(method(setSelectedWeekOfYear:animated:))]
41 #[unsafe(method_family = none)]
42 pub fn setSelectedWeekOfYear_animated(
43 &self,
44 selected_week_of_year: Option<&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 UICalendarSelectionWeekOfYearDelegate>>>;
54
55 #[unsafe(method(initWithDelegate:))]
57 #[unsafe(method_family = init)]
58 pub fn initWithDelegate(
59 this: Allocated<Self>,
60 delegate: Option<&ProtocolObject<dyn UICalendarSelectionWeekOfYearDelegate>>,
61 ) -> Retained<Self>;
62 );
63}
64
65#[cfg(feature = "UICalendarSelection")]
67impl UICalendarSelectionWeekOfYear {
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 UICalendarSelectionWeekOfYearDelegate:
82 NSObjectProtocol + MainThreadOnly
83 {
84 #[cfg(feature = "UICalendarSelection")]
85 #[unsafe(method(weekOfYearSelection:didSelectWeekOfYear:))]
92 #[unsafe(method_family = none)]
93 fn weekOfYearSelection_didSelectWeekOfYear(
94 &self,
95 selection: &UICalendarSelectionWeekOfYear,
96 week_of_year_components: Option<&NSDateComponents>,
97 );
98
99 #[cfg(feature = "UICalendarSelection")]
100 #[optional]
110 #[unsafe(method(weekOfYearSelection:canSelectWeekOfYear:))]
111 #[unsafe(method_family = none)]
112 fn weekOfYearSelection_canSelectWeekOfYear(
113 &self,
114 selection: &UICalendarSelectionWeekOfYear,
115 week_of_year_components: Option<&NSDateComponents>,
116 ) -> bool;
117 }
118);