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