objc2_home_kit/generated/
HMSignificantTimeEvent.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    /// This class is used to represent a significant time event.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmsignificanttimeevent?language=objc)
14    #[unsafe(super(HMTimeEvent, HMEvent, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
17    pub struct HMSignificantTimeEvent;
18);
19
20#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
21unsafe impl Send for HMSignificantTimeEvent {}
22
23#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
24unsafe impl Sync for HMSignificantTimeEvent {}
25
26#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
27extern_conformance!(
28    unsafe impl NSCopying for HMSignificantTimeEvent {}
29);
30
31#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
32unsafe impl CopyingHelper for HMSignificantTimeEvent {
33    type Result = Self;
34}
35
36#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
37extern_conformance!(
38    unsafe impl NSMutableCopying for HMSignificantTimeEvent {}
39);
40
41#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
42unsafe impl MutableCopyingHelper for HMSignificantTimeEvent {
43    type Result = HMMutableSignificantTimeEvent;
44}
45
46#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
47extern_conformance!(
48    unsafe impl NSObjectProtocol for HMSignificantTimeEvent {}
49);
50
51#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
52impl HMSignificantTimeEvent {
53    extern_methods!(
54        #[unsafe(method(init))]
55        #[unsafe(method_family = init)]
56        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
57
58        #[cfg(feature = "HMSignificantEvents")]
59        /// Creates a significant time event.
60        ///
61        ///
62        /// Parameter `significantEvent`: The significant event for the trigger.
63        ///
64        ///
65        /// Parameter `offset`: An offset from the time of the significant event. To specify an offset before the significant event, the
66        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
67        /// 'minute' property must be set to -30.
68        ///
69        ///
70        /// Returns: Instance object representing the significant event.
71        #[unsafe(method(initWithSignificantEvent:offset:))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn initWithSignificantEvent_offset(
74            this: Allocated<Self>,
75            significant_event: &HMSignificantEvent,
76            offset: Option<&NSDateComponents>,
77        ) -> Retained<Self>;
78
79        #[cfg(feature = "HMSignificantEvents")]
80        /// significantEvent The significant event for the trigger.
81        ///
82        /// This property is not atomic.
83        ///
84        /// # Safety
85        ///
86        /// This might not be thread-safe.
87        #[unsafe(method(significantEvent))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
90
91        /// offset An offset from the time of the significant event. To specify an offset before the significant event, the
92        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
93        /// 'minute' property must be set to -30.
94        ///
95        /// This property is not atomic.
96        ///
97        /// # Safety
98        ///
99        /// This might not be thread-safe.
100        #[unsafe(method(offset))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn offset(&self) -> Option<Retained<NSDateComponents>>;
103    );
104}
105
106/// Methods declared on superclass `HMEvent`.
107#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
108impl HMSignificantTimeEvent {
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 significant time event.
119    ///
120    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablesignificanttimeevent?language=objc)
121    #[unsafe(super(HMSignificantTimeEvent, HMTimeEvent, HMEvent, NSObject))]
122    #[derive(Debug, PartialEq, Eq, Hash)]
123    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
124    pub struct HMMutableSignificantTimeEvent;
125);
126
127#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
128unsafe impl Send for HMMutableSignificantTimeEvent {}
129
130#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
131unsafe impl Sync for HMMutableSignificantTimeEvent {}
132
133#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
134extern_conformance!(
135    unsafe impl NSCopying for HMMutableSignificantTimeEvent {}
136);
137
138#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
139unsafe impl CopyingHelper for HMMutableSignificantTimeEvent {
140    type Result = HMSignificantTimeEvent;
141}
142
143#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
144extern_conformance!(
145    unsafe impl NSMutableCopying for HMMutableSignificantTimeEvent {}
146);
147
148#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
149unsafe impl MutableCopyingHelper for HMMutableSignificantTimeEvent {
150    type Result = Self;
151}
152
153#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
154extern_conformance!(
155    unsafe impl NSObjectProtocol for HMMutableSignificantTimeEvent {}
156);
157
158#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
159impl HMMutableSignificantTimeEvent {
160    extern_methods!(
161        #[cfg(feature = "HMSignificantEvents")]
162        /// significantEvent The significant event for the trigger.
163        ///
164        /// This property is not atomic.
165        ///
166        /// # Safety
167        ///
168        /// This might not be thread-safe.
169        #[unsafe(method(significantEvent))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
172
173        #[cfg(feature = "HMSignificantEvents")]
174        /// Setter for [`significantEvent`][Self::significantEvent].
175        ///
176        /// # Safety
177        ///
178        /// This might not be thread-safe.
179        #[unsafe(method(setSignificantEvent:))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn setSignificantEvent(&self, significant_event: &HMSignificantEvent);
182
183        /// offset An offset from the time of the significant event. To specify an offset before the significant event, the
184        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
185        /// 'minute' property must be set to -30.
186        ///
187        /// This property is not atomic.
188        ///
189        /// # Safety
190        ///
191        /// This might not be thread-safe.
192        #[unsafe(method(offset))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn offset(&self) -> Retained<NSDateComponents>;
195
196        /// Setter for [`offset`][Self::offset].
197        ///
198        /// # Safety
199        ///
200        /// This might not be thread-safe.
201        #[unsafe(method(setOffset:))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn setOffset(&self, offset: &NSDateComponents);
204    );
205}
206
207/// Methods declared on superclass `HMSignificantTimeEvent`.
208#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
209impl HMMutableSignificantTimeEvent {
210    extern_methods!(
211        #[unsafe(method(init))]
212        #[unsafe(method_family = init)]
213        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
214
215        #[cfg(feature = "HMSignificantEvents")]
216        /// Creates a significant time event.
217        ///
218        ///
219        /// Parameter `significantEvent`: The significant event for the trigger.
220        ///
221        ///
222        /// Parameter `offset`: An offset from the time of the significant event. To specify an offset before the significant event, the
223        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
224        /// 'minute' property must be set to -30.
225        ///
226        ///
227        /// Returns: Instance object representing the significant event.
228        #[unsafe(method(initWithSignificantEvent:offset:))]
229        #[unsafe(method_family = init)]
230        pub unsafe fn initWithSignificantEvent_offset(
231            this: Allocated<Self>,
232            significant_event: &HMSignificantEvent,
233            offset: Option<&NSDateComponents>,
234        ) -> Retained<Self>;
235    );
236}
237
238/// Methods declared on superclass `HMEvent`.
239#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
240impl HMMutableSignificantTimeEvent {
241    extern_methods!(
242        #[deprecated = "HMEvent is abstract"]
243        #[unsafe(method(new))]
244        #[unsafe(method_family = new)]
245        pub unsafe fn new() -> Retained<Self>;
246    );
247}