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"))]
38extern_conformance!(
39    unsafe impl NSCoding for ARReferenceObject {}
40);
41
42#[cfg(feature = "objc2")]
43extern_conformance!(
44    unsafe impl NSObjectProtocol for ARReferenceObject {}
45);
46
47#[cfg(all(feature = "objc2", feature = "objc2-foundation"))]
48extern_conformance!(
49    unsafe impl NSSecureCoding for ARReferenceObject {}
50);
51
52#[cfg(feature = "objc2")]
53impl ARReferenceObject {
54    extern_methods!(
55        #[cfg(feature = "objc2-foundation")]
56        /// An optional name used to identify the object.
57        #[unsafe(method(name))]
58        #[unsafe(method_family = none)]
59        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
60
61        #[cfg(feature = "objc2-foundation")]
62        /// Setter for [`name`][Self::name].
63        #[unsafe(method(setName:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn setName(&self, name: Option<&NSString>);
66
67        #[cfg(feature = "objc2-foundation")]
68        /// The AR resource group name for this object.
69        ///
70        /// 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,
71        /// else be set to nil.
72        #[unsafe(method(resourceGroupName))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn resourceGroupName(&self) -> Option<Retained<NSString>>;
75
76        #[cfg(feature = "ARPointCloud")]
77        /// The feature points of the object.
78        #[unsafe(method(rawFeaturePoints))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn rawFeaturePoints(&self) -> Retained<ARPointCloud>;
81
82        #[cfg(feature = "objc2-foundation")]
83        /// Returns the set of ARReferenceObjects in the specified resource group and bundle.
84        ///
85        ///
86        /// Parameter `name`: The name of the resource group.
87        ///
88        /// Parameter `bundle`: The bundle containing the image file or asset catalog. Specify nil to search the app’s main bundle.
89        ///
90        /// Returns: The set of reference objects or nil on error.
91        #[unsafe(method(referenceObjectsInGroupNamed:bundle:))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn referenceObjectsInGroupNamed_bundle(
94            name: &NSString,
95            bundle: Option<&NSBundle>,
96        ) -> Option<Retained<NSSet<ARReferenceObject>>>;
97
98        #[cfg(feature = "objc2-foundation")]
99        /// Initializes a new reference object with the contents of an archive at the specified URL.
100        ///
101        /// Parameter `url`: The URL from which to read data (.arobject archive).
102        ///
103        /// Parameter `error`: The error to populate if the object could not be initialized.
104        #[unsafe(method(initWithArchiveURL:error:_))]
105        #[unsafe(method_family = init)]
106        pub unsafe fn initWithArchiveURL_error(
107            this: Allocated<Self>,
108            url: &NSURL,
109        ) -> Result<Retained<Self>, Retained<NSError>>;
110
111        #[cfg(all(feature = "objc2-foundation", feature = "objc2-ui-kit"))]
112        /// Exports the object as an archive at the given URL.
113        ///
114        ///
115        /// The URL path should use ARReferenceObjectArchiveExtension (.arobject) for the file extension.
116        /// If serialization across devices is desired, NSKeyedArchiver should be used instead.
117        ///
118        /// Parameter `url`: The URL at which to write the exported object.
119        ///
120        /// Parameter `previewImage`: An optional preview image to include in the archive.
121        ///
122        /// Parameter `error`: The error to populate if the write is not successful.
123        ///
124        /// Returns: YES if the location is written successfully, otherwise NO.
125        #[unsafe(method(exportObjectToURL:previewImage:error:_))]
126        #[unsafe(method_family = none)]
127        pub unsafe fn exportObjectToURL_previewImage_error(
128            &self,
129            url: &NSURL,
130            preview_image: Option<&UIImage>,
131        ) -> Result<(), Retained<NSError>>;
132
133        #[cfg(feature = "objc2-foundation")]
134        /// Returns a new reference object by aligning and merging the provided object with this reference.
135        ///
136        /// This can be used to combine multiple scans of the same object for detection in different conditions. The object being merged
137        /// must share similar feature points for the merge to succeed.
138        ///
139        /// Parameter `object`: The reference object to align and merge.
140        ///
141        /// Parameter `error`: The error to populate if the merge is not successful.
142        ///
143        /// Returns: A new reference object combining features of both scans or nil if the merge was not successful.
144        #[unsafe(method(referenceObjectByMergingObject:error:_))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn referenceObjectByMergingObject_error(
147            &self,
148            object: &ARReferenceObject,
149        ) -> Result<Retained<ARReferenceObject>, Retained<NSError>>;
150
151        /// Unavailable
152        #[unsafe(method(init))]
153        #[unsafe(method_family = init)]
154        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
155
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub unsafe fn new() -> Retained<Self>;
159    );
160}