1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicalendarselectionweekofyear?language=objc)
#[unsafe(super(UICalendarSelection, NSObject))]
#[thread_kind = MainThreadOnly]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "UICalendarSelection")]
pub struct UICalendarSelectionWeekOfYear;
);
#[cfg(feature = "UICalendarSelection")]
extern_conformance!(
unsafe impl NSObjectProtocol for UICalendarSelectionWeekOfYear {}
);
#[cfg(feature = "UICalendarSelection")]
impl UICalendarSelectionWeekOfYear {
extern_methods!(
/// The currently selected week of year in the Calendar view. The components must include `[.yearForWeekOfYear, .weekOfYear]`.
#[unsafe(method(selectedWeekOfYear))]
#[unsafe(method_family = none)]
pub fn selectedWeekOfYear(&self) -> Option<Retained<NSDateComponents>>;
/// Setter for [`selectedWeekOfYear`][Self::selectedWeekOfYear].
///
/// This is [copied][objc2_foundation::NSCopying::copy] when set.
#[unsafe(method(setSelectedWeekOfYear:))]
#[unsafe(method_family = none)]
pub fn setSelectedWeekOfYear(&self, selected_week_of_year: Option<&NSDateComponents>);
/// Sets the dates to display in the calendar, with an option to animate the setting.
#[unsafe(method(setSelectedWeekOfYear:animated:))]
#[unsafe(method_family = none)]
pub fn setSelectedWeekOfYear_animated(
&self,
selected_week_of_year: Option<&NSDateComponents>,
animated: bool,
);
/// The object that acts as the delegate of the calendar view selection
#[unsafe(method(delegate))]
#[unsafe(method_family = none)]
pub fn delegate(
&self,
) -> Option<Retained<ProtocolObject<dyn UICalendarSelectionWeekOfYearDelegate>>>;
/// Creates a new multi-date selection with the specified delegate.
#[unsafe(method(initWithDelegate:))]
#[unsafe(method_family = init)]
pub fn initWithDelegate(
this: Allocated<Self>,
delegate: Option<&ProtocolObject<dyn UICalendarSelectionWeekOfYearDelegate>>,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `UICalendarSelection`.
#[cfg(feature = "UICalendarSelection")]
impl UICalendarSelectionWeekOfYear {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
extern_protocol!(
/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicalendarselectionweekofyeardelegate?language=objc)
pub unsafe trait UICalendarSelectionWeekOfYearDelegate:
NSObjectProtocol + MainThreadOnly
{
#[cfg(feature = "UICalendarSelection")]
/// Called after the user selects a week of year in the calendar view.
///
///
/// Parameter `selection`: The
/// `UICalendarSelectionWeekOfYear`
/// Parameter `dateComponents`: The date that was selected by the user.
#[unsafe(method(weekOfYearSelection:didSelectWeekOfYear:))]
#[unsafe(method_family = none)]
fn weekOfYearSelection_didSelectWeekOfYear(
&self,
selection: &UICalendarSelectionWeekOfYear,
week_of_year_components: Option<&NSDateComponents>,
);
#[cfg(feature = "UICalendarSelection")]
/// Determines if a week of year is selectable. Dates that are not selectable will be disabled in the calendar view.
///
///
/// Parameter `selection`: The
/// `UICalendarSelectionWeekOfYear`
/// Parameter `dateComponents`: The date to be checked by selection.
///
///
/// Returns: YES if the date can be selected, NO otherwise.
#[optional]
#[unsafe(method(weekOfYearSelection:canSelectWeekOfYear:))]
#[unsafe(method_family = none)]
fn weekOfYearSelection_canSelectWeekOfYear(
&self,
selection: &UICalendarSelectionWeekOfYear,
week_of_year_components: Option<&NSDateComponents>,
) -> bool;
}
);