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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
//! 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!(
/// A calendar event which fires at an absolute time. It can also be used to set up a recurring events which will fire at a scheduled time.
///
///
/// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
/// &
/// Minutes are used. Other NSDateComponents such as
/// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
/// If its expected to fire on the same day, it should be at least 1 minute ahead or it could get scheduled for the next recurrent day.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcalendarevent?language=objc)
#[unsafe(super(HMTimeEvent, HMEvent, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
pub struct HMCalendarEvent;
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl Send for HMCalendarEvent {}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl Sync for HMCalendarEvent {}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSCopying for HMCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl CopyingHelper for HMCalendarEvent {
type Result = Self;
}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSMutableCopying for HMCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl MutableCopyingHelper for HMCalendarEvent {
type Result = HMMutableCalendarEvent;
}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSObjectProtocol for HMCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
impl HMCalendarEvent {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// Creates a calendar event
///
///
/// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
///
///
/// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
/// &
/// Minutes are used. Other NSDateComponents such as
/// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
/// If its expected to fire on the same day, it should be at least 1 minute ahead or it could get scheduled for the next recurrent day.
///
///
/// Returns: Instance object representing the event trigger.
#[unsafe(method(initWithFireDateComponents:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFireDateComponents(
this: Allocated<Self>,
fire_date_components: &NSDateComponents,
) -> Retained<Self>;
/// The date component that specifies the time when the event is fired
///
///
/// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
/// &
/// Minutes are used. Other NSDateComponents such as
/// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
/// If its expected to fire on the same day, it should be at least 1 minute ahead or it could get scheduled for the next recurrent day.
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(fireDateComponents))]
#[unsafe(method_family = none)]
pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
);
}
/// Methods declared on superclass `HMEvent`.
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
impl HMCalendarEvent {
extern_methods!(
#[deprecated = "HMEvent is abstract"]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
/// This class is used to represent a calendar event.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablecalendarevent?language=objc)
#[unsafe(super(HMCalendarEvent, HMTimeEvent, HMEvent, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
pub struct HMMutableCalendarEvent;
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl Send for HMMutableCalendarEvent {}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl Sync for HMMutableCalendarEvent {}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSCopying for HMMutableCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl CopyingHelper for HMMutableCalendarEvent {
type Result = HMCalendarEvent;
}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSMutableCopying for HMMutableCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
unsafe impl MutableCopyingHelper for HMMutableCalendarEvent {
type Result = Self;
}
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
extern_conformance!(
unsafe impl NSObjectProtocol for HMMutableCalendarEvent {}
);
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
impl HMMutableCalendarEvent {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
/// The date component that specifies the time when the event is fired
///
/// This property is not atomic.
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(fireDateComponents))]
#[unsafe(method_family = none)]
pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
/// Setter for [`fireDateComponents`][Self::fireDateComponents].
///
/// # Safety
///
/// This might not be thread-safe.
#[unsafe(method(setFireDateComponents:))]
#[unsafe(method_family = none)]
pub unsafe fn setFireDateComponents(&self, fire_date_components: &NSDateComponents);
);
}
/// Methods declared on superclass `HMCalendarEvent`.
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
impl HMMutableCalendarEvent {
extern_methods!(
/// Creates a calendar event
///
///
/// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
///
///
/// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
/// &
/// Minutes are used. Other NSDateComponents such as
/// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
/// If its expected to fire on the same day, it should be at least 1 minute ahead or it could get scheduled for the next recurrent day.
///
///
/// Returns: Instance object representing the event trigger.
#[unsafe(method(initWithFireDateComponents:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithFireDateComponents(
this: Allocated<Self>,
fire_date_components: &NSDateComponents,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `HMEvent`.
#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
impl HMMutableCalendarEvent {
extern_methods!(
#[deprecated = "HMEvent is abstract"]
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}