objc2_ar_kit/generated/
ARGeoTrackingTypes.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4#[cfg(feature = "objc2")]
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11/// Keeps track of where an altitude value came from and informs the user about the expected accuracy.
12///
13/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/araltitudesource?language=objc)
14// NS_ENUM
15#[cfg(feature = "objc2")]
16#[repr(transparent)]
17#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
18pub struct ARAltitudeSource(pub NSInteger);
19#[cfg(feature = "objc2")]
20impl ARAltitudeSource {
21    /// Altitude could not be determined (yet).
22    #[doc(alias = "ARAltitudeSourceUnknown")]
23    pub const Unknown: Self = Self(0);
24    /// ARKit determined altitude based on a coarse digital elevation model. The provided value is too imprecise to be used at close range, but is sufficient to anchor far away content.
25    #[doc(alias = "ARAltitudeSourceCoarse")]
26    pub const Coarse: Self = Self(1);
27    /// ARKit determined altitude based on a high resolution digital elevation model.
28    #[doc(alias = "ARAltitudeSourcePrecise")]
29    pub const Precise: Self = Self(2);
30    /// Altitude was provided by the user.
31    #[doc(alias = "ARAltitudeSourceUserDefined")]
32    pub const UserDefined: Self = Self(3);
33}
34
35#[cfg(feature = "objc2")]
36unsafe impl Encode for ARAltitudeSource {
37    const ENCODING: Encoding = NSInteger::ENCODING;
38}
39
40#[cfg(feature = "objc2")]
41unsafe impl RefEncode for ARAltitudeSource {
42    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
43}
44
45/// A value describing geo tracking state.
46///
47/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeotrackingstate?language=objc)
48// NS_ENUM
49#[cfg(feature = "objc2")]
50#[repr(transparent)]
51#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
52pub struct ARGeoTrackingState(pub NSInteger);
53#[cfg(feature = "objc2")]
54impl ARGeoTrackingState {
55    /// Geo tracking is not available.
56    #[doc(alias = "ARGeoTrackingStateNotAvailable")]
57    pub const NotAvailable: Self = Self(0);
58    /// Geo tracking is being initialized.
59    #[doc(alias = "ARGeoTrackingStateInitializing")]
60    pub const Initializing: Self = Self(1);
61    /// Geo tracking is attempting to localize against a Map.
62    #[doc(alias = "ARGeoTrackingStateLocalizing")]
63    pub const Localizing: Self = Self(2);
64    /// Geo tracking is localized.
65    #[doc(alias = "ARGeoTrackingStateLocalized")]
66    pub const Localized: Self = Self(3);
67}
68
69#[cfg(feature = "objc2")]
70unsafe impl Encode for ARGeoTrackingState {
71    const ENCODING: Encoding = NSInteger::ENCODING;
72}
73
74#[cfg(feature = "objc2")]
75unsafe impl RefEncode for ARGeoTrackingState {
76    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
77}
78
79/// A value describing geo tracking accuracy.
80///
81/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeotrackingaccuracy?language=objc)
82// NS_ENUM
83#[cfg(feature = "objc2")]
84#[repr(transparent)]
85#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
86pub struct ARGeoTrackingAccuracy(pub NSInteger);
87#[cfg(feature = "objc2")]
88impl ARGeoTrackingAccuracy {
89    /// Geo tracking has not localized yet. Accuracy is indeterminate.
90    #[doc(alias = "ARGeoTrackingAccuracyUndetermined")]
91    pub const Undetermined: Self = Self(0);
92    /// Localized with low accuracy.
93    #[doc(alias = "ARGeoTrackingAccuracyLow")]
94    pub const Low: Self = Self(1);
95    /// Localized with medium accuracy.
96    #[doc(alias = "ARGeoTrackingAccuracyMedium")]
97    pub const Medium: Self = Self(2);
98    /// Localized with high accuracy.
99    #[doc(alias = "ARGeoTrackingAccuracyHigh")]
100    pub const High: Self = Self(3);
101}
102
103#[cfg(feature = "objc2")]
104unsafe impl Encode for ARGeoTrackingAccuracy {
105    const ENCODING: Encoding = NSInteger::ENCODING;
106}
107
108#[cfg(feature = "objc2")]
109unsafe impl RefEncode for ARGeoTrackingAccuracy {
110    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
111}
112
113/// Reasons for geo tracking failure states.
114///
115/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeotrackingstatereason?language=objc)
116// NS_ENUM
117#[cfg(feature = "objc2")]
118#[repr(transparent)]
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120pub struct ARGeoTrackingStateReason(pub NSInteger);
121#[cfg(feature = "objc2")]
122impl ARGeoTrackingStateReason {
123    /// No issues reported.
124    #[doc(alias = "ARGeoTrackingStateReasonNone")]
125    pub const None: Self = Self(0);
126    /// Geo tracking is not available at the location.
127    #[doc(alias = "ARGeoTrackingStateReasonNotAvailableAtLocation")]
128    pub const NotAvailableAtLocation: Self = Self(1);
129    /// Geo tracking needs location permissions from the user.
130    #[doc(alias = "ARGeoTrackingStateReasonNeedLocationPermissions")]
131    pub const NeedLocationPermissions: Self = Self(2);
132    /// World tracking pose is not valid yet.
133    #[doc(alias = "ARGeoTrackingStateReasonWorldTrackingUnstable")]
134    pub const WorldTrackingUnstable: Self = Self(3);
135    /// Waiting for a location point that meets accuracy threshold before starting geo tracking.
136    #[doc(alias = "ARGeoTrackingStateReasonWaitingForLocation")]
137    pub const WaitingForLocation: Self = Self(4);
138    /// Waiting for availability check on first location point to complete.
139    #[doc(alias = "ARGeoTrackingStateReasonWaitingForAvailabilityCheck")]
140    pub const WaitingForAvailabilityCheck: Self = Self(5);
141    /// Geo tracking data hasn't been downloaded yet.
142    #[doc(alias = "ARGeoTrackingStateReasonGeoDataNotLoaded")]
143    pub const GeoDataNotLoaded: Self = Self(6);
144    /// The device is pointed at an angle too far down to use geo tracking.
145    #[doc(alias = "ARGeoTrackingStateReasonDevicePointedTooLow")]
146    pub const DevicePointedTooLow: Self = Self(7);
147    /// Visual localization failed, but no errors were found in the input.
148    #[doc(alias = "ARGeoTrackingStateReasonVisualLocalizationFailed")]
149    pub const VisualLocalizationFailed: Self = Self(8);
150}
151
152#[cfg(feature = "objc2")]
153unsafe impl Encode for ARGeoTrackingStateReason {
154    const ENCODING: Encoding = NSInteger::ENCODING;
155}
156
157#[cfg(feature = "objc2")]
158unsafe impl RefEncode for ARGeoTrackingStateReason {
159    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
160}
161
162#[cfg(feature = "objc2")]
163extern_class!(
164    /// Collection of fields to give information on geo tracking status.
165    ///
166    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeotrackingstatus?language=objc)
167    #[unsafe(super(NSObject))]
168    #[derive(Debug, PartialEq, Eq, Hash)]
169    #[cfg(feature = "objc2")]
170    pub struct ARGeoTrackingStatus;
171);
172
173#[cfg(feature = "objc2")]
174unsafe impl Send for ARGeoTrackingStatus {}
175
176#[cfg(feature = "objc2")]
177unsafe impl Sync for ARGeoTrackingStatus {}
178
179#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
180extern_conformance!(
181    unsafe impl NSCoding for ARGeoTrackingStatus {}
182);
183
184#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
185extern_conformance!(
186    unsafe impl NSCopying for ARGeoTrackingStatus {}
187);
188
189#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
190unsafe impl CopyingHelper for ARGeoTrackingStatus {
191    type Result = Self;
192}
193
194#[cfg(feature = "objc2")]
195extern_conformance!(
196    unsafe impl NSObjectProtocol for ARGeoTrackingStatus {}
197);
198
199#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
200extern_conformance!(
201    unsafe impl NSSecureCoding for ARGeoTrackingStatus {}
202);
203
204#[cfg(feature = "objc2")]
205impl ARGeoTrackingStatus {
206    extern_methods!(
207        /// The state of geo tracking.
208        ///
209        /// This property is not atomic.
210        ///
211        /// # Safety
212        ///
213        /// This might not be thread-safe.
214        #[unsafe(method(state))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn state(&self) -> ARGeoTrackingState;
217
218        /// The accuracy of geo tracking.
219        ///
220        /// This property is not atomic.
221        ///
222        /// # Safety
223        ///
224        /// This might not be thread-safe.
225        #[unsafe(method(accuracy))]
226        #[unsafe(method_family = none)]
227        pub unsafe fn accuracy(&self) -> ARGeoTrackingAccuracy;
228
229        /// Reason for geo tracking state.
230        ///
231        /// This property is not atomic.
232        ///
233        /// # Safety
234        ///
235        /// This might not be thread-safe.
236        #[unsafe(method(stateReason))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn stateReason(&self) -> ARGeoTrackingStateReason;
239
240        #[unsafe(method(init))]
241        #[unsafe(method_family = init)]
242        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
243
244        #[unsafe(method(new))]
245        #[unsafe(method_family = new)]
246        pub unsafe fn new() -> Retained<Self>;
247    );
248}