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/// UIColorSystemColors.
285#[cfg(feature = "UIColor")]
286impl UIColor {
287    extern_methods!(
288        #[unsafe(method(systemRedColor))]
289        #[unsafe(method_family = none)]
290        pub unsafe fn systemRedColor() -> Retained<UIColor>;
291
292        #[unsafe(method(systemGreenColor))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn systemGreenColor() -> Retained<UIColor>;
295
296        #[unsafe(method(systemBlueColor))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn systemBlueColor() -> Retained<UIColor>;
299
300        #[unsafe(method(systemOrangeColor))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn systemOrangeColor() -> Retained<UIColor>;
303
304        #[unsafe(method(systemYellowColor))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn systemYellowColor() -> Retained<UIColor>;
307
308        #[unsafe(method(systemPinkColor))]
309        #[unsafe(method_family = none)]
310        pub unsafe fn systemPinkColor() -> Retained<UIColor>;
311
312        #[unsafe(method(systemPurpleColor))]
313        #[unsafe(method_family = none)]
314        pub unsafe fn systemPurpleColor() -> Retained<UIColor>;
315
316        #[unsafe(method(systemTealColor))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn systemTealColor() -> Retained<UIColor>;
319
320        #[unsafe(method(systemIndigoColor))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn systemIndigoColor() -> Retained<UIColor>;
323
324        #[unsafe(method(systemBrownColor))]
325        #[unsafe(method_family = none)]
326        pub unsafe fn systemBrownColor() -> Retained<UIColor>;
327
328        #[unsafe(method(systemMintColor))]
329        #[unsafe(method_family = none)]
330        pub unsafe fn systemMintColor() -> Retained<UIColor>;
331
332        #[unsafe(method(systemCyanColor))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn systemCyanColor() -> Retained<UIColor>;
335
336        #[unsafe(method(systemGrayColor))]
337        #[unsafe(method_family = none)]
338        pub unsafe fn systemGrayColor() -> Retained<UIColor>;
339
340        #[unsafe(method(systemGray2Color))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn systemGray2Color() -> Retained<UIColor>;
343
344        #[unsafe(method(systemGray3Color))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn systemGray3Color() -> Retained<UIColor>;
347
348        #[unsafe(method(systemGray4Color))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn systemGray4Color() -> Retained<UIColor>;
351
352        #[unsafe(method(systemGray5Color))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn systemGray5Color() -> Retained<UIColor>;
355
356        #[unsafe(method(systemGray6Color))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn systemGray6Color() -> Retained<UIColor>;
359
360        #[unsafe(method(tintColor))]
361        #[unsafe(method_family = none)]
362        pub unsafe fn tintColor() -> Retained<UIColor>;
363
364        #[unsafe(method(labelColor))]
365        #[unsafe(method_family = none)]
366        pub unsafe fn labelColor() -> Retained<UIColor>;
367
368        #[unsafe(method(secondaryLabelColor))]
369        #[unsafe(method_family = none)]
370        pub unsafe fn secondaryLabelColor() -> Retained<UIColor>;
371
372        #[unsafe(method(tertiaryLabelColor))]
373        #[unsafe(method_family = none)]
374        pub unsafe fn tertiaryLabelColor() -> Retained<UIColor>;
375
376        #[unsafe(method(quaternaryLabelColor))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn quaternaryLabelColor() -> Retained<UIColor>;
379
380        #[unsafe(method(linkColor))]
381        #[unsafe(method_family = none)]
382        pub unsafe fn linkColor() -> Retained<UIColor>;
383
384        #[unsafe(method(placeholderTextColor))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn placeholderTextColor() -> Retained<UIColor>;
387
388        #[unsafe(method(separatorColor))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn separatorColor() -> Retained<UIColor>;
391
392        #[unsafe(method(opaqueSeparatorColor))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn opaqueSeparatorColor() -> Retained<UIColor>;
395
396        #[unsafe(method(systemBackgroundColor))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn systemBackgroundColor() -> Retained<UIColor>;
399
400        #[unsafe(method(secondarySystemBackgroundColor))]
401        #[unsafe(method_family = none)]
402        pub unsafe fn secondarySystemBackgroundColor() -> Retained<UIColor>;
403
404        #[unsafe(method(tertiarySystemBackgroundColor))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn tertiarySystemBackgroundColor() -> Retained<UIColor>;
407
408        #[unsafe(method(systemGroupedBackgroundColor))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn systemGroupedBackgroundColor() -> Retained<UIColor>;
411
412        #[unsafe(method(secondarySystemGroupedBackgroundColor))]
413        #[unsafe(method_family = none)]
414        pub unsafe fn secondarySystemGroupedBackgroundColor() -> Retained<UIColor>;
415
416        #[unsafe(method(tertiarySystemGroupedBackgroundColor))]
417        #[unsafe(method_family = none)]
418        pub unsafe fn tertiarySystemGroupedBackgroundColor() -> Retained<UIColor>;
419
420        #[unsafe(method(systemFillColor))]
421        #[unsafe(method_family = none)]
422        pub unsafe fn systemFillColor() -> Retained<UIColor>;
423
424        #[unsafe(method(secondarySystemFillColor))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn secondarySystemFillColor() -> Retained<UIColor>;
427
428        #[unsafe(method(tertiarySystemFillColor))]
429        #[unsafe(method_family = none)]
430        pub unsafe fn tertiarySystemFillColor() -> Retained<UIColor>;
431
432        #[unsafe(method(quaternarySystemFillColor))]
433        #[unsafe(method_family = none)]
434        pub unsafe fn quaternarySystemFillColor() -> Retained<UIColor>;
435
436        #[unsafe(method(lightTextColor))]
437        #[unsafe(method_family = none)]
438        pub unsafe fn lightTextColor() -> Retained<UIColor>;
439
440        #[unsafe(method(darkTextColor))]
441        #[unsafe(method_family = none)]
442        pub unsafe fn darkTextColor() -> Retained<UIColor>;
443
444        #[deprecated]
445        #[unsafe(method(groupTableViewBackgroundColor))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn groupTableViewBackgroundColor() -> Retained<UIColor>;
448
449        #[deprecated]
450        #[unsafe(method(viewFlipsideBackgroundColor))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn viewFlipsideBackgroundColor() -> Retained<UIColor>;
453
454        #[deprecated]
455        #[unsafe(method(scrollViewTexturedBackgroundColor))]
456        #[unsafe(method_family = none)]
457        pub unsafe fn scrollViewTexturedBackgroundColor() -> Retained<UIColor>;
458
459        #[deprecated]
460        #[unsafe(method(underPageBackgroundColor))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn underPageBackgroundColor() -> Retained<UIColor>;
463    );
464}
465
466/// UIFontSystemFonts.
467#[cfg(feature = "UIFont")]
468impl UIFont {
469    extern_methods!(
470        #[cfg(feature = "objc2-core-foundation")]
471        #[unsafe(method(labelFontSize))]
472        #[unsafe(method_family = none)]
473        pub unsafe fn labelFontSize() -> CGFloat;
474
475        #[cfg(feature = "objc2-core-foundation")]
476        #[unsafe(method(buttonFontSize))]
477        #[unsafe(method_family = none)]
478        pub unsafe fn buttonFontSize() -> CGFloat;
479
480        #[cfg(feature = "objc2-core-foundation")]
481        #[unsafe(method(smallSystemFontSize))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn smallSystemFontSize() -> CGFloat;
484
485        #[cfg(feature = "objc2-core-foundation")]
486        #[unsafe(method(systemFontSize))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn systemFontSize() -> CGFloat;
489
490        #[cfg(feature = "objc2-core-foundation")]
491        #[unsafe(method(defaultFontSize))]
492        #[unsafe(method_family = none)]
493        pub unsafe fn defaultFontSize() -> CGFloat;
494
495        #[cfg(feature = "objc2-core-foundation")]
496        #[unsafe(method(systemMinimumFontSize))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn systemMinimumFontSize() -> CGFloat;
499    );
500}