objc2_home_kit/generated/
HMCalendarEvent.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// 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.
12    ///
13    ///
14    /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
15    /// &
16    /// Minutes are used. Other NSDateComponents such as
17    /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
18    /// 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.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmcalendarevent?language=objc)
21    #[unsafe(super(HMTimeEvent, HMEvent, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
24    pub struct HMCalendarEvent;
25);
26
27#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
28unsafe impl Send for HMCalendarEvent {}
29
30#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
31unsafe impl Sync for HMCalendarEvent {}
32
33#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
34extern_conformance!(
35    unsafe impl NSCopying for HMCalendarEvent {}
36);
37
38#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
39unsafe impl CopyingHelper for HMCalendarEvent {
40    type Result = Self;
41}
42
43#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
44extern_conformance!(
45    unsafe impl NSMutableCopying for HMCalendarEvent {}
46);
47
48#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
49unsafe impl MutableCopyingHelper for HMCalendarEvent {
50    type Result = HMMutableCalendarEvent;
51}
52
53#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
54extern_conformance!(
55    unsafe impl NSObjectProtocol for HMCalendarEvent {}
56);
57
58#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
59impl HMCalendarEvent {
60    extern_methods!(
61        #[unsafe(method(init))]
62        #[unsafe(method_family = init)]
63        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
64
65        /// Creates a calendar event
66        ///
67        ///
68        /// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
69        ///
70        ///
71        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
72        /// &
73        /// Minutes are used. Other NSDateComponents such as
74        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
75        /// 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.
76        ///
77        ///
78        /// Returns: Instance object representing the event trigger.
79        #[unsafe(method(initWithFireDateComponents:))]
80        #[unsafe(method_family = init)]
81        pub unsafe fn initWithFireDateComponents(
82            this: Allocated<Self>,
83            fire_date_components: &NSDateComponents,
84        ) -> Retained<Self>;
85
86        /// The date component that specifies the time when the event is fired
87        ///
88        ///
89        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
90        /// &
91        /// Minutes are used. Other NSDateComponents such as
92        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
93        /// 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.
94        ///
95        /// This property is not atomic.
96        ///
97        /// # Safety
98        ///
99        /// This might not be thread-safe.
100        #[unsafe(method(fireDateComponents))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
103    );
104}
105
106/// Methods declared on superclass `HMEvent`.
107#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
108impl HMCalendarEvent {
109    extern_methods!(
110        #[deprecated = "HMEvent is abstract"]
111        #[unsafe(method(new))]
112        #[unsafe(method_family = new)]
113        pub unsafe fn new() -> Retained<Self>;
114    );
115}
116
117extern_class!(
118    /// This class is used to represent a calendar event.
119    ///
120    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablecalendarevent?language=objc)
121    #[unsafe(super(HMCalendarEvent, HMTimeEvent, HMEvent, NSObject))]
122    #[derive(Debug, PartialEq, Eq, Hash)]
123    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
124    pub struct HMMutableCalendarEvent;
125);
126
127#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
128unsafe impl Send for HMMutableCalendarEvent {}
129
130#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
131unsafe impl Sync for HMMutableCalendarEvent {}
132
133#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
134extern_conformance!(
135    unsafe impl NSCopying for HMMutableCalendarEvent {}
136);
137
138#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
139unsafe impl CopyingHelper for HMMutableCalendarEvent {
140    type Result = HMCalendarEvent;
141}
142
143#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
144extern_conformance!(
145    unsafe impl NSMutableCopying for HMMutableCalendarEvent {}
146);
147
148#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
149unsafe impl MutableCopyingHelper for HMMutableCalendarEvent {
150    type Result = Self;
151}
152
153#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
154extern_conformance!(
155    unsafe impl NSObjectProtocol for HMMutableCalendarEvent {}
156);
157
158#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
159impl HMMutableCalendarEvent {
160    extern_methods!(
161        #[unsafe(method(init))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
164
165        /// The date component that specifies the time when the event is fired
166        ///
167        /// This property is not atomic.
168        ///
169        /// # Safety
170        ///
171        /// This might not be thread-safe.
172        #[unsafe(method(fireDateComponents))]
173        #[unsafe(method_family = none)]
174        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
175
176        /// Setter for [`fireDateComponents`][Self::fireDateComponents].
177        ///
178        /// # Safety
179        ///
180        /// This might not be thread-safe.
181        #[unsafe(method(setFireDateComponents:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn setFireDateComponents(&self, fire_date_components: &NSDateComponents);
184    );
185}
186
187/// Methods declared on superclass `HMCalendarEvent`.
188#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
189impl HMMutableCalendarEvent {
190    extern_methods!(
191        /// Creates a calendar event
192        ///
193        ///
194        /// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
195        ///
196        ///
197        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
198        /// &
199        /// Minutes are used. Other NSDateComponents such as
200        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
201        /// 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.
202        ///
203        ///
204        /// Returns: Instance object representing the event trigger.
205        #[unsafe(method(initWithFireDateComponents:))]
206        #[unsafe(method_family = init)]
207        pub unsafe fn initWithFireDateComponents(
208            this: Allocated<Self>,
209            fire_date_components: &NSDateComponents,
210        ) -> Retained<Self>;
211    );
212}
213
214/// Methods declared on superclass `HMEvent`.
215#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
216impl HMMutableCalendarEvent {
217    extern_methods!(
218        #[deprecated = "HMEvent is abstract"]
219        #[unsafe(method(new))]
220        #[unsafe(method_family = new)]
221        pub unsafe fn new() -> Retained<Self>;
222    );
223}