objc2_ar_kit/generated/
ARAnchor.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-foundation")]
7use objc2_foundation::*;
8
9use crate::*;
10
11#[cfg(feature = "objc2")]
12extern_protocol!(
13    /// An anchor object that can be copied from values of an existing anchor.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/aranchorcopying?language=objc)
16    #[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
17    pub unsafe trait ARAnchorCopying: NSCopying {
18        /// Initializes a new anchor object copying values from an existing anchor.
19        ///
20        /// This initializer will be called any time copy is called on anchor of this class.
21        /// This method must be implemented for any ARAnchor subclasses that adds properties.
22        ///
23        /// Parameter `anchor`: The anchor from which to copy values.
24        #[unsafe(method(initWithAnchor:))]
25        #[unsafe(method_family = init)]
26        unsafe fn initWithAnchor(this: Allocated<Self>, anchor: &ARAnchor) -> Retained<Self>;
27    }
28);
29
30#[cfg(feature = "objc2")]
31extern_protocol!(
32    /// A real world object or location in the scene that is being tracked.
33    ///
34    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/artrackable?language=objc)
35    #[cfg(feature = "objc2")]
36    pub unsafe trait ARTrackable: NSObjectProtocol {
37        /// Tracking state of the anchor
38        ///
39        /// The isTracked value is used to determine the anchor transform’s validity. When the object being tracked is no longer detected in the
40        /// camera image, its anchor will return NO for isTracked.
41        #[unsafe(method(isTracked))]
42        #[unsafe(method_family = none)]
43        unsafe fn isTracked(&self) -> bool;
44    }
45);
46
47#[cfg(feature = "objc2")]
48extern_class!(
49    /// Object representing a physical location and orientation in 3D space.
50    ///
51    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/aranchor?language=objc)
52    #[unsafe(super(NSObject))]
53    #[derive(Debug, PartialEq, Eq, Hash)]
54    #[cfg(feature = "objc2")]
55    pub struct ARAnchor;
56);
57
58#[cfg(feature = "objc2")]
59unsafe impl Send for ARAnchor {}
60
61#[cfg(feature = "objc2")]
62unsafe impl Sync for ARAnchor {}
63
64#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
65extern_conformance!(
66    unsafe impl ARAnchorCopying for ARAnchor {}
67);
68
69#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
70extern_conformance!(
71    unsafe impl NSCoding for ARAnchor {}
72);
73
74#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
75extern_conformance!(
76    unsafe impl NSCopying for ARAnchor {}
77);
78
79#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
80unsafe impl CopyingHelper for ARAnchor {
81    type Result = Self;
82}
83
84#[cfg(feature = "objc2")]
85extern_conformance!(
86    unsafe impl NSObjectProtocol for ARAnchor {}
87);
88
89#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
90extern_conformance!(
91    unsafe impl NSSecureCoding for ARAnchor {}
92);
93
94#[cfg(feature = "objc2")]
95impl ARAnchor {
96    extern_methods!(
97        #[cfg(feature = "objc2-foundation")]
98        /// Unique identifier of the anchor.
99        ///
100        /// This property is not atomic.
101        ///
102        /// # Safety
103        ///
104        /// This might not be thread-safe.
105        #[unsafe(method(identifier))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn identifier(&self) -> Retained<NSUUID>;
108
109        #[cfg(feature = "objc2-foundation")]
110        /// An optional name used to associate with the anchor.
111        ///
112        /// This property is not atomic.
113        ///
114        /// # Safety
115        ///
116        /// This might not be thread-safe.
117        #[unsafe(method(name))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
120
121        #[cfg(feature = "objc2-foundation")]
122        /// Identifier of the session that owns the anchor.
123        ///
124        ///
125        /// The session identifier will be assigned to anchor when added to the session.
126        ///
127        /// This property is not atomic.
128        ///
129        /// # Safety
130        ///
131        /// This might not be thread-safe.
132        #[unsafe(method(sessionIdentifier))]
133        #[unsafe(method_family = none)]
134        pub unsafe fn sessionIdentifier(&self) -> Option<Retained<NSUUID>>;
135
136        /// Unavailable
137        #[unsafe(method(init))]
138        #[unsafe(method_family = init)]
139        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
140
141        #[unsafe(method(new))]
142        #[unsafe(method_family = new)]
143        pub unsafe fn new() -> Retained<Self>;
144    );
145}