objc2_core_location_ui/generated/
CLLocationButton.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9#[cfg(feature = "objc2-quartz-core")]
10#[cfg(not(target_os = "watchos"))]
11use objc2_quartz_core::*;
12#[cfg(feature = "objc2-ui-kit")]
13use objc2_ui_kit::*;
14
15use crate::*;
16
17#[repr(transparent)]
22#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
23pub struct CLLocationButtonIcon(pub NSInteger);
24impl CLLocationButtonIcon {
25 #[doc(alias = "CLLocationButtonIconNone")]
29 pub const None: Self = Self(0);
30 #[doc(alias = "CLLocationButtonIconArrowFilled")]
32 pub const ArrowFilled: Self = Self(1);
33 #[doc(alias = "CLLocationButtonIconArrowOutline")]
35 pub const ArrowOutline: Self = Self(2);
36}
37
38unsafe impl Encode for CLLocationButtonIcon {
39 const ENCODING: Encoding = NSInteger::ENCODING;
40}
41
42unsafe impl RefEncode for CLLocationButtonIcon {
43 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
44}
45
46#[repr(transparent)]
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
52pub struct CLLocationButtonLabel(pub NSInteger);
53impl CLLocationButtonLabel {
54 #[doc(alias = "CLLocationButtonLabelNone")]
58 pub const None: Self = Self(0);
59 #[doc(alias = "CLLocationButtonLabelCurrentLocation")]
61 pub const CurrentLocation: Self = Self(1);
62 #[doc(alias = "CLLocationButtonLabelSendCurrentLocation")]
64 pub const SendCurrentLocation: Self = Self(2);
65 #[doc(alias = "CLLocationButtonLabelSendMyCurrentLocation")]
67 pub const SendMyCurrentLocation: Self = Self(3);
68 #[doc(alias = "CLLocationButtonLabelShareCurrentLocation")]
70 pub const ShareCurrentLocation: Self = Self(4);
71 #[doc(alias = "CLLocationButtonLabelShareMyCurrentLocation")]
73 pub const ShareMyCurrentLocation: Self = Self(5);
74}
75
76unsafe impl Encode for CLLocationButtonLabel {
77 const ENCODING: Encoding = NSInteger::ENCODING;
78}
79
80unsafe impl RefEncode for CLLocationButtonLabel {
81 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
82}
83
84extern_class!(
85 #[unsafe(super(UIControl, UIView, UIResponder, NSObject))]
152 #[derive(Debug, PartialEq, Eq, Hash)]
153 #[cfg(feature = "objc2-ui-kit")]
154 pub struct CLLocationButton;
155);
156
157#[cfg(all(feature = "objc2-quartz-core", feature = "objc2-ui-kit"))]
158#[cfg(not(target_os = "watchos"))]
159extern_conformance!(
160 unsafe impl CALayerDelegate for CLLocationButton {}
161);
162
163#[cfg(feature = "objc2-ui-kit")]
164extern_conformance!(
165 unsafe impl NSCoding for CLLocationButton {}
166);
167
168#[cfg(feature = "objc2-ui-kit")]
169extern_conformance!(
170 unsafe impl NSObjectProtocol for CLLocationButton {}
171);
172
173#[cfg(feature = "objc2-ui-kit")]
174extern_conformance!(
175 unsafe impl NSSecureCoding for CLLocationButton {}
176);
177
178#[cfg(feature = "objc2-ui-kit")]
179extern_conformance!(
180 unsafe impl UIAppearance for CLLocationButton {}
181);
182
183#[cfg(feature = "objc2-ui-kit")]
184extern_conformance!(
185 unsafe impl UIAppearanceContainer for CLLocationButton {}
186);
187
188#[cfg(feature = "objc2-ui-kit")]
189extern_conformance!(
190 unsafe impl UICoordinateSpace for CLLocationButton {}
191);
192
193#[cfg(feature = "objc2-ui-kit")]
194extern_conformance!(
195 unsafe impl UIDynamicItem for CLLocationButton {}
196);
197
198#[cfg(feature = "objc2-ui-kit")]
199extern_conformance!(
200 unsafe impl UIFocusEnvironment for CLLocationButton {}
201);
202
203#[cfg(feature = "objc2-ui-kit")]
204extern_conformance!(
205 unsafe impl UIFocusItem for CLLocationButton {}
206);
207
208#[cfg(feature = "objc2-ui-kit")]
209extern_conformance!(
210 unsafe impl UIFocusItemContainer for CLLocationButton {}
211);
212
213#[cfg(feature = "objc2-ui-kit")]
214extern_conformance!(
215 unsafe impl UIResponderStandardEditActions for CLLocationButton {}
216);
217
218#[cfg(feature = "objc2-ui-kit")]
219extern_conformance!(
220 unsafe impl UITraitEnvironment for CLLocationButton {}
221);
222
223#[cfg(feature = "objc2-ui-kit")]
224impl CLLocationButton {
225 extern_methods!(
226 #[unsafe(method(icon))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn icon(&self) -> CLLocationButtonIcon;
230
231 #[unsafe(method(setIcon:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setIcon(&self, icon: CLLocationButtonIcon);
235
236 #[unsafe(method(label))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn label(&self) -> CLLocationButtonLabel;
240
241 #[unsafe(method(setLabel:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn setLabel(&self, label: CLLocationButtonLabel);
245
246 #[cfg(feature = "objc2-core-foundation")]
247 #[unsafe(method(fontSize))]
249 #[unsafe(method_family = none)]
250 pub unsafe fn fontSize(&self) -> CGFloat;
251
252 #[cfg(feature = "objc2-core-foundation")]
253 #[unsafe(method(setFontSize:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn setFontSize(&self, font_size: CGFloat);
257
258 #[cfg(feature = "objc2-core-foundation")]
259 #[unsafe(method(cornerRadius))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn cornerRadius(&self) -> CGFloat;
263
264 #[cfg(feature = "objc2-core-foundation")]
265 #[unsafe(method(setCornerRadius:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn setCornerRadius(&self, corner_radius: CGFloat);
269 );
270}
271
272#[cfg(feature = "objc2-ui-kit")]
274impl CLLocationButton {
275 extern_methods!(
276 #[cfg(feature = "objc2-core-foundation")]
277 #[unsafe(method(initWithFrame:))]
278 #[unsafe(method_family = init)]
279 pub unsafe fn initWithFrame(this: Allocated<Self>, frame: CGRect) -> Retained<Self>;
280
281 #[unsafe(method(initWithCoder:))]
282 #[unsafe(method_family = init)]
283 pub unsafe fn initWithCoder(
284 this: Allocated<Self>,
285 coder: &NSCoder,
286 ) -> Option<Retained<Self>>;
287
288 #[cfg(feature = "objc2-core-foundation")]
289 #[unsafe(method(initWithFrame:primaryAction:))]
291 #[unsafe(method_family = init)]
292 pub unsafe fn initWithFrame_primaryAction(
293 this: Allocated<Self>,
294 frame: CGRect,
295 primary_action: Option<&UIAction>,
296 ) -> Retained<Self>;
297 );
298}
299
300#[cfg(feature = "objc2-ui-kit")]
302impl CLLocationButton {
303 extern_methods!(
304 #[unsafe(method(init))]
305 #[unsafe(method_family = init)]
306 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
307
308 #[unsafe(method(new))]
309 #[unsafe(method_family = new)]
310 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
311 );
312}