objc2_ui_kit/generated/
UIInterface.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::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibarstyle?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct UIBarStyle(pub NSInteger);
15impl UIBarStyle {
16    #[doc(alias = "UIBarStyleDefault")]
17    pub const Default: Self = Self(0);
18    #[doc(alias = "UIBarStyleBlack")]
19    pub const Black: Self = Self(1);
20    #[doc(alias = "UIBarStyleBlackOpaque")]
21    #[deprecated = "Use UIBarStyleBlack instead."]
22    pub const BlackOpaque: Self = Self(1);
23    #[doc(alias = "UIBarStyleBlackTranslucent")]
24    #[deprecated = "Use UIBarStyleBlack and set the translucent property to YES instead."]
25    pub const BlackTranslucent: Self = Self(2);
26}
27
28unsafe impl Encode for UIBarStyle {
29    const ENCODING: Encoding = NSInteger::ENCODING;
30}
31
32unsafe impl RefEncode for UIBarStyle {
33    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
34}
35
36/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiuserinterfacesizeclass?language=objc)
37// NS_ENUM
38#[repr(transparent)]
39#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
40pub struct UIUserInterfaceSizeClass(pub NSInteger);
41impl UIUserInterfaceSizeClass {
42    #[doc(alias = "UIUserInterfaceSizeClassUnspecified")]
43    pub const Unspecified: Self = Self(0);
44    #[doc(alias = "UIUserInterfaceSizeClassCompact")]
45    pub const Compact: Self = Self(1);
46    #[doc(alias = "UIUserInterfaceSizeClassRegular")]
47    pub const Regular: Self = Self(2);
48}
49
50unsafe impl Encode for UIUserInterfaceSizeClass {
51    const ENCODING: Encoding = NSInteger::ENCODING;
52}
53
54unsafe impl RefEncode for UIUserInterfaceSizeClass {
55    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiuserinterfacestyle?language=objc)
59// NS_ENUM
60#[repr(transparent)]
61#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
62pub struct UIUserInterfaceStyle(pub NSInteger);
63impl UIUserInterfaceStyle {
64    #[doc(alias = "UIUserInterfaceStyleUnspecified")]
65    pub const Unspecified: Self = Self(0);
66    #[doc(alias = "UIUserInterfaceStyleLight")]
67    pub const Light: Self = Self(1);
68    #[doc(alias = "UIUserInterfaceStyleDark")]
69    pub const Dark: Self = Self(2);
70}
71
72unsafe impl Encode for UIUserInterfaceStyle {
73    const ENCODING: Encoding = NSInteger::ENCODING;
74}
75
76unsafe impl RefEncode for UIUserInterfaceStyle {
77    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
78}
79
80/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiuserinterfacelayoutdirection?language=objc)
81// NS_ENUM
82#[repr(transparent)]
83#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
84pub struct UIUserInterfaceLayoutDirection(pub NSInteger);
85impl UIUserInterfaceLayoutDirection {
86    #[doc(alias = "UIUserInterfaceLayoutDirectionLeftToRight")]
87    pub const LeftToRight: Self = Self(0);
88    #[doc(alias = "UIUserInterfaceLayoutDirectionRightToLeft")]
89    pub const RightToLeft: Self = Self(1);
90}
91
92unsafe impl Encode for UIUserInterfaceLayoutDirection {
93    const ENCODING: Encoding = NSInteger::ENCODING;
94}
95
96unsafe impl RefEncode for UIUserInterfaceLayoutDirection {
97    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
98}
99
100/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitenvironmentlayoutdirection?language=objc)
101// NS_ENUM
102#[repr(transparent)]
103#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
104pub struct UITraitEnvironmentLayoutDirection(pub NSInteger);
105impl UITraitEnvironmentLayoutDirection {
106    #[doc(alias = "UITraitEnvironmentLayoutDirectionUnspecified")]
107    pub const Unspecified: Self = Self(-1);
108    #[doc(alias = "UITraitEnvironmentLayoutDirectionLeftToRight")]
109    pub const LeftToRight: Self = Self(UIUserInterfaceLayoutDirection::LeftToRight.0);
110    #[doc(alias = "UITraitEnvironmentLayoutDirectionRightToLeft")]
111    pub const RightToLeft: Self = Self(UIUserInterfaceLayoutDirection::RightToLeft.0);
112}
113
114unsafe impl Encode for UITraitEnvironmentLayoutDirection {
115    const ENCODING: Encoding = NSInteger::ENCODING;
116}
117
118unsafe impl RefEncode for UITraitEnvironmentLayoutDirection {
119    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
120}
121
122/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uidisplaygamut?language=objc)
123// NS_ENUM
124#[repr(transparent)]
125#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
126pub struct UIDisplayGamut(pub NSInteger);
127impl UIDisplayGamut {
128    #[doc(alias = "UIDisplayGamutUnspecified")]
129    pub const Unspecified: Self = Self(-1);
130    #[doc(alias = "UIDisplayGamutSRGB")]
131    pub const SRGB: Self = Self(0);
132    #[doc(alias = "UIDisplayGamutP3")]
133    pub const P3: Self = Self(1);
134}
135
136unsafe impl Encode for UIDisplayGamut {
137    const ENCODING: Encoding = NSInteger::ENCODING;
138}
139
140unsafe impl RefEncode for UIDisplayGamut {
141    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
142}
143
144/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiaccessibilitycontrast?language=objc)
145// NS_ENUM
146#[repr(transparent)]
147#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
148pub struct UIAccessibilityContrast(pub NSInteger);
149impl UIAccessibilityContrast {
150    #[doc(alias = "UIAccessibilityContrastUnspecified")]
151    pub const Unspecified: Self = Self(-1);
152    #[doc(alias = "UIAccessibilityContrastNormal")]
153    pub const Normal: Self = Self(0);
154    #[doc(alias = "UIAccessibilityContrastHigh")]
155    pub const High: Self = Self(1);
156}
157
158unsafe impl Encode for UIAccessibilityContrast {
159    const ENCODING: Encoding = NSInteger::ENCODING;
160}
161
162unsafe impl RefEncode for UIAccessibilityContrast {
163    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
164}
165
166/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uilegibilityweight?language=objc)
167// NS_ENUM
168#[repr(transparent)]
169#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
170pub struct UILegibilityWeight(pub NSInteger);
171impl UILegibilityWeight {
172    #[doc(alias = "UILegibilityWeightUnspecified")]
173    pub const Unspecified: Self = Self(-1);
174    #[doc(alias = "UILegibilityWeightRegular")]
175    pub const Regular: Self = Self(0);
176    #[doc(alias = "UILegibilityWeightBold")]
177    pub const Bold: Self = Self(1);
178}
179
180unsafe impl Encode for UILegibilityWeight {
181    const ENCODING: Encoding = NSInteger::ENCODING;
182}
183
184unsafe impl RefEncode for UILegibilityWeight {
185    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
186}
187
188/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiuserinterfacelevel?language=objc)
189// NS_ENUM
190#[repr(transparent)]
191#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
192pub struct UIUserInterfaceLevel(pub NSInteger);
193impl UIUserInterfaceLevel {
194    #[doc(alias = "UIUserInterfaceLevelUnspecified")]
195    pub const Unspecified: Self = Self(-1);
196    #[doc(alias = "UIUserInterfaceLevelBase")]
197    pub const Base: Self = Self(0);
198    #[doc(alias = "UIUserInterfaceLevelElevated")]
199    pub const Elevated: Self = Self(1);
200}
201
202unsafe impl Encode for UIUserInterfaceLevel {
203    const ENCODING: Encoding = NSInteger::ENCODING;
204}
205
206unsafe impl RefEncode for UIUserInterfaceLevel {
207    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
208}
209
210/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiuserinterfaceactiveappearance?language=objc)
211// NS_ENUM
212#[repr(transparent)]
213#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
214pub struct UIUserInterfaceActiveAppearance(pub NSInteger);
215impl UIUserInterfaceActiveAppearance {
216    #[doc(alias = "UIUserInterfaceActiveAppearanceUnspecified")]
217    pub const Unspecified: Self = Self(-1);
218    #[doc(alias = "UIUserInterfaceActiveAppearanceInactive")]
219    pub const Inactive: Self = Self(0);
220    #[doc(alias = "UIUserInterfaceActiveAppearanceActive")]
221    pub const Active: Self = Self(1);
222}
223
224unsafe impl Encode for UIUserInterfaceActiveAppearance {
225    const ENCODING: Encoding = NSInteger::ENCODING;
226}
227
228unsafe impl RefEncode for UIUserInterfaceActiveAppearance {
229    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
230}
231
232/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uinstoolbaritempresentationsize?language=objc)
233// NS_ENUM
234#[repr(transparent)]
235#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
236pub struct UINSToolbarItemPresentationSize(pub NSInteger);
237impl UINSToolbarItemPresentationSize {
238    #[doc(alias = "UINSToolbarItemPresentationSizeUnspecified")]
239    pub const Unspecified: Self = Self(-1);
240    #[doc(alias = "UINSToolbarItemPresentationSizeRegular")]
241    pub const Regular: Self = Self(0);
242    #[doc(alias = "UINSToolbarItemPresentationSizeSmall")]
243    pub const Small: Self = Self(1);
244    #[doc(alias = "UINSToolbarItemPresentationSizeLarge")]
245    pub const Large: Self = Self(3);
246}
247
248unsafe impl Encode for UINSToolbarItemPresentationSize {
249    const ENCODING: Encoding = NSInteger::ENCODING;
250}
251
252unsafe impl RefEncode for UINSToolbarItemPresentationSize {
253    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
254}
255
256/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiimagedynamicrange?language=objc)
257// NS_ENUM
258#[repr(transparent)]
259#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
260pub struct UIImageDynamicRange(pub NSInteger);
261impl UIImageDynamicRange {
262    /// Do not specify a preferred dynamic range.
263    #[doc(alias = "UIImageDynamicRangeUnspecified")]
264    pub const Unspecified: Self = Self(-1);
265    /// Restrict the image content dynamic range to the standard range.
266    #[doc(alias = "UIImageDynamicRangeStandard")]
267    pub const Standard: Self = Self(0);
268    /// Allow image content to use some extended range. This is appropriate for mixing content with standard and high dynamic ranges.
269    #[doc(alias = "UIImageDynamicRangeConstrainedHigh")]
270    pub const ConstrainedHigh: Self = Self(1);
271    /// Allow image content to use unrestricted extended range.
272    #[doc(alias = "UIImageDynamicRangeHigh")]
273    pub const High: Self = Self(2);
274}
275
276unsafe impl Encode for UIImageDynamicRange {
277    const ENCODING: Encoding = NSInteger::ENCODING;
278}
279
280unsafe impl RefEncode for UIImageDynamicRange {
281    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
282}
283
284/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uihdrheadroomusagelimit?language=objc)
285// NS_ENUM
286#[repr(transparent)]
287#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
288pub struct UIHDRHeadroomUsageLimit(pub NSInteger);
289impl UIHDRHeadroomUsageLimit {
290    /// Headroom usage limits are not defined
291    #[doc(alias = "UIHDRHeadroomUsageLimitUnspecified")]
292    pub const Unspecified: Self = Self(-1);
293    /// Headroom usage limits are in effect, HDR headroom usage should be restricted
294    #[doc(alias = "UIHDRHeadroomUsageLimitActive")]
295    pub const Active: Self = Self(0);
296    /// Headroom usage limits are disabled, HDR headroom usage is unrestricted.
297    #[doc(alias = "UIHDRHeadroomUsageLimitInactive")]
298    pub const Inactive: Self = Self(1);
299}
300
301unsafe impl Encode for UIHDRHeadroomUsageLimit {
302    const ENCODING: Encoding = NSInteger::ENCODING;
303}
304
305unsafe impl RefEncode for UIHDRHeadroomUsageLimit {
306    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
307}
308
309/// UIColorSystemColors.
310#[cfg(feature = "UIColor")]
311impl UIColor {
312    extern_methods!(
313        #[unsafe(method(systemRedColor))]
314        #[unsafe(method_family = none)]
315        pub fn systemRedColor() -> Retained<UIColor>;
316
317        #[unsafe(method(systemGreenColor))]
318        #[unsafe(method_family = none)]
319        pub fn systemGreenColor() -> Retained<UIColor>;
320
321        #[unsafe(method(systemBlueColor))]
322        #[unsafe(method_family = none)]
323        pub fn systemBlueColor() -> Retained<UIColor>;
324
325        #[unsafe(method(systemOrangeColor))]
326        #[unsafe(method_family = none)]
327        pub fn systemOrangeColor() -> Retained<UIColor>;
328
329        #[unsafe(method(systemYellowColor))]
330        #[unsafe(method_family = none)]
331        pub fn systemYellowColor() -> Retained<UIColor>;
332
333        #[unsafe(method(systemPinkColor))]
334        #[unsafe(method_family = none)]
335        pub fn systemPinkColor() -> Retained<UIColor>;
336
337        #[unsafe(method(systemPurpleColor))]
338        #[unsafe(method_family = none)]
339        pub fn systemPurpleColor() -> Retained<UIColor>;
340
341        #[unsafe(method(systemTealColor))]
342        #[unsafe(method_family = none)]
343        pub fn systemTealColor() -> Retained<UIColor>;
344
345        #[unsafe(method(systemIndigoColor))]
346        #[unsafe(method_family = none)]
347        pub fn systemIndigoColor() -> Retained<UIColor>;
348
349        #[unsafe(method(systemBrownColor))]
350        #[unsafe(method_family = none)]
351        pub fn systemBrownColor() -> Retained<UIColor>;
352
353        #[unsafe(method(systemMintColor))]
354        #[unsafe(method_family = none)]
355        pub fn systemMintColor() -> Retained<UIColor>;
356
357        #[unsafe(method(systemCyanColor))]
358        #[unsafe(method_family = none)]
359        pub fn systemCyanColor() -> Retained<UIColor>;
360
361        #[unsafe(method(systemGrayColor))]
362        #[unsafe(method_family = none)]
363        pub fn systemGrayColor() -> Retained<UIColor>;
364
365        #[unsafe(method(systemGray2Color))]
366        #[unsafe(method_family = none)]
367        pub fn systemGray2Color() -> Retained<UIColor>;
368
369        #[unsafe(method(systemGray3Color))]
370        #[unsafe(method_family = none)]
371        pub fn systemGray3Color() -> Retained<UIColor>;
372
373        #[unsafe(method(systemGray4Color))]
374        #[unsafe(method_family = none)]
375        pub fn systemGray4Color() -> Retained<UIColor>;
376
377        #[unsafe(method(systemGray5Color))]
378        #[unsafe(method_family = none)]
379        pub fn systemGray5Color() -> Retained<UIColor>;
380
381        #[unsafe(method(systemGray6Color))]
382        #[unsafe(method_family = none)]
383        pub fn systemGray6Color() -> Retained<UIColor>;
384
385        #[unsafe(method(tintColor))]
386        #[unsafe(method_family = none)]
387        pub fn tintColor() -> Retained<UIColor>;
388
389        #[unsafe(method(labelColor))]
390        #[unsafe(method_family = none)]
391        pub fn labelColor() -> Retained<UIColor>;
392
393        #[unsafe(method(secondaryLabelColor))]
394        #[unsafe(method_family = none)]
395        pub fn secondaryLabelColor() -> Retained<UIColor>;
396
397        #[unsafe(method(tertiaryLabelColor))]
398        #[unsafe(method_family = none)]
399        pub fn tertiaryLabelColor() -> Retained<UIColor>;
400
401        #[unsafe(method(quaternaryLabelColor))]
402        #[unsafe(method_family = none)]
403        pub fn quaternaryLabelColor() -> Retained<UIColor>;
404
405        #[unsafe(method(linkColor))]
406        #[unsafe(method_family = none)]
407        pub fn linkColor() -> Retained<UIColor>;
408
409        #[unsafe(method(placeholderTextColor))]
410        #[unsafe(method_family = none)]
411        pub fn placeholderTextColor() -> Retained<UIColor>;
412
413        #[unsafe(method(separatorColor))]
414        #[unsafe(method_family = none)]
415        pub fn separatorColor() -> Retained<UIColor>;
416
417        #[unsafe(method(opaqueSeparatorColor))]
418        #[unsafe(method_family = none)]
419        pub fn opaqueSeparatorColor() -> Retained<UIColor>;
420
421        #[unsafe(method(systemBackgroundColor))]
422        #[unsafe(method_family = none)]
423        pub fn systemBackgroundColor() -> Retained<UIColor>;
424
425        #[unsafe(method(secondarySystemBackgroundColor))]
426        #[unsafe(method_family = none)]
427        pub fn secondarySystemBackgroundColor() -> Retained<UIColor>;
428
429        #[unsafe(method(tertiarySystemBackgroundColor))]
430        #[unsafe(method_family = none)]
431        pub fn tertiarySystemBackgroundColor() -> Retained<UIColor>;
432
433        #[unsafe(method(systemGroupedBackgroundColor))]
434        #[unsafe(method_family = none)]
435        pub fn systemGroupedBackgroundColor() -> Retained<UIColor>;
436
437        #[unsafe(method(secondarySystemGroupedBackgroundColor))]
438        #[unsafe(method_family = none)]
439        pub fn secondarySystemGroupedBackgroundColor() -> Retained<UIColor>;
440
441        #[unsafe(method(tertiarySystemGroupedBackgroundColor))]
442        #[unsafe(method_family = none)]
443        pub fn tertiarySystemGroupedBackgroundColor() -> Retained<UIColor>;
444
445        #[unsafe(method(systemFillColor))]
446        #[unsafe(method_family = none)]
447        pub fn systemFillColor() -> Retained<UIColor>;
448
449        #[unsafe(method(secondarySystemFillColor))]
450        #[unsafe(method_family = none)]
451        pub fn secondarySystemFillColor() -> Retained<UIColor>;
452
453        #[unsafe(method(tertiarySystemFillColor))]
454        #[unsafe(method_family = none)]
455        pub fn tertiarySystemFillColor() -> Retained<UIColor>;
456
457        #[unsafe(method(quaternarySystemFillColor))]
458        #[unsafe(method_family = none)]
459        pub fn quaternarySystemFillColor() -> Retained<UIColor>;
460
461        #[unsafe(method(lightTextColor))]
462        #[unsafe(method_family = none)]
463        pub fn lightTextColor() -> Retained<UIColor>;
464
465        #[unsafe(method(darkTextColor))]
466        #[unsafe(method_family = none)]
467        pub fn darkTextColor() -> Retained<UIColor>;
468
469        #[deprecated]
470        #[unsafe(method(groupTableViewBackgroundColor))]
471        #[unsafe(method_family = none)]
472        pub fn groupTableViewBackgroundColor() -> Retained<UIColor>;
473
474        #[deprecated]
475        #[unsafe(method(viewFlipsideBackgroundColor))]
476        #[unsafe(method_family = none)]
477        pub fn viewFlipsideBackgroundColor() -> Retained<UIColor>;
478
479        #[deprecated]
480        #[unsafe(method(scrollViewTexturedBackgroundColor))]
481        #[unsafe(method_family = none)]
482        pub fn scrollViewTexturedBackgroundColor() -> Retained<UIColor>;
483
484        #[deprecated]
485        #[unsafe(method(underPageBackgroundColor))]
486        #[unsafe(method_family = none)]
487        pub fn underPageBackgroundColor() -> Retained<UIColor>;
488    );
489}
490
491/// UIFontSystemFonts.
492#[cfg(feature = "UIFont")]
493impl UIFont {
494    extern_methods!(
495        #[cfg(feature = "objc2-core-foundation")]
496        #[unsafe(method(labelFontSize))]
497        #[unsafe(method_family = none)]
498        pub fn labelFontSize() -> CGFloat;
499
500        #[cfg(feature = "objc2-core-foundation")]
501        #[unsafe(method(buttonFontSize))]
502        #[unsafe(method_family = none)]
503        pub fn buttonFontSize() -> CGFloat;
504
505        #[cfg(feature = "objc2-core-foundation")]
506        #[unsafe(method(smallSystemFontSize))]
507        #[unsafe(method_family = none)]
508        pub fn smallSystemFontSize() -> CGFloat;
509
510        #[cfg(feature = "objc2-core-foundation")]
511        #[unsafe(method(systemFontSize))]
512        #[unsafe(method_family = none)]
513        pub fn systemFontSize() -> CGFloat;
514
515        #[cfg(feature = "objc2-core-foundation")]
516        #[unsafe(method(defaultFontSize))]
517        #[unsafe(method_family = none)]
518        pub fn defaultFontSize() -> CGFloat;
519
520        #[cfg(feature = "objc2-core-foundation")]
521        #[unsafe(method(systemMinimumFontSize))]
522        #[unsafe(method_family = none)]
523        pub fn systemMinimumFontSize() -> CGFloat;
524    );
525}