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::ffi::*;
use core::ptr::NonNull;
#[cfg(feature = "objc2")]
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-foundation")]
use objc2_foundation::*;

use crate::*;

/// A value describing app clip code URL decoding state.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arappclipcodeurldecodingstate?language=objc)
// NS_ENUM
#[cfg(feature = "objc2")]
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct ARAppClipCodeURLDecodingState(pub NSInteger);
#[cfg(feature = "objc2")]
impl ARAppClipCodeURLDecodingState {
    /// App clip code tracking is attempting to decode the URL.
    #[doc(alias = "ARAppClipCodeURLDecodingStateDecoding")]
    pub const Decoding: Self = Self(0);
    /// App clip code tracking failed to decode the URL.
    #[doc(alias = "ARAppClipCodeURLDecodingStateFailed")]
    pub const Failed: Self = Self(1);
    /// App clip code tracking decoded the URL.
    #[doc(alias = "ARAppClipCodeURLDecodingStateDecoded")]
    pub const Decoded: Self = Self(2);
}

#[cfg(feature = "objc2")]
unsafe impl Encode for ARAppClipCodeURLDecodingState {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

#[cfg(feature = "objc2")]
unsafe impl RefEncode for ARAppClipCodeURLDecodingState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

#[cfg(feature = "objc2")]
extern_class!(
    /// An anchor representing an app clip code in the world.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arappclipcodeanchor?language=objc)
    #[unsafe(super(ARAnchor, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "ARAnchor", feature = "objc2"))]
    pub struct ARAppClipCodeAnchor;
);

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

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

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

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

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

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

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

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

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

#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
impl ARAppClipCodeAnchor {
    extern_methods!(
        #[cfg(feature = "objc2-foundation")]
        /// The URL encoded in this app clip code. Not nil only if urlDecodingState is .decoded.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(url))]
        #[unsafe(method_family = none)]
        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;

        /// The URL decoding state of the app clip code.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(urlDecodingState))]
        #[unsafe(method_family = none)]
        pub unsafe fn urlDecodingState(&self) -> ARAppClipCodeURLDecodingState;

        /// The estimated radius of the app clip code in meters.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(radius))]
        #[unsafe(method_family = none)]
        pub unsafe fn radius(&self) -> c_float;
    );
}

/// Methods declared on superclass `ARAnchor`.
#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
impl ARAppClipCodeAnchor {
    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>;
    );
}