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"))]
34unsafe impl NSCopying for HMCalendarEvent {}
35
36#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
37unsafe impl CopyingHelper for HMCalendarEvent {
38    type Result = Self;
39}
40
41#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
42unsafe impl NSMutableCopying for HMCalendarEvent {}
43
44#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
45unsafe impl MutableCopyingHelper for HMCalendarEvent {
46    type Result = HMMutableCalendarEvent;
47}
48
49#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
50unsafe impl NSObjectProtocol for HMCalendarEvent {}
51
52#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
53impl HMCalendarEvent {
54    extern_methods!(
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58
59        /// Creates a calendar event
60        ///
61        ///
62        /// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
63        ///
64        ///
65        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
66        /// &
67        /// Minutes are used. Other NSDateComponents such as
68        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
69        /// 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.
70        ///
71        ///
72        /// Returns: Instance object representing the event trigger.
73        #[unsafe(method(initWithFireDateComponents:))]
74        #[unsafe(method_family = init)]
75        pub unsafe fn initWithFireDateComponents(
76            this: Allocated<Self>,
77            fire_date_components: &NSDateComponents,
78        ) -> Retained<Self>;
79
80        /// The date component that specifies the time when the event is fired
81        ///
82        ///
83        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
84        /// &
85        /// Minutes are used. Other NSDateComponents such as
86        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
87        /// 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.
88        #[unsafe(method(fireDateComponents))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
91    );
92}
93
94/// Methods declared on superclass `HMEvent`.
95#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
96impl HMCalendarEvent {
97    extern_methods!(
98        #[deprecated = "HMEvent is abstract"]
99        #[unsafe(method(new))]
100        #[unsafe(method_family = new)]
101        pub unsafe fn new() -> Retained<Self>;
102    );
103}
104
105extern_class!(
106    /// This class is used to represent a calendar event.
107    ///
108    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablecalendarevent?language=objc)
109    #[unsafe(super(HMCalendarEvent, HMTimeEvent, HMEvent, NSObject))]
110    #[derive(Debug, PartialEq, Eq, Hash)]
111    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
112    pub struct HMMutableCalendarEvent;
113);
114
115#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
116unsafe impl Send for HMMutableCalendarEvent {}
117
118#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
119unsafe impl Sync for HMMutableCalendarEvent {}
120
121#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
122unsafe impl NSCopying for HMMutableCalendarEvent {}
123
124#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
125unsafe impl CopyingHelper for HMMutableCalendarEvent {
126    type Result = HMCalendarEvent;
127}
128
129#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
130unsafe impl NSMutableCopying for HMMutableCalendarEvent {}
131
132#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
133unsafe impl MutableCopyingHelper for HMMutableCalendarEvent {
134    type Result = Self;
135}
136
137#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
138unsafe impl NSObjectProtocol for HMMutableCalendarEvent {}
139
140#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
141impl HMMutableCalendarEvent {
142    extern_methods!(
143        #[unsafe(method(init))]
144        #[unsafe(method_family = init)]
145        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
146
147        /// The date component that specifies the time when the event is fired
148        #[unsafe(method(fireDateComponents))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn fireDateComponents(&self) -> Retained<NSDateComponents>;
151
152        /// Setter for [`fireDateComponents`][Self::fireDateComponents].
153        #[unsafe(method(setFireDateComponents:))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn setFireDateComponents(&self, fire_date_components: &NSDateComponents);
156    );
157}
158
159/// Methods declared on superclass `HMCalendarEvent`.
160#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
161impl HMMutableCalendarEvent {
162    extern_methods!(
163        /// Creates a calendar event
164        ///
165        ///
166        /// Parameter `fireDateComponents`: The date component that specifies the time when the event is fired
167        ///
168        ///
169        /// Note: : Not all the fields in NSDateComponents are used to calculate the next fire date. Only Month, Day
170        /// &
171        /// Minutes are used. Other NSDateComponents such as
172        /// year, weekday, quarter, week of the year / month are not used in calculation for next fire date.
173        /// 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.
174        ///
175        ///
176        /// Returns: Instance object representing the event trigger.
177        #[unsafe(method(initWithFireDateComponents:))]
178        #[unsafe(method_family = init)]
179        pub unsafe fn initWithFireDateComponents(
180            this: Allocated<Self>,
181            fire_date_components: &NSDateComponents,
182        ) -> Retained<Self>;
183    );
184}
185
186/// Methods declared on superclass `HMEvent`.
187#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
188impl HMMutableCalendarEvent {
189    extern_methods!(
190        #[deprecated = "HMEvent is abstract"]
191        #[unsafe(method(new))]
192        #[unsafe(method_family = new)]
193        pub unsafe fn new() -> Retained<Self>;
194    );
195}