objc2_ar_kit/generated/
ARAppClipCodeAnchor.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5#[cfg(feature = "objc2")]
6use objc2::__framework_prelude::*;
7#[cfg(feature = "objc2-foundation")]
8use objc2_foundation::*;
9
10use crate::*;
11
12/// A value describing app clip code URL decoding state.
13///
14/// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arappclipcodeurldecodingstate?language=objc)
15// NS_ENUM
16#[cfg(feature = "objc2")]
17#[repr(transparent)]
18#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
19pub struct ARAppClipCodeURLDecodingState(pub NSInteger);
20#[cfg(feature = "objc2")]
21impl ARAppClipCodeURLDecodingState {
22    /// App clip code tracking is attempting to decode the URL.
23    #[doc(alias = "ARAppClipCodeURLDecodingStateDecoding")]
24    pub const Decoding: Self = Self(0);
25    /// App clip code tracking failed to decode the URL.
26    #[doc(alias = "ARAppClipCodeURLDecodingStateFailed")]
27    pub const Failed: Self = Self(1);
28    /// App clip code tracking decoded the URL.
29    #[doc(alias = "ARAppClipCodeURLDecodingStateDecoded")]
30    pub const Decoded: Self = Self(2);
31}
32
33#[cfg(feature = "objc2")]
34unsafe impl Encode for ARAppClipCodeURLDecodingState {
35    const ENCODING: Encoding = NSInteger::ENCODING;
36}
37
38#[cfg(feature = "objc2")]
39unsafe impl RefEncode for ARAppClipCodeURLDecodingState {
40    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
41}
42
43#[cfg(feature = "objc2")]
44extern_class!(
45    /// An anchor representing an app clip code in the world.
46    ///
47    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arappclipcodeanchor?language=objc)
48    #[unsafe(super(ARAnchor, NSObject))]
49    #[derive(Debug, PartialEq, Eq, Hash)]
50    #[cfg(all(feature = "ARAnchor", feature = "objc2"))]
51    pub struct ARAppClipCodeAnchor;
52);
53
54#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
55unsafe impl Send for ARAppClipCodeAnchor {}
56
57#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
58unsafe impl Sync for ARAppClipCodeAnchor {}
59
60#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
61extern_conformance!(
62    unsafe impl ARAnchorCopying for ARAppClipCodeAnchor {}
63);
64
65#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
66extern_conformance!(
67    unsafe impl ARTrackable for ARAppClipCodeAnchor {}
68);
69
70#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
71extern_conformance!(
72    unsafe impl NSCoding for ARAppClipCodeAnchor {}
73);
74
75#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
76extern_conformance!(
77    unsafe impl NSCopying for ARAppClipCodeAnchor {}
78);
79
80#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
81unsafe impl CopyingHelper for ARAppClipCodeAnchor {
82    type Result = Self;
83}
84
85#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
86extern_conformance!(
87    unsafe impl NSObjectProtocol for ARAppClipCodeAnchor {}
88);
89
90#[cfg(all(feature = "ARAnchor", feature = "objc2", feature = "objc2-foundation"))]
91extern_conformance!(
92    unsafe impl NSSecureCoding for ARAppClipCodeAnchor {}
93);
94
95#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
96impl ARAppClipCodeAnchor {
97    extern_methods!(
98        #[cfg(feature = "objc2-foundation")]
99        /// The URL encoded in this app clip code. Not nil only if urlDecodingState is .decoded.
100        ///
101        /// This property is not atomic.
102        ///
103        /// # Safety
104        ///
105        /// This might not be thread-safe.
106        #[unsafe(method(url))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn url(&self) -> Option<Retained<NSURL>>;
109
110        /// The URL decoding state of the app clip code.
111        ///
112        /// This property is not atomic.
113        ///
114        /// # Safety
115        ///
116        /// This might not be thread-safe.
117        #[unsafe(method(urlDecodingState))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn urlDecodingState(&self) -> ARAppClipCodeURLDecodingState;
120
121        /// The estimated radius of the app clip code in meters.
122        ///
123        /// This property is not atomic.
124        ///
125        /// # Safety
126        ///
127        /// This might not be thread-safe.
128        #[unsafe(method(radius))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn radius(&self) -> c_float;
131    );
132}
133
134/// Methods declared on superclass `ARAnchor`.
135#[cfg(all(feature = "ARAnchor", feature = "objc2"))]
136impl ARAppClipCodeAnchor {
137    extern_methods!(
138        /// Unavailable
139        #[unsafe(method(init))]
140        #[unsafe(method_family = init)]
141        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
142
143        #[unsafe(method(new))]
144        #[unsafe(method_family = new)]
145        pub unsafe fn new() -> Retained<Self>;
146    );
147}