objc2_vision/generated/
VNDetectBarcodesRequest.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// A request that detects barcodes in an image.
12    ///
13    ///
14    /// This request will return zero or more VNBarcodeObservation objects objects which describe the barcodes detected in an image.
15    ///
16    /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequest?language=objc)
17    #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
18    #[derive(Debug, PartialEq, Eq, Hash)]
19    #[cfg(feature = "VNRequest")]
20    pub struct VNDetectBarcodesRequest;
21);
22
23#[cfg(feature = "VNRequest")]
24extern_conformance!(
25    unsafe impl NSCopying for VNDetectBarcodesRequest {}
26);
27
28#[cfg(feature = "VNRequest")]
29unsafe impl CopyingHelper for VNDetectBarcodesRequest {
30    type Result = Self;
31}
32
33#[cfg(feature = "VNRequest")]
34extern_conformance!(
35    unsafe impl NSObjectProtocol for VNDetectBarcodesRequest {}
36);
37
38#[cfg(feature = "VNRequest")]
39impl VNDetectBarcodesRequest {
40    extern_methods!(
41        #[cfg(feature = "VNTypes")]
42        /// Obtain the collection of barcode symbologies currently recognized by the Vision framework.
43        ///
44        ///
45        /// Calling this method could be a potentially expensive operation.
46        ///
47        ///
48        /// Returns: An array of VNBarcodeSymbology objects describing the symbologies currently supported by the Vision framework.
49        #[deprecated]
50        #[unsafe(method(supportedSymbologies))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn supportedSymbologies() -> Retained<NSArray<VNBarcodeSymbology>>;
53
54        #[cfg(feature = "VNTypes")]
55        /// Obtain the collection of barcode symbologies that can be recognized by the request in its current configuration.
56        ///
57        ///
58        /// Calling this method could be a potentially expensive operation.
59        ///
60        ///
61        /// Returns: An array of VNBarcodeSymbology objects describing the symbologies recognized by the request in its current configuration.
62        #[unsafe(method(supportedSymbologiesAndReturnError:_))]
63        #[unsafe(method_family = none)]
64        pub unsafe fn supportedSymbologiesAndReturnError(
65            &self,
66        ) -> Result<Retained<NSArray<VNBarcodeSymbology>>, Retained<NSError>>;
67
68        #[cfg(feature = "VNTypes")]
69        /// The collection of barcode symbologies that are to be detected in the image.  The default is to scan for all possible symbologies. Setting a revision on the request will reset the symbologies to all symbologies for the specified revision.
70        #[unsafe(method(symbologies))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn symbologies(&self) -> Retained<NSArray<VNBarcodeSymbology>>;
73
74        #[cfg(feature = "VNTypes")]
75        /// Setter for [`symbologies`][Self::symbologies].
76        #[unsafe(method(setSymbologies:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setSymbologies(&self, symbologies: &NSArray<VNBarcodeSymbology>);
79
80        /// An option to coalesce multiple codes if applicable based on the symbology
81        #[unsafe(method(coalesceCompositeSymbologies))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn coalesceCompositeSymbologies(&self) -> bool;
84
85        /// Setter for [`coalesceCompositeSymbologies`][Self::coalesceCompositeSymbologies].
86        #[unsafe(method(setCoalesceCompositeSymbologies:))]
87        #[unsafe(method_family = none)]
88        pub unsafe fn setCoalesceCompositeSymbologies(&self, coalesce_composite_symbologies: bool);
89
90        #[cfg(feature = "VNObservation")]
91        /// VNBarcodeObservation results.
92        #[unsafe(method(results))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNBarcodeObservation>>>;
95    );
96}
97
98/// Methods declared on superclass `VNRequest`.
99#[cfg(feature = "VNRequest")]
100impl VNDetectBarcodesRequest {
101    extern_methods!(
102        /// Creates a new VNRequest with no completion handler.
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[cfg(feature = "block2")]
108        /// Creates a new VNRequest with an optional completion handler.
109        ///
110        ///
111        /// Parameter `completionHandler`: The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
112        #[unsafe(method(initWithCompletionHandler:))]
113        #[unsafe(method_family = init)]
114        pub unsafe fn initWithCompletionHandler(
115            this: Allocated<Self>,
116            completion_handler: VNRequestCompletionHandler,
117        ) -> Retained<Self>;
118    );
119}
120
121/// Methods declared on superclass `NSObject`.
122#[cfg(feature = "VNRequest")]
123impl VNDetectBarcodesRequest {
124    extern_methods!(
125        #[unsafe(method(new))]
126        #[unsafe(method_family = new)]
127        pub unsafe fn new() -> Retained<Self>;
128    );
129}
130
131/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision1?language=objc)
132pub static VNDetectBarcodesRequestRevision1: NSUInteger = 1;
133
134/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision2?language=objc)
135pub static VNDetectBarcodesRequestRevision2: NSUInteger = 2;
136
137/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision3?language=objc)
138pub static VNDetectBarcodesRequestRevision3: NSUInteger = 3;
139
140/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision4?language=objc)
141pub static VNDetectBarcodesRequestRevision4: NSUInteger = 4;