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