1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIBarcodeDescriptor;

    unsafe impl ClassType for CIBarcodeDescriptor {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for CIBarcodeDescriptor {}

unsafe impl NSCopying for CIBarcodeDescriptor {}

unsafe impl NSObjectProtocol for CIBarcodeDescriptor {}

unsafe impl NSSecureCoding for CIBarcodeDescriptor {}

extern_methods!(
    unsafe impl CIBarcodeDescriptor {}
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIBarcodeDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CIQRCodeErrorCorrectionLevel(pub NSInteger);
impl CIQRCodeErrorCorrectionLevel {
    #[doc(alias = "CIQRCodeErrorCorrectionLevelL")]
    pub const L: Self = Self(b'L' as _);
    #[doc(alias = "CIQRCodeErrorCorrectionLevelM")]
    pub const M: Self = Self(b'M' as _);
    #[doc(alias = "CIQRCodeErrorCorrectionLevelQ")]
    pub const Q: Self = Self(b'Q' as _);
    #[doc(alias = "CIQRCodeErrorCorrectionLevelH")]
    pub const H: Self = Self(b'H' as _);
}

unsafe impl Encode for CIQRCodeErrorCorrectionLevel {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CIQRCodeErrorCorrectionLevel {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIQRCodeDescriptor;

    unsafe impl ClassType for CIQRCodeDescriptor {
        #[inherits(NSObject)]
        type Super = CIBarcodeDescriptor;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for CIQRCodeDescriptor {}

unsafe impl NSCopying for CIQRCodeDescriptor {}

unsafe impl NSObjectProtocol for CIQRCodeDescriptor {}

unsafe impl NSSecureCoding for CIQRCodeDescriptor {}

extern_methods!(
    unsafe impl CIQRCodeDescriptor {
        #[method_id(@__retain_semantics Other errorCorrectedPayload)]
        pub unsafe fn errorCorrectedPayload(&self) -> Retained<NSData>;

        #[method(symbolVersion)]
        pub unsafe fn symbolVersion(&self) -> NSInteger;

        #[method(maskPattern)]
        pub unsafe fn maskPattern(&self) -> u8;

        #[method(errorCorrectionLevel)]
        pub unsafe fn errorCorrectionLevel(&self) -> CIQRCodeErrorCorrectionLevel;

        #[method_id(@__retain_semantics Init initWithPayload:symbolVersion:maskPattern:errorCorrectionLevel:)]
        pub unsafe fn initWithPayload_symbolVersion_maskPattern_errorCorrectionLevel(
            this: Allocated<Self>,
            error_corrected_payload: &NSData,
            symbol_version: NSInteger,
            mask_pattern: u8,
            error_correction_level: CIQRCodeErrorCorrectionLevel,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other descriptorWithPayload:symbolVersion:maskPattern:errorCorrectionLevel:)]
        pub unsafe fn descriptorWithPayload_symbolVersion_maskPattern_errorCorrectionLevel(
            error_corrected_payload: &NSData,
            symbol_version: NSInteger,
            mask_pattern: u8,
            error_correction_level: CIQRCodeErrorCorrectionLevel,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIQRCodeDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIAztecCodeDescriptor;

    unsafe impl ClassType for CIAztecCodeDescriptor {
        #[inherits(NSObject)]
        type Super = CIBarcodeDescriptor;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for CIAztecCodeDescriptor {}

unsafe impl NSCopying for CIAztecCodeDescriptor {}

unsafe impl NSObjectProtocol for CIAztecCodeDescriptor {}

unsafe impl NSSecureCoding for CIAztecCodeDescriptor {}

extern_methods!(
    unsafe impl CIAztecCodeDescriptor {
        #[method_id(@__retain_semantics Other errorCorrectedPayload)]
        pub unsafe fn errorCorrectedPayload(&self) -> Retained<NSData>;

        #[method(isCompact)]
        pub unsafe fn isCompact(&self) -> bool;

        #[method(layerCount)]
        pub unsafe fn layerCount(&self) -> NSInteger;

        #[method(dataCodewordCount)]
        pub unsafe fn dataCodewordCount(&self) -> NSInteger;

        #[method_id(@__retain_semantics Init initWithPayload:isCompact:layerCount:dataCodewordCount:)]
        pub unsafe fn initWithPayload_isCompact_layerCount_dataCodewordCount(
            this: Allocated<Self>,
            error_corrected_payload: &NSData,
            is_compact: bool,
            layer_count: NSInteger,
            data_codeword_count: NSInteger,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other descriptorWithPayload:isCompact:layerCount:dataCodewordCount:)]
        pub unsafe fn descriptorWithPayload_isCompact_layerCount_dataCodewordCount(
            error_corrected_payload: &NSData,
            is_compact: bool,
            layer_count: NSInteger,
            data_codeword_count: NSInteger,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIAztecCodeDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIPDF417CodeDescriptor;

    unsafe impl ClassType for CIPDF417CodeDescriptor {
        #[inherits(NSObject)]
        type Super = CIBarcodeDescriptor;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for CIPDF417CodeDescriptor {}

unsafe impl NSCopying for CIPDF417CodeDescriptor {}

unsafe impl NSObjectProtocol for CIPDF417CodeDescriptor {}

unsafe impl NSSecureCoding for CIPDF417CodeDescriptor {}

extern_methods!(
    unsafe impl CIPDF417CodeDescriptor {
        #[method_id(@__retain_semantics Other errorCorrectedPayload)]
        pub unsafe fn errorCorrectedPayload(&self) -> Retained<NSData>;

        #[method(isCompact)]
        pub unsafe fn isCompact(&self) -> bool;

        #[method(rowCount)]
        pub unsafe fn rowCount(&self) -> NSInteger;

        #[method(columnCount)]
        pub unsafe fn columnCount(&self) -> NSInteger;

        #[method_id(@__retain_semantics Init initWithPayload:isCompact:rowCount:columnCount:)]
        pub unsafe fn initWithPayload_isCompact_rowCount_columnCount(
            this: Allocated<Self>,
            error_corrected_payload: &NSData,
            is_compact: bool,
            row_count: NSInteger,
            column_count: NSInteger,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other descriptorWithPayload:isCompact:rowCount:columnCount:)]
        pub unsafe fn descriptorWithPayload_isCompact_rowCount_columnCount(
            error_corrected_payload: &NSData,
            is_compact: bool,
            row_count: NSInteger,
            column_count: NSInteger,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIPDF417CodeDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CIDataMatrixCodeECCVersion(pub NSInteger);
impl CIDataMatrixCodeECCVersion {
    pub const CIDataMatrixCodeECCVersion000: Self = Self(0);
    pub const CIDataMatrixCodeECCVersion050: Self = Self(50);
    pub const CIDataMatrixCodeECCVersion080: Self = Self(80);
    pub const CIDataMatrixCodeECCVersion100: Self = Self(100);
    pub const CIDataMatrixCodeECCVersion140: Self = Self(140);
    pub const CIDataMatrixCodeECCVersion200: Self = Self(200);
}

unsafe impl Encode for CIDataMatrixCodeECCVersion {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for CIDataMatrixCodeECCVersion {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIDataMatrixCodeDescriptor;

    unsafe impl ClassType for CIDataMatrixCodeDescriptor {
        #[inherits(NSObject)]
        type Super = CIBarcodeDescriptor;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for CIDataMatrixCodeDescriptor {}

unsafe impl NSCopying for CIDataMatrixCodeDescriptor {}

unsafe impl NSObjectProtocol for CIDataMatrixCodeDescriptor {}

unsafe impl NSSecureCoding for CIDataMatrixCodeDescriptor {}

extern_methods!(
    unsafe impl CIDataMatrixCodeDescriptor {
        #[method_id(@__retain_semantics Other errorCorrectedPayload)]
        pub unsafe fn errorCorrectedPayload(&self) -> Retained<NSData>;

        #[method(rowCount)]
        pub unsafe fn rowCount(&self) -> NSInteger;

        #[method(columnCount)]
        pub unsafe fn columnCount(&self) -> NSInteger;

        #[method(eccVersion)]
        pub unsafe fn eccVersion(&self) -> CIDataMatrixCodeECCVersion;

        #[method_id(@__retain_semantics Init initWithPayload:rowCount:columnCount:eccVersion:)]
        pub unsafe fn initWithPayload_rowCount_columnCount_eccVersion(
            this: Allocated<Self>,
            error_corrected_payload: &NSData,
            row_count: NSInteger,
            column_count: NSInteger,
            ecc_version: CIDataMatrixCodeECCVersion,
        ) -> Option<Retained<Self>>;

        #[method_id(@__retain_semantics Other descriptorWithPayload:rowCount:columnCount:eccVersion:)]
        pub unsafe fn descriptorWithPayload_rowCount_columnCount_eccVersion(
            error_corrected_payload: &NSData,
            row_count: NSInteger,
            column_count: NSInteger,
            ecc_version: CIDataMatrixCodeECCVersion,
        ) -> Option<Retained<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIDataMatrixCodeDescriptor {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_category!(
    /// Category "CIBarcodeDescriptor" on [`NSUserActivity`].
    #[doc(alias = "CIBarcodeDescriptor")]
    pub unsafe trait NSUserActivityCIBarcodeDescriptor {
        #[method_id(@__retain_semantics Other detectedBarcodeDescriptor)]
        unsafe fn detectedBarcodeDescriptor(&self) -> Option<Retained<CIBarcodeDescriptor>>;
    }

    unsafe impl NSUserActivityCIBarcodeDescriptor for NSUserActivity {}
);