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        #[unsafe(method(fireDateComponents))]
95        #[unsafe(method_family = none)]
96        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
97    );
98}
99
100/// Methods declared on superclass `HMEvent`.
101#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
102impl HMCalendarEvent {
103    extern_methods!(
104        #[deprecated = "HMEvent is abstract"]
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}
110
111extern_class!(
112    /// This class is used to represent a calendar event.
113    ///
114    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablecalendarevent?language=objc)
115    #[unsafe(super(HMCalendarEvent, HMTimeEvent, HMEvent, NSObject))]
116    #[derive(Debug, PartialEq, Eq, Hash)]
117    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
118    pub struct HMMutableCalendarEvent;
119);
120
121#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
122unsafe impl Send for HMMutableCalendarEvent {}
123
124#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
125unsafe impl Sync for HMMutableCalendarEvent {}
126
127#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
128extern_conformance!(
129    unsafe impl NSCopying for HMMutableCalendarEvent {}
130);
131
132#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
133unsafe impl CopyingHelper for HMMutableCalendarEvent {
134    type Result = HMCalendarEvent;
135}
136
137#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
138extern_conformance!(
139    unsafe impl NSMutableCopying for HMMutableCalendarEvent {}
140);
141
142#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
143unsafe impl MutableCopyingHelper for HMMutableCalendarEvent {
144    type Result = Self;
145}
146
147#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
148extern_conformance!(
149    unsafe impl NSObjectProtocol for HMMutableCalendarEvent {}
150);
151
152#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
153impl HMMutableCalendarEvent {
154    extern_methods!(
155        #[unsafe(method(init))]
156        #[unsafe(method_family = init)]
157        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
158
159        /// The date component that specifies the time when the event is fired
160        #[unsafe(method(fireDateComponents))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
163
164        /// Setter for [`fireDateComponents`][Self::fireDateComponents].
165        #[unsafe(method(setFireDateComponents:))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn setFireDateComponents(&self, fire_date_components: &NSDateComponents);
168    );
169}
170
171/// Methods declared on superclass `HMCalendarEvent`.
172#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
173impl HMMutableCalendarEvent {
174    extern_methods!(
175        /// Creates a calendar event
176        ///
177        ///
178        /// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
179        ///
180        ///
181        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
182        /// &
183        /// Minutes are used. Other NSDateComponents such as
184        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
185        /// 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.
186        ///
187        ///
188        /// Returns: Instance object representing the event trigger.
189        #[unsafe(method(initWithFireDateComponents:))]
190        #[unsafe(method_family = init)]
191        pub unsafe fn initWithFireDateComponents(
192            this: Allocated<Self>,
193            fire_date_components: &NSDateComponents,
194        ) -> Retained<Self>;
195    );
196}
197
198/// Methods declared on superclass `HMEvent`.
199#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
200impl HMMutableCalendarEvent {
201    extern_methods!(
202        #[deprecated = "HMEvent is abstract"]
203        #[unsafe(method(new))]
204        #[unsafe(method_family = new)]
205        pub unsafe fn new() -> Retained<Self>;
206    );
207}