objc2_home_kit/generated/
HMPresenceEvent.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 the presence of users in a home.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmpresenceevent?language=objc)
14    #[unsafe(super(HMEvent, NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[cfg(feature = "HMEvent")]
17    pub struct HMPresenceEvent;
18);
19
20#[cfg(feature = "HMEvent")]
21unsafe impl Send for HMPresenceEvent {}
22
23#[cfg(feature = "HMEvent")]
24unsafe impl Sync for HMPresenceEvent {}
25
26#[cfg(feature = "HMEvent")]
27extern_conformance!(
28    unsafe impl NSCopying for HMPresenceEvent {}
29);
30
31#[cfg(feature = "HMEvent")]
32unsafe impl CopyingHelper for HMPresenceEvent {
33    type Result = Self;
34}
35
36#[cfg(feature = "HMEvent")]
37extern_conformance!(
38    unsafe impl NSMutableCopying for HMPresenceEvent {}
39);
40
41#[cfg(feature = "HMEvent")]
42unsafe impl MutableCopyingHelper for HMPresenceEvent {
43    type Result = HMMutablePresenceEvent;
44}
45
46#[cfg(feature = "HMEvent")]
47extern_conformance!(
48    unsafe impl NSObjectProtocol for HMPresenceEvent {}
49);
50
51#[cfg(feature = "HMEvent")]
52impl HMPresenceEvent {
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 = "HMPresenceEventDefines")]
59        /// Creates a presence based event.
60        ///
61        ///
62        /// Parameter `presenceEventType`: The event type desired for the event.
63        ///
64        ///
65        /// Parameter `presenceUserType`: The user type whose presence will trigger the event.
66        ///
67        ///
68        /// Returns: Instance object representing the presence event.
69        #[unsafe(method(initWithPresenceEventType:presenceUserType:))]
70        #[unsafe(method_family = init)]
71        pub unsafe fn initWithPresenceEventType_presenceUserType(
72            this: Allocated<Self>,
73            presence_event_type: HMPresenceEventType,
74            presence_user_type: HMPresenceEventUserType,
75        ) -> Retained<Self>;
76
77        #[cfg(feature = "HMPresenceEventDefines")]
78        /// presenceEventType The event type that will trigger the event.
79        ///
80        /// This property is not atomic.
81        ///
82        /// # Safety
83        ///
84        /// This might not be thread-safe.
85        #[unsafe(method(presenceEventType))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn presenceEventType(&self) -> HMPresenceEventType;
88
89        #[cfg(feature = "HMPresenceEventDefines")]
90        /// presenceUserType The user type whose presence will trigger the event.
91        ///
92        /// This property is not atomic.
93        ///
94        /// # Safety
95        ///
96        /// This might not be thread-safe.
97        #[unsafe(method(presenceUserType))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn presenceUserType(&self) -> HMPresenceEventUserType;
100    );
101}
102
103/// Methods declared on superclass `HMEvent`.
104#[cfg(feature = "HMEvent")]
105impl HMPresenceEvent {
106    extern_methods!(
107        #[deprecated = "HMEvent is abstract"]
108        #[unsafe(method(new))]
109        #[unsafe(method_family = new)]
110        pub unsafe fn new() -> Retained<Self>;
111    );
112}
113
114extern_class!(
115    /// This class is used to represent the presence of users in a home.
116    ///
117    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablepresenceevent?language=objc)
118    #[unsafe(super(HMPresenceEvent, HMEvent, NSObject))]
119    #[derive(Debug, PartialEq, Eq, Hash)]
120    #[cfg(feature = "HMEvent")]
121    pub struct HMMutablePresenceEvent;
122);
123
124#[cfg(feature = "HMEvent")]
125unsafe impl Send for HMMutablePresenceEvent {}
126
127#[cfg(feature = "HMEvent")]
128unsafe impl Sync for HMMutablePresenceEvent {}
129
130#[cfg(feature = "HMEvent")]
131extern_conformance!(
132    unsafe impl NSCopying for HMMutablePresenceEvent {}
133);
134
135#[cfg(feature = "HMEvent")]
136unsafe impl CopyingHelper for HMMutablePresenceEvent {
137    type Result = HMPresenceEvent;
138}
139
140#[cfg(feature = "HMEvent")]
141extern_conformance!(
142    unsafe impl NSMutableCopying for HMMutablePresenceEvent {}
143);
144
145#[cfg(feature = "HMEvent")]
146unsafe impl MutableCopyingHelper for HMMutablePresenceEvent {
147    type Result = Self;
148}
149
150#[cfg(feature = "HMEvent")]
151extern_conformance!(
152    unsafe impl NSObjectProtocol for HMMutablePresenceEvent {}
153);
154
155#[cfg(feature = "HMEvent")]
156impl HMMutablePresenceEvent {
157    extern_methods!(
158        #[unsafe(method(init))]
159        #[unsafe(method_family = init)]
160        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
161
162        #[cfg(feature = "HMPresenceEventDefines")]
163        /// presenceEventType The event type that will trigger the event.
164        ///
165        /// This property is not atomic.
166        ///
167        /// # Safety
168        ///
169        /// This might not be thread-safe.
170        #[unsafe(method(presenceEventType))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn presenceEventType(&self) -> HMPresenceEventType;
173
174        #[cfg(feature = "HMPresenceEventDefines")]
175        /// Setter for [`presenceEventType`][Self::presenceEventType].
176        ///
177        /// # Safety
178        ///
179        /// This might not be thread-safe.
180        #[unsafe(method(setPresenceEventType:))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn setPresenceEventType(&self, presence_event_type: HMPresenceEventType);
183
184        #[cfg(feature = "HMPresenceEventDefines")]
185        /// presenceUserType The user type whose presence will trigger the event.
186        ///
187        /// This property is not atomic.
188        ///
189        /// # Safety
190        ///
191        /// This might not be thread-safe.
192        #[unsafe(method(presenceUserType))]
193        #[unsafe(method_family = none)]
194        pub unsafe fn presenceUserType(&self) -> HMPresenceEventUserType;
195
196        #[cfg(feature = "HMPresenceEventDefines")]
197        /// Setter for [`presenceUserType`][Self::presenceUserType].
198        ///
199        /// # Safety
200        ///
201        /// This might not be thread-safe.
202        #[unsafe(method(setPresenceUserType:))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn setPresenceUserType(&self, presence_user_type: HMPresenceEventUserType);
205    );
206}
207
208/// Methods declared on superclass `HMPresenceEvent`.
209#[cfg(feature = "HMEvent")]
210impl HMMutablePresenceEvent {
211    extern_methods!(
212        #[cfg(feature = "HMPresenceEventDefines")]
213        /// Creates a presence based event.
214        ///
215        ///
216        /// Parameter `presenceEventType`: The event type desired for the event.
217        ///
218        ///
219        /// Parameter `presenceUserType`: The user type whose presence will trigger the event.
220        ///
221        ///
222        /// Returns: Instance object representing the presence event.
223        #[unsafe(method(initWithPresenceEventType:presenceUserType:))]
224        #[unsafe(method_family = init)]
225        pub unsafe fn initWithPresenceEventType_presenceUserType(
226            this: Allocated<Self>,
227            presence_event_type: HMPresenceEventType,
228            presence_user_type: HMPresenceEventUserType,
229        ) -> Retained<Self>;
230    );
231}
232
233/// Methods declared on superclass `HMEvent`.
234#[cfg(feature = "HMEvent")]
235impl HMMutablePresenceEvent {
236    extern_methods!(
237        #[deprecated = "HMEvent is abstract"]
238        #[unsafe(method(new))]
239        #[unsafe(method_family = new)]
240        pub unsafe fn new() -> Retained<Self>;
241    );
242}