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")]
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 #[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 #[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 #[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#[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 #[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 #[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 #[unsafe(method(setRegion:))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn setRegion(&self, region: Option<&CLRegion>);
161 );
162}
163
164#[cfg(feature = "HMEvent")]
166impl HMMutableLocationEvent {
167 extern_methods!(
168 #[cfg(feature = "objc2-core-location")]
169 #[unsafe(method(initWithRegion:))]
177 #[unsafe(method_family = init)]
178 pub unsafe fn initWithRegion(this: Allocated<Self>, region: &CLRegion) -> Retained<Self>;
179 );
180}
181
182#[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}