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))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn region(&self) -> Option<Retained<CLRegion>>;
85
86 #[cfg(all(feature = "block2", feature = "objc2-core-location"))]
87 #[deprecated = "No longer supported."]
97 #[unsafe(method(updateRegion:completionHandler:))]
98 #[unsafe(method_family = none)]
99 pub unsafe fn updateRegion_completionHandler(
100 &self,
101 region: &CLRegion,
102 completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
103 );
104 );
105}
106
107#[cfg(feature = "HMEvent")]
109impl HMLocationEvent {
110 extern_methods!(
111 #[deprecated = "HMEvent is abstract"]
112 #[unsafe(method(new))]
113 #[unsafe(method_family = new)]
114 pub unsafe fn new() -> Retained<Self>;
115 );
116}
117
118extern_class!(
119 #[unsafe(super(HMLocationEvent, HMEvent, NSObject))]
124 #[derive(Debug, PartialEq, Eq, Hash)]
125 #[cfg(feature = "HMEvent")]
126 pub struct HMMutableLocationEvent;
127);
128
129#[cfg(feature = "HMEvent")]
130unsafe impl Send for HMMutableLocationEvent {}
131
132#[cfg(feature = "HMEvent")]
133unsafe impl Sync for HMMutableLocationEvent {}
134
135#[cfg(feature = "HMEvent")]
136extern_conformance!(
137 unsafe impl NSCopying for HMMutableLocationEvent {}
138);
139
140#[cfg(feature = "HMEvent")]
141unsafe impl CopyingHelper for HMMutableLocationEvent {
142 type Result = HMLocationEvent;
143}
144
145#[cfg(feature = "HMEvent")]
146extern_conformance!(
147 unsafe impl NSMutableCopying for HMMutableLocationEvent {}
148);
149
150#[cfg(feature = "HMEvent")]
151unsafe impl MutableCopyingHelper for HMMutableLocationEvent {
152 type Result = Self;
153}
154
155#[cfg(feature = "HMEvent")]
156extern_conformance!(
157 unsafe impl NSObjectProtocol for HMMutableLocationEvent {}
158);
159
160#[cfg(feature = "HMEvent")]
161impl HMMutableLocationEvent {
162 extern_methods!(
163 #[unsafe(method(init))]
164 #[unsafe(method_family = init)]
165 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
166
167 #[cfg(feature = "objc2-core-location")]
168 #[unsafe(method(region))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn region(&self) -> Option<Retained<CLRegion>>;
179
180 #[cfg(feature = "objc2-core-location")]
181 #[unsafe(method(setRegion:))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn setRegion(&self, region: Option<&CLRegion>);
189 );
190}
191
192#[cfg(feature = "HMEvent")]
194impl HMMutableLocationEvent {
195 extern_methods!(
196 #[cfg(feature = "objc2-core-location")]
197 #[unsafe(method(initWithRegion:))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
207 );
208}
209
210#[cfg(feature = "HMEvent")]
212impl HMMutableLocationEvent {
213 extern_methods!(
214 #[deprecated = "HMEvent is abstract"]
215 #[unsafe(method(new))]
216 #[unsafe(method_family = new)]
217 pub unsafe fn new() -> Retained<Self>;
218 );
219}