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")]
27unsafe impl NSCopying for HMPresenceEvent {}
28
29#[cfg(feature = "HMEvent")]
30unsafe impl CopyingHelper for HMPresenceEvent {
31    type Result = Self;
32}
33
34#[cfg(feature = "HMEvent")]
35unsafe impl NSMutableCopying for HMPresenceEvent {}
36
37#[cfg(feature = "HMEvent")]
38unsafe impl MutableCopyingHelper for HMPresenceEvent {
39    type Result = HMMutablePresenceEvent;
40}
41
42#[cfg(feature = "HMEvent")]
43unsafe impl NSObjectProtocol for HMPresenceEvent {}
44
45#[cfg(feature = "HMEvent")]
46impl HMPresenceEvent {
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 = "HMPresenceEventDefines")]
53        /// Creates a presence based event.
54        ///
55        ///
56        /// Parameter `presenceEventType`: The event type desired for the event.
57        ///
58        ///
59        /// Parameter `presenceUserType`: The user type whose presence will trigger the event.
60        ///
61        ///
62        /// Returns: Instance object representing the presence event.
63        #[unsafe(method(initWithPresenceEventType:presenceUserType:))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn initWithPresenceEventType_presenceUserType(
66            this: Allocated<Self>,
67            presence_event_type: HMPresenceEventType,
68            presence_user_type: HMPresenceEventUserType,
69        ) -> Retained<Self>;
70
71        #[cfg(feature = "HMPresenceEventDefines")]
72        /// presenceEventType The event type that will trigger the event.
73        #[unsafe(method(presenceEventType))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn presenceEventType(&self) -> HMPresenceEventType;
76
77        #[cfg(feature = "HMPresenceEventDefines")]
78        /// presenceUserType The user type whose presence will trigger the event.
79        #[unsafe(method(presenceUserType))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn presenceUserType(&self) -> HMPresenceEventUserType;
82    );
83}
84
85/// Methods declared on superclass `HMEvent`.
86#[cfg(feature = "HMEvent")]
87impl HMPresenceEvent {
88    extern_methods!(
89        #[deprecated = "HMEvent is abstract"]
90        #[unsafe(method(new))]
91        #[unsafe(method_family = new)]
92        pub unsafe fn new() -> Retained<Self>;
93    );
94}
95
96extern_class!(
97    /// This class is used to represent the presence of users in a home.
98    ///
99    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablepresenceevent?language=objc)
100    #[unsafe(super(HMPresenceEvent, HMEvent, NSObject))]
101    #[derive(Debug, PartialEq, Eq, Hash)]
102    #[cfg(feature = "HMEvent")]
103    pub struct HMMutablePresenceEvent;
104);
105
106#[cfg(feature = "HMEvent")]
107unsafe impl Send for HMMutablePresenceEvent {}
108
109#[cfg(feature = "HMEvent")]
110unsafe impl Sync for HMMutablePresenceEvent {}
111
112#[cfg(feature = "HMEvent")]
113unsafe impl NSCopying for HMMutablePresenceEvent {}
114
115#[cfg(feature = "HMEvent")]
116unsafe impl CopyingHelper for HMMutablePresenceEvent {
117    type Result = HMPresenceEvent;
118}
119
120#[cfg(feature = "HMEvent")]
121unsafe impl NSMutableCopying for HMMutablePresenceEvent {}
122
123#[cfg(feature = "HMEvent")]
124unsafe impl MutableCopyingHelper for HMMutablePresenceEvent {
125    type Result = Self;
126}
127
128#[cfg(feature = "HMEvent")]
129unsafe impl NSObjectProtocol for HMMutablePresenceEvent {}
130
131#[cfg(feature = "HMEvent")]
132impl HMMutablePresenceEvent {
133    extern_methods!(
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137
138        #[cfg(feature = "HMPresenceEventDefines")]
139        /// presenceEventType The event type that will trigger the event.
140        #[unsafe(method(presenceEventType))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn presenceEventType(&self) -> HMPresenceEventType;
143
144        #[cfg(feature = "HMPresenceEventDefines")]
145        /// Setter for [`presenceEventType`][Self::presenceEventType].
146        #[unsafe(method(setPresenceEventType:))]
147        #[unsafe(method_family = none)]
148        pub unsafe fn setPresenceEventType(&self, presence_event_type: HMPresenceEventType);
149
150        #[cfg(feature = "HMPresenceEventDefines")]
151        /// presenceUserType The user type whose presence will trigger the event.
152        #[unsafe(method(presenceUserType))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn presenceUserType(&self) -> HMPresenceEventUserType;
155
156        #[cfg(feature = "HMPresenceEventDefines")]
157        /// Setter for [`presenceUserType`][Self::presenceUserType].
158        #[unsafe(method(setPresenceUserType:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setPresenceUserType(&self, presence_user_type: HMPresenceEventUserType);
161    );
162}
163
164/// Methods declared on superclass `HMPresenceEvent`.
165#[cfg(feature = "HMEvent")]
166impl HMMutablePresenceEvent {
167    extern_methods!(
168        #[cfg(feature = "HMPresenceEventDefines")]
169        /// Creates a presence based event.
170        ///
171        ///
172        /// Parameter `presenceEventType`: The event type desired for the event.
173        ///
174        ///
175        /// Parameter `presenceUserType`: The user type whose presence will trigger the event.
176        ///
177        ///
178        /// Returns: Instance object representing the presence event.
179        #[unsafe(method(initWithPresenceEventType:presenceUserType:))]
180        #[unsafe(method_family = init)]
181        pub unsafe fn initWithPresenceEventType_presenceUserType(
182            this: Allocated<Self>,
183            presence_event_type: HMPresenceEventType,
184            presence_user_type: HMPresenceEventUserType,
185        ) -> Retained<Self>;
186    );
187}
188
189/// Methods declared on superclass `HMEvent`.
190#[cfg(feature = "HMEvent")]
191impl HMMutablePresenceEvent {
192    extern_methods!(
193        #[deprecated = "HMEvent is abstract"]
194        #[unsafe(method(new))]
195        #[unsafe(method_family = new)]
196        pub unsafe fn new() -> Retained<Self>;
197    );
198}