objc2-ar-kit 0.3.2

Bindings to the ARKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-location")]
use objc2_core_location::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;

use crate::*;

#[cfg(feature = "objc2")]
extern_class!(
    /// An anchor representing a geographical location in the world.
    ///
    /// The anchor's transform will be automatically updated by the session based on location and heading.
    /// The session needs to be configured with ARGeoTrackingConfiguration.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/argeoanchor?language=objc)
    #[unsafe(super(ARAnchor, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "ARAnchor", feature = "objc2"))]
    pub struct ARGeoAnchor;
);

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
unsafe impl Send for ARGeoAnchor {}

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
unsafe impl Sync for ARGeoAnchor {}

#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl ARAnchorCopying for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
extern_conformance!(
    unsafe impl ARTrackable for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl NSCoding for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl NSCopying for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
unsafe impl CopyingHelper for ARGeoAnchor {
    type Result = Self;
}

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
extern_conformance!(
    unsafe impl NSObjectProtocol for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
extern_conformance!(
    unsafe impl NSSecureCoding for ARGeoAnchor {}
);

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
impl ARGeoAnchor {
    extern_methods!(
        #[cfg(feature = "objc2-core-location")]
        /// The coordinate where this anchor will be placed.
        ///
        ///
        /// The anchor's transform will be automatically updated by the session when ARGeoTrackingConfiguration is set.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(coordinate))]
        #[unsafe(method_family = none)]
        pub unsafe fn coordinate(&self) -> CLLocationCoordinate2D;

        #[cfg(feature = "objc2-core-location")]
        /// The distance to mean sea level, in meters (negative values indicate it's below sea level).
        ///
        ///
        /// Only valid when altitudeSource is not ARAltitudeSourceUnknown.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(altitude))]
        #[unsafe(method_family = none)]
        pub unsafe fn altitude(&self) -> CLLocationDistance;

        #[cfg(feature = "ARGeoTrackingTypes")]
        /// 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.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(altitudeSource))]
        #[unsafe(method_family = none)]
        pub unsafe fn altitudeSource(&self) -> ARAltitudeSource;

        #[cfg(feature = "objc2-core-location")]
        /// Initializes a new ARGeoAnchor with the given coordinates.
        ///
        ///
        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
        ///
        /// Parameter `coordinate`: Coordinates.
        #[unsafe(method(initWithCoordinate:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoordinate(
            this: Allocated<Self>,
            coordinate: CLLocationCoordinate2D,
        ) -> Retained<Self>;

        #[cfg(feature = "objc2-core-location")]
        /// Initializes a new ARGeoAnchor with the given coordinates and altitude.
        ///
        ///
        /// Parameter `coordinate`: Coordinates.
        ///
        /// Parameter `altitude`: Altitude in meters.
        #[unsafe(method(initWithCoordinate:altitude:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoordinate_altitude(
            this: Allocated<Self>,
            coordinate: CLLocationCoordinate2D,
            altitude: CLLocationDistance,
        ) -> Retained<Self>;

        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
        /// Initializes a new named ARGeoAnchor with the given coordinates.
        ///
        ///
        /// ARKit will query the ground level altitude during runtime, and populate the altitude as soon as that information becomes available.
        ///
        /// Parameter `name`: Name of the anchor.
        ///
        /// Parameter `coordinate`: Coordinates.
        #[unsafe(method(initWithName:coordinate:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithName_coordinate(
            this: Allocated<Self>,
            name: &NSString,
            coordinate: CLLocationCoordinate2D,
        ) -> Retained<Self>;

        #[cfg(all(feature = "objc2-core-location", feature = "objc2-foundation"))]
        /// Initializes a new named ARGeoAnchor with the given coordinates and altitude.
        ///
        ///
        /// Parameter `name`: Name of the anchor.
        ///
        /// Parameter `coordinate`: Coordinates.
        ///
        /// Parameter `altitude`: Altitude in meters.
        #[unsafe(method(initWithName:coordinate:altitude:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithName_coordinate_altitude(
            this: Allocated<Self>,
            name: &NSString,
            coordinate: CLLocationCoordinate2D,
            altitude: CLLocationDistance,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `ARAnchor`.
#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
impl ARGeoAnchor {
    extern_methods!(
        /// Unavailable
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}