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        #[unsafe(method(significantEvent))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
84
85        /// offset An offset from the time of the signficant event. To specify an offset before the significant event, the
86        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
87        /// 'minute' property must be set to -30.
88        #[unsafe(method(offset))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn offset(&self) -> Option<Retained<NSDateComponents>>;
91    );
92}
93
94/// Methods declared on superclass `HMEvent`.
95#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
96impl HMSignificantTimeEvent {
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 significant time event.
107    ///
108    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablesignificanttimeevent?language=objc)
109    #[unsafe(super(HMSignificantTimeEvent, HMTimeEvent, HMEvent, NSObject))]
110    #[derive(Debug, PartialEq, Eq, Hash)]
111    #[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
112    pub struct HMMutableSignificantTimeEvent;
113);
114
115#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
116unsafe impl Send for HMMutableSignificantTimeEvent {}
117
118#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
119unsafe impl Sync for HMMutableSignificantTimeEvent {}
120
121#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
122extern_conformance!(
123    unsafe impl NSCopying for HMMutableSignificantTimeEvent {}
124);
125
126#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
127unsafe impl CopyingHelper for HMMutableSignificantTimeEvent {
128    type Result = HMSignificantTimeEvent;
129}
130
131#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
132extern_conformance!(
133    unsafe impl NSMutableCopying for HMMutableSignificantTimeEvent {}
134);
135
136#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
137unsafe impl MutableCopyingHelper for HMMutableSignificantTimeEvent {
138    type Result = Self;
139}
140
141#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
142extern_conformance!(
143    unsafe impl NSObjectProtocol for HMMutableSignificantTimeEvent {}
144);
145
146#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
147impl HMMutableSignificantTimeEvent {
148    extern_methods!(
149        #[cfg(feature = "HMSignificantEvents")]
150        /// significantEvent The significant event for the trigger.
151        #[unsafe(method(significantEvent))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn significantEvent(&self) -> Retained<HMSignificantEvent>;
154
155        #[cfg(feature = "HMSignificantEvents")]
156        /// Setter for [`significantEvent`][Self::significantEvent].
157        #[unsafe(method(setSignificantEvent:))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn setSignificantEvent(&self, significant_event: &HMSignificantEvent);
160
161        /// offset An offset from the time of the significant event. To specify an offset before the significant event, the
162        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
163        /// 'minute' property must be set to -30.
164        #[unsafe(method(offset))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn offset(&self) -> Retained<NSDateComponents>;
167
168        /// Setter for [`offset`][Self::offset].
169        #[unsafe(method(setOffset:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setOffset(&self, offset: &NSDateComponents);
172    );
173}
174
175/// Methods declared on superclass `HMSignificantTimeEvent`.
176#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
177impl HMMutableSignificantTimeEvent {
178    extern_methods!(
179        #[unsafe(method(init))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
182
183        #[cfg(feature = "HMSignificantEvents")]
184        /// Creates a significant time event.
185        ///
186        ///
187        /// Parameter `significantEvent`: The significant event for the trigger.
188        ///
189        ///
190        /// Parameter `offset`: An offset from the time of the significant event. To specify an offset before the significant event, the
191        /// properties of the NSDateComponents must be negative value. e.g. To specify 30 mins before sunset, the
192        /// 'minute' property must be set to -30.
193        ///
194        ///
195        /// Returns: Instance object representing the significant event.
196        #[unsafe(method(initWithSignificantEvent:offset:))]
197        #[unsafe(method_family = init)]
198        pub unsafe fn initWithSignificantEvent_offset(
199            this: Allocated<Self>,
200            significant_event: &HMSignificantEvent,
201            offset: Option<&NSDateComponents>,
202        ) -> Retained<Self>;
203    );
204}
205
206/// Methods declared on superclass `HMEvent`.
207#[cfg(all(feature = "HMEvent", feature = "HMTimeEvent"))]
208impl HMMutableSignificantTimeEvent {
209    extern_methods!(
210        #[deprecated = "HMEvent is abstract"]
211        #[unsafe(method(new))]
212        #[unsafe(method_family = new)]
213        pub unsafe fn new() -> Retained<Self>;
214    );
215}