objc2_ar_kit/generated/
ARGeoAnchor.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-core-location")]
7use objc2_core_location::*;
8#[cfg(feature = "objc2-foundation")]
9use objc2_foundation::*;
10
11use crate::*;
12
13#[cfg(feature = "objc2")]
14extern_class!(
15    /// An anchor representing a geographical location in the world.
16    ///
17    /// The anchor's transform will be automatically updated by the session based on location and heading.
18    /// The session needs to be configured with ARGeoTrackingConfiguration.
19    ///
20    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeoanchor?language=objc)
21    #[unsafe(super(ARAnchor, NSObject))]
22    #[derive(Debug, PartialEq, Eq, Hash)]
23    #[cfg(all(feature = "ARAnchor", feature = "objc2"))]
24    pub struct ARGeoAnchor;
25);
26
27#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
28unsafe impl Send for ARGeoAnchor {}
29
30#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
31unsafe impl Sync for ARGeoAnchor {}
32
33#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
34extern_conformance!(
35    unsafe impl ARAnchorCopying for ARGeoAnchor {}
36);
37
38#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
39extern_conformance!(
40    unsafe impl ARTrackable for ARGeoAnchor {}
41);
42
43#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
44extern_conformance!(
45    unsafe impl NSCoding for ARGeoAnchor {}
46);
47
48#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
49extern_conformance!(
50    unsafe impl NSCopying for ARGeoAnchor {}
51);
52
53#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
54unsafe impl CopyingHelper for ARGeoAnchor {
55    type Result = Self;
56}
57
58#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
59extern_conformance!(
60    unsafe impl NSObjectProtocol for ARGeoAnchor {}
61);
62
63#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
64extern_conformance!(
65    unsafe impl NSSecureCoding for ARGeoAnchor {}
66);
67
68#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
69impl ARGeoAnchor {
70    extern_methods!(
71        #[cfg(feature = "objc2-core-location")]
72        /// The coordinate where this anchor will be placed.
73        ///
74        ///
75        /// The anchor's transform will be automatically updated by the session when ARGeoTrackingConfiguration is set.
76        ///
77        /// This property is not atomic.
78        ///
79        /// # Safety
80        ///
81        /// This might not be thread-safe.
82        #[unsafe(method(coordinate))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn coordinate(&self) -> CLLocationCoordinate2D;
85
86        #[cfg(feature = "objc2-core-location")]
87        /// The distance to mean sea level, in meters (negative values indicate it's below sea level).
88        ///
89        ///
90        /// Only valid when altitudeSource is not ARAltitudeSourceUnknown.
91        ///
92        /// This property is not atomic.
93        ///
94        /// # Safety
95        ///
96        /// This might not be thread-safe.
97        #[unsafe(method(altitude))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn altitude(&self) -> CLLocationDistance;
100
101        #[cfg(feature = "ARGeoTrackingTypes")]
102        /// The source of altitude information. If the user did not provide the altitude, ARKit populates this property to indicate the expected accuracy
103        /// depending on the available altitude data.
104        ///
105        /// This property is not atomic.
106        ///
107        /// # Safety
108        ///
109        /// This might not be thread-safe.
110        #[unsafe(method(altitudeSource))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn altitudeSource(&self) -> ARAltitudeSource;
113
114        #[cfg(feature = "objc2-core-location")]
115        /// Initializes a new ARGeoAnchor with the given coordinates.
116        ///
117        ///
118        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
119        ///
120        /// Parameter `coordinate`: Coordinates.
121        #[unsafe(method(initWithCoordinate:))]
122        #[unsafe(method_family = init)]
123        pub unsafe fn initWithCoordinate(
124            this: Allocated<Self>,
125            coordinate: CLLocationCoordinate2D,
126        ) -> Retained<Self>;
127
128        #[cfg(feature = "objc2-core-location")]
129        /// Initializes a new ARGeoAnchor with the given coordinates and altitude.
130        ///
131        ///
132        /// Parameter `coordinate`: Coordinates.
133        ///
134        /// Parameter `altitude`: Altitude in meters.
135        #[unsafe(method(initWithCoordinate:altitude:))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn initWithCoordinate_altitude(
138            this: Allocated<Self>,
139            coordinate: CLLocationCoordinate2D,
140            altitude: CLLocationDistance,
141        ) -> Retained<Self>;
142
143        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
144        /// Initializes a new named ARGeoAnchor with the given coordinates.
145        ///
146        ///
147        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
148        ///
149        /// Parameter `name`: Name of the anchor.
150        ///
151        /// Parameter `coordinate`: Coordinates.
152        #[unsafe(method(initWithName:coordinate:))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn initWithName_coordinate(
155            this: Allocated<Self>,
156            name: &NSString,
157            coordinate: CLLocationCoordinate2D,
158        ) -> Retained<Self>;
159
160        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
161        /// Initializes a new named ARGeoAnchor with the given coordinates and altitude.
162        ///
163        ///
164        /// Parameter `name`: Name of the anchor.
165        ///
166        /// Parameter `coordinate`: Coordinates.
167        ///
168        /// Parameter `altitude`: Altitude in meters.
169        #[unsafe(method(initWithName:coordinate:altitude:))]
170        #[unsafe(method_family = init)]
171        pub unsafe fn initWithName_coordinate_altitude(
172            this: Allocated<Self>,
173            name: &NSString,
174            coordinate: CLLocationCoordinate2D,
175            altitude: CLLocationDistance,
176        ) -> Retained<Self>;
177    );
178}
179
180/// Methods declared on superclass `ARAnchor`.
181#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
182impl ARGeoAnchor {
183    extern_methods!(
184        /// Unavailable
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188
189        #[unsafe(method(new))]
190        #[unsafe(method_family = new)]
191        pub unsafe fn new() -> Retained<Self>;
192    );
193}