objc2_core_location/generated/
CLLocationUpdater.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "dispatch2")]
6use dispatch2::*;
7use objc2::__framework_prelude::*;
8
9use crate::*;
10
11/// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clliveupdateconfiguration?language=objc)
12// NS_ENUM
13#[repr(transparent)]
14#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
15pub struct CLLiveUpdateConfiguration(pub NSInteger);
16impl CLLiveUpdateConfiguration {
17    #[doc(alias = "CLLiveUpdateConfigurationDefault")]
18    pub const Default: Self = Self(0);
19    #[doc(alias = "CLLiveUpdateConfigurationAutomotiveNavigation")]
20    pub const AutomotiveNavigation: Self = Self(1);
21    #[doc(alias = "CLLiveUpdateConfigurationOtherNavigation")]
22    pub const OtherNavigation: Self = Self(2);
23    #[doc(alias = "CLLiveUpdateConfigurationFitness")]
24    pub const Fitness: Self = Self(3);
25    #[doc(alias = "CLLiveUpdateConfigurationAirborne")]
26    pub const Airborne: Self = Self(4);
27}
28
29unsafe impl Encode for CLLiveUpdateConfiguration {
30    const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for CLLiveUpdateConfiguration {
34    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37extern_class!(
38    /// [Apple's documentation](https://developer.apple.com/documentation/corelocation/clupdate?language=objc)
39    #[unsafe(super(NSObject))]
40    #[derive(Debug, PartialEq, Eq, Hash)]
41    pub struct CLUpdate;
42);
43
44extern_conformance!(
45    unsafe impl NSObjectProtocol for CLUpdate {}
46);
47
48impl CLUpdate {
49    extern_methods!(
50        #[unsafe(method(authorizationDenied))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn authorizationDenied(&self) -> bool;
53
54        #[unsafe(method(authorizationDeniedGlobally))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn authorizationDeniedGlobally(&self) -> bool;
57
58        #[unsafe(method(authorizationRestricted))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn authorizationRestricted(&self) -> bool;
61
62        #[deprecated]
63        #[unsafe(method(isStationary))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn isStationary(&self) -> bool;
66
67        #[unsafe(method(stationary))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn stationary(&self) -> bool;
70
71        #[unsafe(method(insufficientlyInUse))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn insufficientlyInUse(&self) -> bool;
74
75        #[unsafe(method(locationUnavailable))]
76        #[unsafe(method_family = none)]
77        pub unsafe fn locationUnavailable(&self) -> bool;
78
79        #[unsafe(method(accuracyLimited))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn accuracyLimited(&self) -> bool;
82
83        #[unsafe(method(serviceSessionRequired))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn serviceSessionRequired(&self) -> bool;
86
87        #[unsafe(method(authorizationRequestInProgress))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn authorizationRequestInProgress(&self) -> bool;
90
91        #[cfg(feature = "CLLocation")]
92        #[unsafe(method(location))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn location(&self) -> Option<Retained<CLLocation>>;
95    );
96}
97
98/// Methods declared on superclass `NSObject`.
99impl CLUpdate {
100    extern_methods!(
101        #[unsafe(method(init))]
102        #[unsafe(method_family = init)]
103        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
104
105        #[unsafe(method(new))]
106        #[unsafe(method_family = new)]
107        pub unsafe fn new() -> Retained<Self>;
108    );
109}
110
111extern_class!(
112    /// [Apple's documentation](https://developer.apple.com/documentation/corelocation/cllocationupdater?language=objc)
113    #[unsafe(super(NSObject))]
114    #[derive(Debug, PartialEq, Eq, Hash)]
115    pub struct CLLocationUpdater;
116);
117
118extern_conformance!(
119    unsafe impl NSObjectProtocol for CLLocationUpdater {}
120);
121
122impl CLLocationUpdater {
123    extern_methods!(
124        #[unsafe(method(init))]
125        #[unsafe(method_family = init)]
126        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
127
128        #[unsafe(method(new))]
129        #[unsafe(method_family = new)]
130        pub unsafe fn new() -> Retained<Self>;
131
132        #[cfg(all(feature = "block2", feature = "dispatch2"))]
133        /// # Safety
134        ///
135        /// `queue` possibly has additional threading requirements.
136        #[unsafe(method(liveUpdaterWithQueue:handler:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn liveUpdaterWithQueue_handler(
139            queue: &DispatchQueue,
140            handler: &block2::DynBlock<dyn Fn(*mut CLUpdate)>,
141        ) -> Option<Retained<Self>>;
142
143        #[cfg(all(feature = "block2", feature = "dispatch2"))]
144        /// # Safety
145        ///
146        /// `queue` possibly has additional threading requirements.
147        #[unsafe(method(liveUpdaterWithConfiguration:queue:handler:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn liveUpdaterWithConfiguration_queue_handler(
150            configuration: CLLiveUpdateConfiguration,
151            queue: &DispatchQueue,
152            handler: &block2::DynBlock<dyn Fn(*mut CLUpdate)>,
153        ) -> Option<Retained<Self>>;
154
155        #[unsafe(method(resume))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn resume(&self);
158
159        #[unsafe(method(pause))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn pause(&self);
162
163        #[unsafe(method(invalidate))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn invalidate(&self);
166    );
167}