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
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextAutocapitalizationType(pub NSInteger);
impl UITextAutocapitalizationType {
    #[doc(alias = "UITextAutocapitalizationTypeNone")]
    pub const None: Self = Self(0);
    #[doc(alias = "UITextAutocapitalizationTypeWords")]
    pub const Words: Self = Self(1);
    #[doc(alias = "UITextAutocapitalizationTypeSentences")]
    pub const Sentences: Self = Self(2);
    #[doc(alias = "UITextAutocapitalizationTypeAllCharacters")]
    pub const AllCharacters: Self = Self(3);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextAutocorrectionType(pub NSInteger);
impl UITextAutocorrectionType {
    #[doc(alias = "UITextAutocorrectionTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextAutocorrectionTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextAutocorrectionTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextSpellCheckingType(pub NSInteger);
impl UITextSpellCheckingType {
    #[doc(alias = "UITextSpellCheckingTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextSpellCheckingTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextSpellCheckingTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextSmartQuotesType(pub NSInteger);
impl UITextSmartQuotesType {
    #[doc(alias = "UITextSmartQuotesTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextSmartQuotesTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextSmartQuotesTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextSmartDashesType(pub NSInteger);
impl UITextSmartDashesType {
    #[doc(alias = "UITextSmartDashesTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextSmartDashesTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextSmartDashesTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextSmartInsertDeleteType(pub NSInteger);
impl UITextSmartInsertDeleteType {
    #[doc(alias = "UITextSmartInsertDeleteTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextSmartInsertDeleteTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextSmartInsertDeleteTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UITextInlinePredictionType(pub NSInteger);
impl UITextInlinePredictionType {
    #[doc(alias = "UITextInlinePredictionTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UITextInlinePredictionTypeNo")]
    pub const No: Self = Self(1);
    #[doc(alias = "UITextInlinePredictionTypeYes")]
    pub const Yes: Self = Self(2);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIKeyboardType(pub NSInteger);
impl UIKeyboardType {
    #[doc(alias = "UIKeyboardTypeDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UIKeyboardTypeASCIICapable")]
    pub const ASCIICapable: Self = Self(1);
    #[doc(alias = "UIKeyboardTypeNumbersAndPunctuation")]
    pub const NumbersAndPunctuation: Self = Self(2);
    #[doc(alias = "UIKeyboardTypeURL")]
    pub const URL: Self = Self(3);
    #[doc(alias = "UIKeyboardTypeNumberPad")]
    pub const NumberPad: Self = Self(4);
    #[doc(alias = "UIKeyboardTypePhonePad")]
    pub const PhonePad: Self = Self(5);
    #[doc(alias = "UIKeyboardTypeNamePhonePad")]
    pub const NamePhonePad: Self = Self(6);
    #[doc(alias = "UIKeyboardTypeEmailAddress")]
    pub const EmailAddress: Self = Self(7);
    #[doc(alias = "UIKeyboardTypeDecimalPad")]
    pub const DecimalPad: Self = Self(8);
    #[doc(alias = "UIKeyboardTypeTwitter")]
    pub const Twitter: Self = Self(9);
    #[doc(alias = "UIKeyboardTypeWebSearch")]
    pub const WebSearch: Self = Self(10);
    #[doc(alias = "UIKeyboardTypeASCIICapableNumberPad")]
    pub const ASCIICapableNumberPad: Self = Self(11);
    #[doc(alias = "UIKeyboardTypeAlphabet")]
    pub const Alphabet: Self = Self(UIKeyboardType::ASCIICapable.0);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIKeyboardAppearance(pub NSInteger);
impl UIKeyboardAppearance {
    #[doc(alias = "UIKeyboardAppearanceDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UIKeyboardAppearanceDark")]
    pub const Dark: Self = Self(1);
    #[doc(alias = "UIKeyboardAppearanceLight")]
    pub const Light: Self = Self(2);
    #[doc(alias = "UIKeyboardAppearanceAlert")]
    pub const Alert: Self = Self(UIKeyboardAppearance::Dark.0);
}

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

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

// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIReturnKeyType(pub NSInteger);
impl UIReturnKeyType {
    pub const UIReturnKeyDefault: Self = Self(0);
    pub const UIReturnKeyGo: Self = Self(1);
    pub const UIReturnKeyGoogle: Self = Self(2);
    pub const UIReturnKeyJoin: Self = Self(3);
    pub const UIReturnKeyNext: Self = Self(4);
    pub const UIReturnKeyRoute: Self = Self(5);
    pub const UIReturnKeySearch: Self = Self(6);
    pub const UIReturnKeySend: Self = Self(7);
    pub const UIReturnKeyYahoo: Self = Self(8);
    pub const UIReturnKeyDone: Self = Self(9);
    pub const UIReturnKeyEmergencyCall: Self = Self(10);
    pub const UIReturnKeyContinue: Self = Self(11);
}

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

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

// NS_TYPED_ENUM
pub type UITextContentType = NSString;

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

    unsafe impl ClassType for UITextInputPasswordRules {
        type Super = NSObject;
        type Mutability = MainThreadOnly;
    }
);

unsafe impl NSCoding for UITextInputPasswordRules {}

unsafe impl NSCopying for UITextInputPasswordRules {}

unsafe impl NSObjectProtocol for UITextInputPasswordRules {}

unsafe impl NSSecureCoding for UITextInputPasswordRules {}

extern_methods!(
    unsafe impl UITextInputPasswordRules {
        #[method_id(@__retain_semantics Other passwordRulesDescriptor)]
        pub unsafe fn passwordRulesDescriptor(&self) -> Retained<NSString>;

        #[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(mtm: MainThreadMarker) -> Retained<Self>;

        #[method_id(@__retain_semantics Other passwordRulesWithDescriptor:)]
        pub unsafe fn passwordRulesWithDescriptor(
            password_rules_descriptor: &NSString,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;
    }
);

extern_protocol!(
    pub unsafe trait UITextInputTraits: NSObjectProtocol + IsMainThreadOnly {
        #[optional]
        #[method(autocapitalizationType)]
        unsafe fn autocapitalizationType(&self) -> UITextAutocapitalizationType;

        #[optional]
        #[method(setAutocapitalizationType:)]
        unsafe fn setAutocapitalizationType(
            &self,
            autocapitalization_type: UITextAutocapitalizationType,
        );

        #[optional]
        #[method(autocorrectionType)]
        unsafe fn autocorrectionType(&self) -> UITextAutocorrectionType;

        #[optional]
        #[method(setAutocorrectionType:)]
        unsafe fn setAutocorrectionType(&self, autocorrection_type: UITextAutocorrectionType);

        #[optional]
        #[method(spellCheckingType)]
        unsafe fn spellCheckingType(&self) -> UITextSpellCheckingType;

        #[optional]
        #[method(setSpellCheckingType:)]
        unsafe fn setSpellCheckingType(&self, spell_checking_type: UITextSpellCheckingType);

        #[optional]
        #[method(smartQuotesType)]
        unsafe fn smartQuotesType(&self) -> UITextSmartQuotesType;

        #[optional]
        #[method(setSmartQuotesType:)]
        unsafe fn setSmartQuotesType(&self, smart_quotes_type: UITextSmartQuotesType);

        #[optional]
        #[method(smartDashesType)]
        unsafe fn smartDashesType(&self) -> UITextSmartDashesType;

        #[optional]
        #[method(setSmartDashesType:)]
        unsafe fn setSmartDashesType(&self, smart_dashes_type: UITextSmartDashesType);

        #[optional]
        #[method(smartInsertDeleteType)]
        unsafe fn smartInsertDeleteType(&self) -> UITextSmartInsertDeleteType;

        #[optional]
        #[method(setSmartInsertDeleteType:)]
        unsafe fn setSmartInsertDeleteType(
            &self,
            smart_insert_delete_type: UITextSmartInsertDeleteType,
        );

        #[optional]
        #[method(inlinePredictionType)]
        unsafe fn inlinePredictionType(&self) -> UITextInlinePredictionType;

        #[optional]
        #[method(setInlinePredictionType:)]
        unsafe fn setInlinePredictionType(
            &self,
            inline_prediction_type: UITextInlinePredictionType,
        );

        #[optional]
        #[method(keyboardType)]
        unsafe fn keyboardType(&self) -> UIKeyboardType;

        #[optional]
        #[method(setKeyboardType:)]
        unsafe fn setKeyboardType(&self, keyboard_type: UIKeyboardType);

        #[optional]
        #[method(keyboardAppearance)]
        unsafe fn keyboardAppearance(&self) -> UIKeyboardAppearance;

        #[optional]
        #[method(setKeyboardAppearance:)]
        unsafe fn setKeyboardAppearance(&self, keyboard_appearance: UIKeyboardAppearance);

        #[optional]
        #[method(returnKeyType)]
        unsafe fn returnKeyType(&self) -> UIReturnKeyType;

        #[optional]
        #[method(setReturnKeyType:)]
        unsafe fn setReturnKeyType(&self, return_key_type: UIReturnKeyType);

        #[optional]
        #[method(enablesReturnKeyAutomatically)]
        unsafe fn enablesReturnKeyAutomatically(&self) -> bool;

        #[optional]
        #[method(setEnablesReturnKeyAutomatically:)]
        unsafe fn setEnablesReturnKeyAutomatically(&self, enables_return_key_automatically: bool);

        #[optional]
        #[method(isSecureTextEntry)]
        unsafe fn isSecureTextEntry(&self) -> bool;

        #[optional]
        #[method(setSecureTextEntry:)]
        unsafe fn setSecureTextEntry(&self, secure_text_entry: bool);

        #[optional]
        #[method_id(@__retain_semantics Other textContentType)]
        unsafe fn textContentType(&self) -> Retained<UITextContentType>;

        #[optional]
        #[method(setTextContentType:)]
        unsafe fn setTextContentType(&self, text_content_type: Option<&UITextContentType>);

        #[optional]
        #[method_id(@__retain_semantics Other passwordRules)]
        unsafe fn passwordRules(&self) -> Option<Retained<UITextInputPasswordRules>>;

        #[optional]
        #[method(setPasswordRules:)]
        unsafe fn setPasswordRules(&self, password_rules: Option<&UITextInputPasswordRules>);
    }

    unsafe impl ProtocolType for dyn UITextInputTraits {}
);

extern "C" {
    pub static UITextContentTypeName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeNamePrefix: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeGivenName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeMiddleName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeFamilyName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeNameSuffix: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeNickname: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeJobTitle: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeOrganizationName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeLocation: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeFullStreetAddress: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeStreetAddressLine1: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeStreetAddressLine2: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeAddressCity: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeAddressState: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeAddressCityAndState: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeSublocality: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCountryName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypePostalCode: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeTelephoneNumber: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeEmailAddress: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeURL: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardNumber: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeUsername: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypePassword: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeNewPassword: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeOneTimeCode: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeShipmentTrackingNumber: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeFlightNumber: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeDateTime: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeBirthdate: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeBirthdateDay: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeBirthdateMonth: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeBirthdateYear: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardSecurityCode: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardGivenName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardMiddleName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardFamilyName: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardExpiration: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardExpirationMonth: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardExpirationYear: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCreditCardType: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCellularEID: &'static UITextContentType;
}

extern "C" {
    pub static UITextContentTypeCellularIMEI: &'static UITextContentType;
}