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"))]
27unsafe impl NSCopying for HMSignificantTimeEvent {}
28
29#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
30unsafe impl CopyingHelper for HMSignificantTimeEvent {
31    type Result = Self;
32}
33
34#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
35unsafe impl NSMutableCopying for HMSignificantTimeEvent {}
36
37#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
38unsafe impl MutableCopyingHelper for HMSignificantTimeEvent {
39    type Result = HMMutableSignificantTimeEvent;
40}
41
42#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
43unsafe impl NSObjectProtocol for HMSignificantTimeEvent {}
44
45#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
46impl HMSignificantTimeEvent {
47    extern_methods!(
48        #[unsafe(method(init))]
49        #[unsafe(method_family = init)]
50        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
51
52        #[cfg(feature = "HMSignificantEvents")]
53        /// Creates a significant time event.
54        ///
55        ///
56        /// Parameter `significantEvent`: The significant event for the trigger.
57        ///
58        ///
59        /// Parameter `offset`: An offset from the time of the significant event. To specify an offset before the significant event, the
60        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
61        /// 'minute' property must be set to -30.
62        ///
63        ///
64        /// Returns: Instance object representing the significant event.
65        #[unsafe(method(initWithSignificantEvent:offset:))]
66        #[unsafe(method_family = init)]
67        pub unsafe fn initWithSignificantEvent_offset(
68            this: Allocated<Self>,
69            significant_event: &HMSignificantEvent,
70            offset: Option<&NSDateComponents>,
71        ) -> Retained<Self>;
72
73        #[cfg(feature = "HMSignificantEvents")]
74        /// significantEvent The significant event for the trigger.
75        #[unsafe(method(significantEvent))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
78
79        /// offset An offset from the time of the signficant event. To specify an offset before the significant event, the
80        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
81        /// 'minute' property must be set to -30.
82        #[unsafe(method(offset))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn offset(&self) -> Option<Retained<NSDateComponents>>;
85    );
86}
87
88/// Methods declared on superclass `HMEvent`.
89#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
90impl HMSignificantTimeEvent {
91    extern_methods!(
92        #[deprecated = "HMEvent is abstract"]
93        #[unsafe(method(new))]
94        #[unsafe(method_family = new)]
95        pub unsafe fn new() -> Retained<Self>;
96    );
97}
98
99extern_class!(
100    /// This class is used to represent a significant time event.
101    ///
102    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablesignificanttimeevent?language=objc)
103    #[unsafe(super(HMSignificantTimeEvent, HMTimeEvent, HMEvent, NSObject))]
104    #[derive(Debug, PartialEq, Eq, Hash)]
105    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
106    pub struct HMMutableSignificantTimeEvent;
107);
108
109#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
110unsafe impl Send for HMMutableSignificantTimeEvent {}
111
112#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
113unsafe impl Sync for HMMutableSignificantTimeEvent {}
114
115#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
116unsafe impl NSCopying for HMMutableSignificantTimeEvent {}
117
118#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
119unsafe impl CopyingHelper for HMMutableSignificantTimeEvent {
120    type Result = HMSignificantTimeEvent;
121}
122
123#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
124unsafe impl NSMutableCopying for HMMutableSignificantTimeEvent {}
125
126#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
127unsafe impl MutableCopyingHelper for HMMutableSignificantTimeEvent {
128    type Result = Self;
129}
130
131#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
132unsafe impl NSObjectProtocol for HMMutableSignificantTimeEvent {}
133
134#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
135impl HMMutableSignificantTimeEvent {
136    extern_methods!(
137        #[cfg(feature = "HMSignificantEvents")]
138        /// significantEvent The significant event for the trigger.
139        #[unsafe(method(significantEvent))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
142
143        #[cfg(feature = "HMSignificantEvents")]
144        /// Setter for [`significantEvent`][Self::significantEvent].
145        #[unsafe(method(setSignificantEvent:))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn setSignificantEvent(&self, significant_event: &HMSignificantEvent);
148
149        /// offset An offset from the time of the significant event. To specify an offset before the significant event, the
150        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
151        /// 'minute' property must be set to -30.
152        #[unsafe(method(offset))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn offset(&self) -> Retained<NSDateComponents>;
155
156        /// Setter for [`offset`][Self::offset].
157        #[unsafe(method(setOffset:))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn setOffset(&self, offset: &NSDateComponents);
160    );
161}
162
163/// Methods declared on superclass `HMSignificantTimeEvent`.
164#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
165impl HMMutableSignificantTimeEvent {
166    extern_methods!(
167        #[unsafe(method(init))]
168        #[unsafe(method_family = init)]
169        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
170
171        #[cfg(feature = "HMSignificantEvents")]
172        /// Creates a significant time event.
173        ///
174        ///
175        /// Parameter `significantEvent`: The significant event for the trigger.
176        ///
177        ///
178        /// Parameter `offset`: An offset from the time of the significant event. To specify an offset before the significant event, the
179        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
180        /// 'minute' property must be set to -30.
181        ///
182        ///
183        /// Returns: Instance object representing the significant event.
184        #[unsafe(method(initWithSignificantEvent:offset:))]
185        #[unsafe(method_family = init)]
186        pub unsafe fn initWithSignificantEvent_offset(
187            this: Allocated<Self>,
188            significant_event: &HMSignificantEvent,
189            offset: Option<&NSDateComponents>,
190        ) -> Retained<Self>;
191    );
192}
193
194/// Methods declared on superclass `HMEvent`.
195#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
196impl HMMutableSignificantTimeEvent {
197    extern_methods!(
198        #[deprecated = "HMEvent is abstract"]
199        #[unsafe(method(new))]
200        #[unsafe(method_family = new)]
201        pub unsafe fn new() -> Retained<Self>;
202    );
203}