objc2_home_kit/generated/
HMLocationEvent.rs1use 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 #[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 #[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 #[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 #[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#[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 #[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 #[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 #[unsafe(method(setRegion:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setRegion(&self, region: Option<&CLRegion>);
173 );
174}
175
176#[cfg(feature = "HMEvent")]
178impl HMMutableLocationEvent {
179 extern_methods!(
180 #[cfg(feature = "objc2-core-location")]
181 #[unsafe(method(initWithRegion:))]
189 #[unsafe(method_family = init)]
190 pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
191 );
192}
193
194#[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}