objc2_home_kit/generated/
HMLocationEvent.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::*;
6#[cfg(feature = "objc2-core-location")]
7use objc2_core_location::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12extern_class!(
13    /// This class represents an event that is evaluated based on entry to and/or
14    /// exit from a Region
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmlocationevent?language=objc)
17    #[unsafe(super(HMEvent, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "HMEvent")]
20    pub struct HMLocationEvent;
21);
22
23#[cfg(feature = "HMEvent")]
24unsafe impl Send for HMLocationEvent {}
25
26#[cfg(feature = "HMEvent")]
27unsafe impl Sync for HMLocationEvent {}
28
29#[cfg(feature = "HMEvent")]
30unsafe impl NSCopying for HMLocationEvent {}
31
32#[cfg(feature = "HMEvent")]
33unsafe impl CopyingHelper for HMLocationEvent {
34    type Result = Self;
35}
36
37#[cfg(feature = "HMEvent")]
38unsafe impl NSMutableCopying for HMLocationEvent {}
39
40#[cfg(feature = "HMEvent")]
41unsafe impl MutableCopyingHelper for HMLocationEvent {
42    type Result = HMMutableLocationEvent;
43}
44
45#[cfg(feature = "HMEvent")]
46unsafe impl NSObjectProtocol for HMLocationEvent {}
47
48#[cfg(feature = "HMEvent")]
49impl HMLocationEvent {
50    extern_methods!(
51        #[unsafe(method(init))]
52        #[unsafe(method_family = init)]
53        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
54
55        #[cfg(feature = "objc2-core-location")]
56        /// Initializes a new location event object
57        ///
58        ///
59        /// Parameter `region`: - Region with at least one property of notifyOnEntry or notifyOnExit set to TRUE.
60        ///
61        ///
62        /// Returns: Instance object representing the location event.
63        #[unsafe(method(initWithRegion:))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
66
67        #[cfg(feature = "objc2-core-location")]
68        /// Region on which events are triggered based on the properties notifyOnEntry and notifyOnExit.
69        /// This property will be nil when an application is not authorized for location services.
70        #[unsafe(method(region))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn region(&self) -> Option<Retained<CLRegion>>;
73
74        #[cfg(all(feature = "block2", feature = "objc2-core-location"))]
75        /// Updates the region
76        ///
77        ///
78        /// Parameter `region`: - New region with at least one property of notifyOnEntry or notifyOnExit set to TRUE.
79        ///
80        ///
81        /// Parameter `completion`: Block that is invoked once the request is processed.
82        /// The NSError provides more information on the status of the request, error
83        /// will be nil on success.
84        #[deprecated = "No longer supported."]
85        #[unsafe(method(updateRegion:completionHandler:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn updateRegion_completionHandler(
88            &self,
89            region: &CLRegion,
90            completion: &block2::Block<dyn Fn(*mut NSError)>,
91        );
92    );
93}
94
95/// Methods declared on superclass `HMEvent`.
96#[cfg(feature = "HMEvent")]
97impl HMLocationEvent {
98    extern_methods!(
99        #[deprecated = "HMEvent is abstract"]
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub unsafe fn new() -> Retained<Self>;
103    );
104}
105
106extern_class!(
107    /// This class represents an event that is evaluated based on entry to and/or
108    /// exit from a Region
109    ///
110    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmmutablelocationevent?language=objc)
111    #[unsafe(super(HMLocationEvent, HMEvent, NSObject))]
112    #[derive(Debug, PartialEq, Eq, Hash)]
113    #[cfg(feature = "HMEvent")]
114    pub struct HMMutableLocationEvent;
115);
116
117#[cfg(feature = "HMEvent")]
118unsafe impl Send for HMMutableLocationEvent {}
119
120#[cfg(feature = "HMEvent")]
121unsafe impl Sync for HMMutableLocationEvent {}
122
123#[cfg(feature = "HMEvent")]
124unsafe impl NSCopying for HMMutableLocationEvent {}
125
126#[cfg(feature = "HMEvent")]
127unsafe impl CopyingHelper for HMMutableLocationEvent {
128    type Result = HMLocationEvent;
129}
130
131#[cfg(feature = "HMEvent")]
132unsafe impl NSMutableCopying for HMMutableLocationEvent {}
133
134#[cfg(feature = "HMEvent")]
135unsafe impl MutableCopyingHelper for HMMutableLocationEvent {
136    type Result = Self;
137}
138
139#[cfg(feature = "HMEvent")]
140unsafe impl NSObjectProtocol for HMMutableLocationEvent {}
141
142#[cfg(feature = "HMEvent")]
143impl HMMutableLocationEvent {
144    extern_methods!(
145        #[unsafe(method(init))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149        #[cfg(feature = "objc2-core-location")]
150        /// Region on which events are triggered based on the properties notifyOnEntry and notifyOnExit.
151        /// This property will be nil when an application is not authorized for location services.
152        #[unsafe(method(region))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn region(&self) -> Option<Retained<CLRegion>>;
155
156        #[cfg(feature = "objc2-core-location")]
157        /// Setter for [`region`][Self::region].
158        #[unsafe(method(setRegion:))]
159        #[unsafe(method_family = none)]
160        pub unsafe fn setRegion(&self, region: Option<&CLRegion>);
161    );
162}
163
164/// Methods declared on superclass `HMLocationEvent`.
165#[cfg(feature = "HMEvent")]
166impl HMMutableLocationEvent {
167    extern_methods!(
168        #[cfg(feature = "objc2-core-location")]
169        /// Initializes a new location event object
170        ///
171        ///
172        /// Parameter `region`: - Region with at least one property of notifyOnEntry or notifyOnExit set to TRUE.
173        ///
174        ///
175        /// Returns: Instance object representing the location event.
176        #[unsafe(method(initWithRegion:))]
177        #[unsafe(method_family = init)]
178        pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
179    );
180}
181
182/// Methods declared on superclass `HMEvent`.
183#[cfg(feature = "HMEvent")]
184impl HMMutableLocationEvent {
185    extern_methods!(
186        #[deprecated = "HMEvent is abstract"]
187        #[unsafe(method(new))]
188        #[unsafe(method_family = new)]
189        pub unsafe fn new() -> Retained<Self>;
190    );
191}