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")]
24unsafe impl NSCopying for VNDetectBarcodesRequest {}
25
26#[cfg(feature = "VNRequest")]
27unsafe impl CopyingHelper for VNDetectBarcodesRequest {
28    type Result = Self;
29}
30
31#[cfg(feature = "VNRequest")]
32unsafe impl NSObjectProtocol for VNDetectBarcodesRequest {}
33
34#[cfg(feature = "VNRequest")]
35impl VNDetectBarcodesRequest {
36    extern_methods!(
37        #[cfg(feature = "VNTypes")]
38        /// Obtain the collection of barcode symbologies currently recognized by the Vision framework.
39        ///
40        ///
41        /// Calling this method could be a potentially expensive operation.
42        ///
43        ///
44        /// Returns: An array of VNBarcodeSymbology objects describing the symbologies currently supported by the Vision framework.
45        #[deprecated]
46        #[unsafe(method(supportedSymbologies))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn supportedSymbologies() -> Retained<NSArray<VNBarcodeSymbology>>;
49
50        #[cfg(feature = "VNTypes")]
51        /// Obtain the collection of barcode symbologies that can be recognized by the request in its current configuration.
52        ///
53        ///
54        /// Calling this method could be a potentially expensive operation.
55        ///
56        ///
57        /// Returns: An array of VNBarcodeSymbology objects describing the symbologies recognized by the request in its current configuration.
58        #[unsafe(method(supportedSymbologiesAndReturnError:_))]
59        #[unsafe(method_family = none)]
60        pub unsafe fn supportedSymbologiesAndReturnError(
61            &self,
62        ) -> Result<Retained<NSArray<VNBarcodeSymbology>>, Retained<NSError>>;
63
64        #[cfg(feature = "VNTypes")]
65        /// 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.
66        #[unsafe(method(symbologies))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn symbologies(&self) -> Retained<NSArray<VNBarcodeSymbology>>;
69
70        #[cfg(feature = "VNTypes")]
71        /// Setter for [`symbologies`][Self::symbologies].
72        #[unsafe(method(setSymbologies:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setSymbologies(&self, symbologies: &NSArray<VNBarcodeSymbology>);
75
76        /// An option to coalesce multiple codes if applicable based on the symbology
77        #[unsafe(method(coalesceCompositeSymbologies))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn coalesceCompositeSymbologies(&self) -> bool;
80
81        /// Setter for [`coalesceCompositeSymbologies`][Self::coalesceCompositeSymbologies].
82        #[unsafe(method(setCoalesceCompositeSymbologies:))]
83        #[unsafe(method_family = none)]
84        pub unsafe fn setCoalesceCompositeSymbologies(&self, coalesce_composite_symbologies: bool);
85
86        #[cfg(feature = "VNObservation")]
87        /// VNBarcodeObservation results.
88        #[unsafe(method(results))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn results(&self) -> Option<Retained<NSArray<VNBarcodeObservation>>>;
91    );
92}
93
94/// Methods declared on superclass `VNRequest`.
95#[cfg(feature = "VNRequest")]
96impl VNDetectBarcodesRequest {
97    extern_methods!(
98        /// Creates a new VNRequest with no completion handler.
99        #[unsafe(method(init))]
100        #[unsafe(method_family = init)]
101        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
102
103        #[cfg(feature = "block2")]
104        /// Creates a new VNRequest with an optional completion handler.
105        ///
106        ///
107        /// 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.
108        #[unsafe(method(initWithCompletionHandler:))]
109        #[unsafe(method_family = init)]
110        pub unsafe fn initWithCompletionHandler(
111            this: Allocated<Self>,
112            completion_handler: VNRequestCompletionHandler,
113        ) -> Retained<Self>;
114    );
115}
116
117/// Methods declared on superclass `NSObject`.
118#[cfg(feature = "VNRequest")]
119impl VNDetectBarcodesRequest {
120    extern_methods!(
121        #[unsafe(method(new))]
122        #[unsafe(method_family = new)]
123        pub unsafe fn new() -> Retained<Self>;
124    );
125}
126
127/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision1?language=objc)
128pub static VNDetectBarcodesRequestRevision1: NSUInteger = 1;
129
130/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision2?language=objc)
131pub static VNDetectBarcodesRequestRevision2: NSUInteger = 2;
132
133/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision3?language=objc)
134pub static VNDetectBarcodesRequestRevision3: NSUInteger = 3;
135
136/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision4?language=objc)
137pub static VNDetectBarcodesRequestRevision4: NSUInteger = 4;