objc2_ui_kit/generated/
UITrait.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-foundation")]
6use objc2_core_foundation::*;
7use objc2_foundation::*;
8
9use crate::*;
10
11extern_protocol!(
12    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitdefinition?language=objc)
13    pub unsafe trait UITraitDefinition: MainThreadOnly {
14        /// A unique identifier string for the trait (reverse-DNS format recommended).
15        /// Allows the trait to be encoded/decoded, and to map both a Swift and Objective-C trait to the same data.
16        #[optional]
17        #[unsafe(method(identifier))]
18        #[unsafe(method_family = none)]
19        unsafe fn identifier(mtm: MainThreadMarker) -> Retained<NSString>;
20
21        /// A short human-readable name for the trait, e.g. for printing and debugging output.
22        /// By default, the trait's class name is used when not implemented.
23        #[optional]
24        #[unsafe(method(name))]
25        #[unsafe(method_family = none)]
26        unsafe fn name(mtm: MainThreadMarker) -> Retained<NSString>;
27
28        /// Whether the trait is used to resolve dynamic colors (or images), and changes to the trait should
29        /// automatically trigger views using dynamic colors/images to update their appearance. Default is NO.
30        #[optional]
31        #[unsafe(method(affectsColorAppearance))]
32        #[unsafe(method_family = none)]
33        unsafe fn affectsColorAppearance(mtm: MainThreadMarker) -> bool;
34    }
35);
36
37/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitrait?language=objc)
38pub type UITrait = AnyClass;
39
40extern_protocol!(
41    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicgfloattraitdefinition?language=objc)
42    pub unsafe trait UICGFloatTraitDefinition: UITraitDefinition + MainThreadOnly {
43        #[cfg(feature = "objc2-core-foundation")]
44        /// The default value for this trait in a trait collection when no value has been set.
45        #[unsafe(method(defaultValue))]
46        #[unsafe(method_family = none)]
47        unsafe fn defaultValue(mtm: MainThreadMarker) -> CGFloat;
48    }
49);
50
51/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uicgfloattrait?language=objc)
52pub type UICGFloatTrait = AnyClass;
53
54extern_protocol!(
55    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uinsintegertraitdefinition?language=objc)
56    pub unsafe trait UINSIntegerTraitDefinition: UITraitDefinition + MainThreadOnly {
57        /// The default value for this trait in a trait collection when no value has been set.
58        #[unsafe(method(defaultValue))]
59        #[unsafe(method_family = none)]
60        unsafe fn defaultValue(mtm: MainThreadMarker) -> NSInteger;
61    }
62);
63
64/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uinsintegertrait?language=objc)
65pub type UINSIntegerTrait = AnyClass;
66
67extern_protocol!(
68    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiobjecttraitdefinition?language=objc)
69    pub unsafe trait UIObjectTraitDefinition: UITraitDefinition + MainThreadOnly {
70        /// The default value for this trait in a trait collection when no value has been set.
71        #[unsafe(method(defaultValue))]
72        #[unsafe(method_family = none)]
73        unsafe fn defaultValue(
74            mtm: MainThreadMarker,
75        ) -> Option<Retained<ProtocolObject<dyn NSObjectProtocol>>>;
76    }
77);
78
79/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiobjecttrait?language=objc)
80pub type UIObjectTrait = AnyClass;
81
82extern_class!(
83    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraituserinterfaceidiom?language=objc)
84    #[unsafe(super(NSObject))]
85    #[thread_kind = MainThreadOnly]
86    #[derive(Debug, PartialEq, Eq, Hash)]
87    pub struct UITraitUserInterfaceIdiom;
88);
89
90unsafe impl NSObjectProtocol for UITraitUserInterfaceIdiom {}
91
92unsafe impl UINSIntegerTraitDefinition for UITraitUserInterfaceIdiom {}
93
94unsafe impl UITraitDefinition for UITraitUserInterfaceIdiom {}
95
96impl UITraitUserInterfaceIdiom {
97    extern_methods!();
98}
99
100/// Methods declared on superclass `NSObject`.
101impl UITraitUserInterfaceIdiom {
102    extern_methods!(
103        #[unsafe(method(init))]
104        #[unsafe(method_family = init)]
105        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
106
107        #[unsafe(method(new))]
108        #[unsafe(method_family = new)]
109        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
110    );
111}
112
113extern_class!(
114    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraituserinterfacestyle?language=objc)
115    #[unsafe(super(NSObject))]
116    #[thread_kind = MainThreadOnly]
117    #[derive(Debug, PartialEq, Eq, Hash)]
118    pub struct UITraitUserInterfaceStyle;
119);
120
121unsafe impl NSObjectProtocol for UITraitUserInterfaceStyle {}
122
123unsafe impl UINSIntegerTraitDefinition for UITraitUserInterfaceStyle {}
124
125unsafe impl UITraitDefinition for UITraitUserInterfaceStyle {}
126
127impl UITraitUserInterfaceStyle {
128    extern_methods!();
129}
130
131/// Methods declared on superclass `NSObject`.
132impl UITraitUserInterfaceStyle {
133    extern_methods!(
134        #[unsafe(method(init))]
135        #[unsafe(method_family = init)]
136        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
137
138        #[unsafe(method(new))]
139        #[unsafe(method_family = new)]
140        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
141    );
142}
143
144extern_class!(
145    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitlayoutdirection?language=objc)
146    #[unsafe(super(NSObject))]
147    #[thread_kind = MainThreadOnly]
148    #[derive(Debug, PartialEq, Eq, Hash)]
149    pub struct UITraitLayoutDirection;
150);
151
152unsafe impl NSObjectProtocol for UITraitLayoutDirection {}
153
154unsafe impl UINSIntegerTraitDefinition for UITraitLayoutDirection {}
155
156unsafe impl UITraitDefinition for UITraitLayoutDirection {}
157
158impl UITraitLayoutDirection {
159    extern_methods!();
160}
161
162/// Methods declared on superclass `NSObject`.
163impl UITraitLayoutDirection {
164    extern_methods!(
165        #[unsafe(method(init))]
166        #[unsafe(method_family = init)]
167        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
168
169        #[unsafe(method(new))]
170        #[unsafe(method_family = new)]
171        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
172    );
173}
174
175extern_class!(
176    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitdisplayscale?language=objc)
177    #[unsafe(super(NSObject))]
178    #[thread_kind = MainThreadOnly]
179    #[derive(Debug, PartialEq, Eq, Hash)]
180    pub struct UITraitDisplayScale;
181);
182
183unsafe impl NSObjectProtocol for UITraitDisplayScale {}
184
185unsafe impl UICGFloatTraitDefinition for UITraitDisplayScale {}
186
187unsafe impl UITraitDefinition for UITraitDisplayScale {}
188
189impl UITraitDisplayScale {
190    extern_methods!();
191}
192
193/// Methods declared on superclass `NSObject`.
194impl UITraitDisplayScale {
195    extern_methods!(
196        #[unsafe(method(init))]
197        #[unsafe(method_family = init)]
198        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
199
200        #[unsafe(method(new))]
201        #[unsafe(method_family = new)]
202        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
203    );
204}
205
206extern_class!(
207    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraithorizontalsizeclass?language=objc)
208    #[unsafe(super(NSObject))]
209    #[thread_kind = MainThreadOnly]
210    #[derive(Debug, PartialEq, Eq, Hash)]
211    pub struct UITraitHorizontalSizeClass;
212);
213
214unsafe impl NSObjectProtocol for UITraitHorizontalSizeClass {}
215
216unsafe impl UINSIntegerTraitDefinition for UITraitHorizontalSizeClass {}
217
218unsafe impl UITraitDefinition for UITraitHorizontalSizeClass {}
219
220impl UITraitHorizontalSizeClass {
221    extern_methods!();
222}
223
224/// Methods declared on superclass `NSObject`.
225impl UITraitHorizontalSizeClass {
226    extern_methods!(
227        #[unsafe(method(init))]
228        #[unsafe(method_family = init)]
229        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
230
231        #[unsafe(method(new))]
232        #[unsafe(method_family = new)]
233        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
234    );
235}
236
237extern_class!(
238    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitverticalsizeclass?language=objc)
239    #[unsafe(super(NSObject))]
240    #[thread_kind = MainThreadOnly]
241    #[derive(Debug, PartialEq, Eq, Hash)]
242    pub struct UITraitVerticalSizeClass;
243);
244
245unsafe impl NSObjectProtocol for UITraitVerticalSizeClass {}
246
247unsafe impl UINSIntegerTraitDefinition for UITraitVerticalSizeClass {}
248
249unsafe impl UITraitDefinition for UITraitVerticalSizeClass {}
250
251impl UITraitVerticalSizeClass {
252    extern_methods!();
253}
254
255/// Methods declared on superclass `NSObject`.
256impl UITraitVerticalSizeClass {
257    extern_methods!(
258        #[unsafe(method(init))]
259        #[unsafe(method_family = init)]
260        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
261
262        #[unsafe(method(new))]
263        #[unsafe(method_family = new)]
264        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
265    );
266}
267
268extern_class!(
269    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitforcetouchcapability?language=objc)
270    #[unsafe(super(NSObject))]
271    #[thread_kind = MainThreadOnly]
272    #[derive(Debug, PartialEq, Eq, Hash)]
273    pub struct UITraitForceTouchCapability;
274);
275
276unsafe impl NSObjectProtocol for UITraitForceTouchCapability {}
277
278unsafe impl UINSIntegerTraitDefinition for UITraitForceTouchCapability {}
279
280unsafe impl UITraitDefinition for UITraitForceTouchCapability {}
281
282impl UITraitForceTouchCapability {
283    extern_methods!();
284}
285
286/// Methods declared on superclass `NSObject`.
287impl UITraitForceTouchCapability {
288    extern_methods!(
289        #[unsafe(method(init))]
290        #[unsafe(method_family = init)]
291        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
292
293        #[unsafe(method(new))]
294        #[unsafe(method_family = new)]
295        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
296    );
297}
298
299extern_class!(
300    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitpreferredcontentsizecategory?language=objc)
301    #[unsafe(super(NSObject))]
302    #[thread_kind = MainThreadOnly]
303    #[derive(Debug, PartialEq, Eq, Hash)]
304    pub struct UITraitPreferredContentSizeCategory;
305);
306
307unsafe impl NSObjectProtocol for UITraitPreferredContentSizeCategory {}
308
309unsafe impl UIObjectTraitDefinition for UITraitPreferredContentSizeCategory {}
310
311unsafe impl UITraitDefinition for UITraitPreferredContentSizeCategory {}
312
313impl UITraitPreferredContentSizeCategory {
314    extern_methods!();
315}
316
317/// Methods declared on superclass `NSObject`.
318impl UITraitPreferredContentSizeCategory {
319    extern_methods!(
320        #[unsafe(method(init))]
321        #[unsafe(method_family = init)]
322        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
323
324        #[unsafe(method(new))]
325        #[unsafe(method_family = new)]
326        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
327    );
328}
329
330extern_class!(
331    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitdisplaygamut?language=objc)
332    #[unsafe(super(NSObject))]
333    #[thread_kind = MainThreadOnly]
334    #[derive(Debug, PartialEq, Eq, Hash)]
335    pub struct UITraitDisplayGamut;
336);
337
338unsafe impl NSObjectProtocol for UITraitDisplayGamut {}
339
340unsafe impl UINSIntegerTraitDefinition for UITraitDisplayGamut {}
341
342unsafe impl UITraitDefinition for UITraitDisplayGamut {}
343
344impl UITraitDisplayGamut {
345    extern_methods!();
346}
347
348/// Methods declared on superclass `NSObject`.
349impl UITraitDisplayGamut {
350    extern_methods!(
351        #[unsafe(method(init))]
352        #[unsafe(method_family = init)]
353        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
354
355        #[unsafe(method(new))]
356        #[unsafe(method_family = new)]
357        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
358    );
359}
360
361extern_class!(
362    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitaccessibilitycontrast?language=objc)
363    #[unsafe(super(NSObject))]
364    #[thread_kind = MainThreadOnly]
365    #[derive(Debug, PartialEq, Eq, Hash)]
366    pub struct UITraitAccessibilityContrast;
367);
368
369unsafe impl NSObjectProtocol for UITraitAccessibilityContrast {}
370
371unsafe impl UINSIntegerTraitDefinition for UITraitAccessibilityContrast {}
372
373unsafe impl UITraitDefinition for UITraitAccessibilityContrast {}
374
375impl UITraitAccessibilityContrast {
376    extern_methods!();
377}
378
379/// Methods declared on superclass `NSObject`.
380impl UITraitAccessibilityContrast {
381    extern_methods!(
382        #[unsafe(method(init))]
383        #[unsafe(method_family = init)]
384        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
385
386        #[unsafe(method(new))]
387        #[unsafe(method_family = new)]
388        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
389    );
390}
391
392extern_class!(
393    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraituserinterfacelevel?language=objc)
394    #[unsafe(super(NSObject))]
395    #[thread_kind = MainThreadOnly]
396    #[derive(Debug, PartialEq, Eq, Hash)]
397    pub struct UITraitUserInterfaceLevel;
398);
399
400unsafe impl NSObjectProtocol for UITraitUserInterfaceLevel {}
401
402unsafe impl UINSIntegerTraitDefinition for UITraitUserInterfaceLevel {}
403
404unsafe impl UITraitDefinition for UITraitUserInterfaceLevel {}
405
406impl UITraitUserInterfaceLevel {
407    extern_methods!();
408}
409
410/// Methods declared on superclass `NSObject`.
411impl UITraitUserInterfaceLevel {
412    extern_methods!(
413        #[unsafe(method(init))]
414        #[unsafe(method_family = init)]
415        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
416
417        #[unsafe(method(new))]
418        #[unsafe(method_family = new)]
419        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
420    );
421}
422
423extern_class!(
424    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitlegibilityweight?language=objc)
425    #[unsafe(super(NSObject))]
426    #[thread_kind = MainThreadOnly]
427    #[derive(Debug, PartialEq, Eq, Hash)]
428    pub struct UITraitLegibilityWeight;
429);
430
431unsafe impl NSObjectProtocol for UITraitLegibilityWeight {}
432
433unsafe impl UINSIntegerTraitDefinition for UITraitLegibilityWeight {}
434
435unsafe impl UITraitDefinition for UITraitLegibilityWeight {}
436
437impl UITraitLegibilityWeight {
438    extern_methods!();
439}
440
441/// Methods declared on superclass `NSObject`.
442impl UITraitLegibilityWeight {
443    extern_methods!(
444        #[unsafe(method(init))]
445        #[unsafe(method_family = init)]
446        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
447
448        #[unsafe(method(new))]
449        #[unsafe(method_family = new)]
450        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
451    );
452}
453
454extern_class!(
455    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitactiveappearance?language=objc)
456    #[unsafe(super(NSObject))]
457    #[thread_kind = MainThreadOnly]
458    #[derive(Debug, PartialEq, Eq, Hash)]
459    pub struct UITraitActiveAppearance;
460);
461
462unsafe impl NSObjectProtocol for UITraitActiveAppearance {}
463
464unsafe impl UINSIntegerTraitDefinition for UITraitActiveAppearance {}
465
466unsafe impl UITraitDefinition for UITraitActiveAppearance {}
467
468impl UITraitActiveAppearance {
469    extern_methods!();
470}
471
472/// Methods declared on superclass `NSObject`.
473impl UITraitActiveAppearance {
474    extern_methods!(
475        #[unsafe(method(init))]
476        #[unsafe(method_family = init)]
477        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
478
479        #[unsafe(method(new))]
480        #[unsafe(method_family = new)]
481        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
482    );
483}
484
485extern_class!(
486    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraittoolbaritempresentationsize?language=objc)
487    #[unsafe(super(NSObject))]
488    #[thread_kind = MainThreadOnly]
489    #[derive(Debug, PartialEq, Eq, Hash)]
490    pub struct UITraitToolbarItemPresentationSize;
491);
492
493unsafe impl NSObjectProtocol for UITraitToolbarItemPresentationSize {}
494
495unsafe impl UINSIntegerTraitDefinition for UITraitToolbarItemPresentationSize {}
496
497unsafe impl UITraitDefinition for UITraitToolbarItemPresentationSize {}
498
499impl UITraitToolbarItemPresentationSize {
500    extern_methods!();
501}
502
503/// Methods declared on superclass `NSObject`.
504impl UITraitToolbarItemPresentationSize {
505    extern_methods!(
506        #[unsafe(method(init))]
507        #[unsafe(method_family = init)]
508        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
509
510        #[unsafe(method(new))]
511        #[unsafe(method_family = new)]
512        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
513    );
514}
515
516extern_class!(
517    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitimagedynamicrange?language=objc)
518    #[unsafe(super(NSObject))]
519    #[thread_kind = MainThreadOnly]
520    #[derive(Debug, PartialEq, Eq, Hash)]
521    pub struct UITraitImageDynamicRange;
522);
523
524unsafe impl NSObjectProtocol for UITraitImageDynamicRange {}
525
526unsafe impl UINSIntegerTraitDefinition for UITraitImageDynamicRange {}
527
528unsafe impl UITraitDefinition for UITraitImageDynamicRange {}
529
530impl UITraitImageDynamicRange {
531    extern_methods!();
532}
533
534/// Methods declared on superclass `NSObject`.
535impl UITraitImageDynamicRange {
536    extern_methods!(
537        #[unsafe(method(init))]
538        #[unsafe(method_family = init)]
539        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
540
541        #[unsafe(method(new))]
542        #[unsafe(method_family = new)]
543        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
544    );
545}
546
547extern_class!(
548    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraittypesettinglanguage?language=objc)
549    #[unsafe(super(NSObject))]
550    #[thread_kind = MainThreadOnly]
551    #[derive(Debug, PartialEq, Eq, Hash)]
552    pub struct UITraitTypesettingLanguage;
553);
554
555unsafe impl NSObjectProtocol for UITraitTypesettingLanguage {}
556
557unsafe impl UIObjectTraitDefinition for UITraitTypesettingLanguage {}
558
559unsafe impl UITraitDefinition for UITraitTypesettingLanguage {}
560
561impl UITraitTypesettingLanguage {
562    extern_methods!();
563}
564
565/// Methods declared on superclass `NSObject`.
566impl UITraitTypesettingLanguage {
567    extern_methods!(
568        #[unsafe(method(init))]
569        #[unsafe(method_family = init)]
570        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
571
572        #[unsafe(method(new))]
573        #[unsafe(method_family = new)]
574        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
575    );
576}
577
578extern_class!(
579    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitscenecapturestate?language=objc)
580    #[unsafe(super(NSObject))]
581    #[thread_kind = MainThreadOnly]
582    #[derive(Debug, PartialEq, Eq, Hash)]
583    pub struct UITraitSceneCaptureState;
584);
585
586unsafe impl NSObjectProtocol for UITraitSceneCaptureState {}
587
588unsafe impl UINSIntegerTraitDefinition for UITraitSceneCaptureState {}
589
590unsafe impl UITraitDefinition for UITraitSceneCaptureState {}
591
592impl UITraitSceneCaptureState {
593    extern_methods!();
594}
595
596/// Methods declared on superclass `NSObject`.
597impl UITraitSceneCaptureState {
598    extern_methods!(
599        #[unsafe(method(init))]
600        #[unsafe(method_family = init)]
601        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
602
603        #[unsafe(method(new))]
604        #[unsafe(method_family = new)]
605        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
606    );
607}