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"))]
65unsafe impl ARAnchorCopying for ARAnchor {}
66
67#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
68unsafe impl NSCoding for ARAnchor {}
69
70#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
71unsafe impl NSCopying for ARAnchor {}
72
73#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
74unsafe impl CopyingHelper for ARAnchor {
75    type Result = Self;
76}
77
78#[cfg(feature = "objc2")]
79unsafe impl NSObjectProtocol for ARAnchor {}
80
81#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
82unsafe impl NSSecureCoding for ARAnchor {}
83
84#[cfg(feature = "objc2")]
85impl ARAnchor {
86    extern_methods!(
87        #[cfg(feature = "objc2-foundation")]
88        /// Unique identifier of the anchor.
89        #[unsafe(method(identifier))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn identifier(&self) -> Retained<NSUUID>;
92
93        #[cfg(feature = "objc2-foundation")]
94        /// An optional name used to associate with the anchor.
95        #[unsafe(method(name))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
98
99        #[cfg(feature = "objc2-foundation")]
100        /// Identifier of the session that owns the anchor.
101        ///
102        ///
103        /// The session identifier will be assigned to anchor when added to the session.
104        #[unsafe(method(sessionIdentifier))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn sessionIdentifier(&self) -> Option<Retained<NSUUID>>;
107
108        /// Unavailable
109        #[unsafe(method(init))]
110        #[unsafe(method_family = init)]
111        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
112
113        #[unsafe(method(new))]
114        #[unsafe(method_family = new)]
115        pub unsafe fn new() -> Retained<Self>;
116    );
117}