objc2_ar_kit/generated/
ARReferenceObject.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#[cfg(feature = "objc2-ui-kit")]
10use objc2_ui_kit::*;
11
12use crate::*;
13
14extern "C" {
15    /// [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceobjectarchiveextension?language=objc)
16    #[cfg(feature = "objc2-foundation")]
17    pub static ARReferenceObjectArchiveExtension: &'static NSString;
18}
19
20#[cfg(feature = "objc2")]
21extern_class!(
22    /// A reference object to track in the scene.
23    ///
24    /// See also [Apple's documentation](https://developer.apple.com/documentation/arkit/arreferenceobject?language=objc)
25    #[unsafe(super(NSObject))]
26    #[derive(Debug, PartialEq, Eq, Hash)]
27    #[cfg(feature = "objc2")]
28    pub struct ARReferenceObject;
29);
30
31#[cfg(feature = "objc2")]
32unsafe impl Send for ARReferenceObject {}
33
34#[cfg(feature = "objc2")]
35unsafe impl Sync for ARReferenceObject {}
36
37#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
38unsafe impl NSCoding for ARReferenceObject {}
39
40#[cfg(feature = "objc2")]
41unsafe impl NSObjectProtocol for ARReferenceObject {}
42
43#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
44unsafe impl NSSecureCoding for ARReferenceObject {}
45
46#[cfg(feature = "objc2")]
47impl ARReferenceObject {
48    extern_methods!(
49        #[cfg(feature = "objc2-foundation")]
50        /// An optional name used to identify the object.
51        #[unsafe(method(name))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
54
55        #[cfg(feature = "objc2-foundation")]
56        /// Setter for [`name`][Self::name].
57        #[unsafe(method(setName:))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn setName(&self, name: Option<&NSString>);
60
61        #[cfg(feature = "objc2-foundation")]
62        /// The AR resource group name for this object.
63        ///
64        /// If this object was loaded via an AR resource group in the Xcode asset catalogue this property will have the name of the resource group,
65        /// else be set to nil.
66        #[unsafe(method(resourceGroupName))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn resourceGroupName(&self) -> Option<Retained<NSString>>;
69
70        #[cfg(feature = "ARPointCloud")]
71        /// The feature points of the object.
72        #[unsafe(method(rawFeaturePoints))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn rawFeaturePoints(&self) -> Retained<ARPointCloud>;
75
76        #[cfg(feature = "objc2-foundation")]
77        /// Returns the set of ARReferenceObjects in the specified resource group and bundle.
78        ///
79        ///
80        /// Parameter `name`: The name of the resource group.
81        ///
82        /// Parameter `bundle`: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
83        ///
84        /// Returns: The set of reference objects or nil on error.
85        #[unsafe(method(referenceObjectsInGroupNamed:bundle:))]
86        #[unsafe(method_family = none)]
87        pub unsafe fn referenceObjectsInGroupNamed_bundle(
88            name: &NSString,
89            bundle: Option<&NSBundle>,
90        ) -> Option<Retained<NSSet<ARReferenceObject>>>;
91
92        #[cfg(feature = "objc2-foundation")]
93        /// Initializes a new reference object with the contents of an archive at the specified URL.
94        ///
95        /// Parameter `url`: The URL from which to read data (.arobject archive).
96        ///
97        /// Parameter `error`: The error to populate if the object could not be initialized.
98        #[unsafe(method(initWithArchiveURL:error:_))]
99        #[unsafe(method_family = init)]
100        pub unsafe fn initWithArchiveURL_error(
101            this: Allocated<Self>,
102            url: &NSURL,
103        ) -> Result<Retained<Self>, Retained<NSError>>;
104
105        #[cfg(all(feature = "objc2-foundation", feature = "objc2-ui-kit"))]
106        /// Exports the object as an archive at the given URL.
107        ///
108        ///
109        /// The URL path should use ARReferenceObjectArchiveExtension (.arobject) for the file extension.
110        /// If serialization across devices is desired, NSKeyedArchiver should be used instead.
111        ///
112        /// Parameter `url`: The URL at which to write the exported object.
113        ///
114        /// Parameter `previewImage`: An optional preview image to include in the archive.
115        ///
116        /// Parameter `error`: The error to populate if the write is not successful.
117        ///
118        /// Returns: YES if the location is written successfully, otherwise NO.
119        #[unsafe(method(exportObjectToURL:previewImage:error:_))]
120        #[unsafe(method_family = none)]
121        pub unsafe fn exportObjectToURL_previewImage_error(
122            &self,
123            url: &NSURL,
124            preview_image: Option<&UIImage>,
125        ) -> Result<(), Retained<NSError>>;
126
127        #[cfg(feature = "objc2-foundation")]
128        /// Returns a new reference object by aligning and merging the provided object with this reference.
129        ///
130        /// This can be used to combine multiple scans of the same object for detection in different conditions. The object being merged
131        /// must share similar feature points for the merge to succeed.
132        ///
133        /// Parameter `object`: The reference object to align and merge.
134        ///
135        /// Parameter `error`: The error to populate if the merge is not successful.
136        ///
137        /// Returns: A new reference object combining features of both scans or nil if the merge was not successful.
138        #[unsafe(method(referenceObjectByMergingObject:error:_))]
139        #[unsafe(method_family = none)]
140        pub unsafe fn referenceObjectByMergingObject_error(
141            &self,
142            object: &ARReferenceObject,
143        ) -> Result<Retained<ARReferenceObject>, Retained<NSError>>;
144
145        /// Unavailable
146        #[unsafe(method(init))]
147        #[unsafe(method_family = init)]
148        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
149
150        #[unsafe(method(new))]
151        #[unsafe(method_family = new)]
152        pub unsafe fn new() -> Retained<Self>;
153    );
154}