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 ///
77 /// This is [copied][objc2_foundation::NSCopying::copy] when set.
78 #[unsafe(method(setSymbologies:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setSymbologies(&self, symbologies: &NSArray<VNBarcodeSymbology>);
81
82 /// An option to coalesce multiple codes if applicable based on the symbology
83 #[unsafe(method(coalesceCompositeSymbologies))]
84 #[unsafe(method_family = none)]
85 pub unsafe fn coalesceCompositeSymbologies(&self) -> bool;
86
87 /// Setter for [`coalesceCompositeSymbologies`][Self::coalesceCompositeSymbologies].
88 #[unsafe(method(setCoalesceCompositeSymbologies:))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn setCoalesceCompositeSymbologies(&self, coalesce_composite_symbologies: bool);
91
92 #[cfg(feature = "VNObservation")]
93 /// VNBarcodeObservation results.
94 #[unsafe(method(results))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn results(&self) -> Option<Retained<NSArray<VNBarcodeObservation>>>;
97 );
98}
99
100/// Methods declared on superclass `VNRequest`.
101#[cfg(feature = "VNRequest")]
102impl VNDetectBarcodesRequest {
103 extern_methods!(
104 /// Creates a new VNRequest with no completion handler.
105 #[unsafe(method(init))]
106 #[unsafe(method_family = init)]
107 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
108
109 #[cfg(feature = "block2")]
110 /// Creates a new VNRequest with an optional completion handler.
111 ///
112 ///
113 /// 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.
114 ///
115 /// # Safety
116 ///
117 /// `completion_handler` must be a valid pointer or null.
118 #[unsafe(method(initWithCompletionHandler:))]
119 #[unsafe(method_family = init)]
120 pub unsafe fn initWithCompletionHandler(
121 this: Allocated<Self>,
122 completion_handler: VNRequestCompletionHandler,
123 ) -> Retained<Self>;
124 );
125}
126
127/// Methods declared on superclass `NSObject`.
128#[cfg(feature = "VNRequest")]
129impl VNDetectBarcodesRequest {
130 extern_methods!(
131 #[unsafe(method(new))]
132 #[unsafe(method_family = new)]
133 pub unsafe fn new() -> Retained<Self>;
134 );
135}
136
137/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision1?language=objc)
138#[deprecated]
139pub static VNDetectBarcodesRequestRevision1: NSUInteger = 1;
140
141/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision2?language=objc)
142#[deprecated]
143pub static VNDetectBarcodesRequestRevision2: NSUInteger = 2;
144
145/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision3?language=objc)
146pub static VNDetectBarcodesRequestRevision3: NSUInteger = 3;
147
148/// [Apple's documentation](https://developer.apple.com/documentation/vision/vndetectbarcodesrequestrevision4?language=objc)
149pub static VNDetectBarcodesRequestRevision4: NSUInteger = 4;