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        #[unsafe(method(coordinate))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn coordinate(&self) -> CLLocationCoordinate2D;
79
80        #[cfg(feature = "objc2-core-location")]
81        /// The distance to mean sea level, in meters (negative values indicate it's below sea level).
82        ///
83        ///
84        /// Only valid when altitudeSource is not ARAltitudeSourceUnknown.
85        #[unsafe(method(altitude))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn altitude(&self) -> CLLocationDistance;
88
89        #[cfg(feature = "ARGeoTrackingTypes")]
90        /// The source of altitude information. If the user did not provide the altitude, ARKit populates this property to indicate the expected accuracy depending on the available altitude data.
91        #[unsafe(method(altitudeSource))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn altitudeSource(&self) -> ARAltitudeSource;
94
95        #[cfg(feature = "objc2-core-location")]
96        /// Initializes a new ARGeoAnchor with the given coordinates.
97        ///
98        ///
99        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
100        ///
101        /// Parameter `coordinate`: Coordinates.
102        #[unsafe(method(initWithCoordinate:))]
103        #[unsafe(method_family = init)]
104        pub unsafe fn initWithCoordinate(
105            this: Allocated<Self>,
106            coordinate: CLLocationCoordinate2D,
107        ) -> Retained<Self>;
108
109        #[cfg(feature = "objc2-core-location")]
110        /// Initializes a new ARGeoAnchor with the given coordinates and altitude.
111        ///
112        ///
113        /// Parameter `coordinate`: Coordinates.
114        ///
115        /// Parameter `altitude`: Altitude in meters.
116        #[unsafe(method(initWithCoordinate:altitude:))]
117        #[unsafe(method_family = init)]
118        pub unsafe fn initWithCoordinate_altitude(
119            this: Allocated<Self>,
120            coordinate: CLLocationCoordinate2D,
121            altitude: CLLocationDistance,
122        ) -> Retained<Self>;
123
124        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
125        /// Initializes a new named ARGeoAnchor with the given coordinates.
126        ///
127        ///
128        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
129        ///
130        /// Parameter `name`: Name of the anchor.
131        ///
132        /// Parameter `coordinate`: Coordinates.
133        #[unsafe(method(initWithName:coordinate:))]
134        #[unsafe(method_family = init)]
135        pub unsafe fn initWithName_coordinate(
136            this: Allocated<Self>,
137            name: &NSString,
138            coordinate: CLLocationCoordinate2D,
139        ) -> Retained<Self>;
140
141        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
142        /// Initializes a new named ARGeoAnchor with the given coordinates and altitude.
143        ///
144        ///
145        /// Parameter `name`: Name of the anchor.
146        ///
147        /// Parameter `coordinate`: Coordinates.
148        ///
149        /// Parameter `altitude`: Altitude in meters.
150        #[unsafe(method(initWithName:coordinate:altitude:))]
151        #[unsafe(method_family = init)]
152        pub unsafe fn initWithName_coordinate_altitude(
153            this: Allocated<Self>,
154            name: &NSString,
155            coordinate: CLLocationCoordinate2D,
156            altitude: CLLocationDistance,
157        ) -> Retained<Self>;
158    );
159}
160
161/// Methods declared on superclass `ARAnchor`.
162#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
163impl ARGeoAnchor {
164    extern_methods!(
165        /// Unavailable
166        #[unsafe(method(init))]
167        #[unsafe(method_family = init)]
168        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
169
170        #[unsafe(method(new))]
171        #[unsafe(method_family = new)]
172        pub unsafe fn new() -> Retained<Self>;
173    );
174}