objc2_ui_kit/generated/
UIOrientation.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uideviceorientation?language=objc)
8// NS_ENUM
9#[repr(transparent)]
10#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
11pub struct UIDeviceOrientation(pub NSInteger);
12impl UIDeviceOrientation {
13    #[doc(alias = "UIDeviceOrientationUnknown")]
14    pub const Unknown: Self = Self(0);
15    #[doc(alias = "UIDeviceOrientationPortrait")]
16    pub const Portrait: Self = Self(1);
17    #[doc(alias = "UIDeviceOrientationPortraitUpsideDown")]
18    pub const PortraitUpsideDown: Self = Self(2);
19    #[doc(alias = "UIDeviceOrientationLandscapeLeft")]
20    pub const LandscapeLeft: Self = Self(3);
21    #[doc(alias = "UIDeviceOrientationLandscapeRight")]
22    pub const LandscapeRight: Self = Self(4);
23    #[doc(alias = "UIDeviceOrientationFaceUp")]
24    pub const FaceUp: Self = Self(5);
25    #[doc(alias = "UIDeviceOrientationFaceDown")]
26    pub const FaceDown: Self = Self(6);
27}
28
29unsafe impl Encode for UIDeviceOrientation {
30    const ENCODING: Encoding = NSInteger::ENCODING;
31}
32
33unsafe impl RefEncode for UIDeviceOrientation {
34    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
35}
36
37impl UIDeviceOrientation {
38    // TODO: pub fn UIDeviceOrientationIsPortrait(orientation: UIDeviceOrientation,) -> Bool;
39
40    // TODO: pub fn UIDeviceOrientationIsLandscape(orientation: UIDeviceOrientation,) -> Bool;
41
42    // TODO: pub fn UIDeviceOrientationIsFlat(orientation: UIDeviceOrientation,) -> Bool;
43
44    // TODO: pub fn UIDeviceOrientationIsValidInterfaceOrientation(orientation: UIDeviceOrientation,) -> Bool;
45}
46
47/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientation?language=objc)
48// NS_ENUM
49#[repr(transparent)]
50#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
51pub struct UIInterfaceOrientation(pub NSInteger);
52impl UIInterfaceOrientation {
53    #[doc(alias = "UIInterfaceOrientationUnknown")]
54    pub const Unknown: Self = Self(UIDeviceOrientation::Unknown.0);
55    #[doc(alias = "UIInterfaceOrientationPortrait")]
56    pub const Portrait: Self = Self(UIDeviceOrientation::Portrait.0);
57    #[doc(alias = "UIInterfaceOrientationPortraitUpsideDown")]
58    pub const PortraitUpsideDown: Self = Self(UIDeviceOrientation::PortraitUpsideDown.0);
59    #[doc(alias = "UIInterfaceOrientationLandscapeLeft")]
60    pub const LandscapeLeft: Self = Self(UIDeviceOrientation::LandscapeRight.0);
61    #[doc(alias = "UIInterfaceOrientationLandscapeRight")]
62    pub const LandscapeRight: Self = Self(UIDeviceOrientation::LandscapeLeft.0);
63}
64
65unsafe impl Encode for UIInterfaceOrientation {
66    const ENCODING: Encoding = NSInteger::ENCODING;
67}
68
69unsafe impl RefEncode for UIInterfaceOrientation {
70    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
71}
72
73/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask?language=objc)
74// NS_OPTIONS
75#[repr(transparent)]
76#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
77pub struct UIInterfaceOrientationMask(pub NSUInteger);
78bitflags::bitflags! {
79    impl UIInterfaceOrientationMask: NSUInteger {
80        #[doc(alias = "UIInterfaceOrientationMaskPortrait")]
81        const Portrait = 1<<UIInterfaceOrientation::Portrait.0;
82        #[doc(alias = "UIInterfaceOrientationMaskLandscapeLeft")]
83        const LandscapeLeft = 1<<UIInterfaceOrientation::LandscapeLeft.0;
84        #[doc(alias = "UIInterfaceOrientationMaskLandscapeRight")]
85        const LandscapeRight = 1<<UIInterfaceOrientation::LandscapeRight.0;
86        #[doc(alias = "UIInterfaceOrientationMaskPortraitUpsideDown")]
87        const PortraitUpsideDown = 1<<UIInterfaceOrientation::PortraitUpsideDown.0;
88        #[doc(alias = "UIInterfaceOrientationMaskLandscape")]
89        const Landscape = UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
90        #[doc(alias = "UIInterfaceOrientationMaskAll")]
91        const All = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0|UIInterfaceOrientationMask::PortraitUpsideDown.0;
92        #[doc(alias = "UIInterfaceOrientationMaskAllButUpsideDown")]
93        const AllButUpsideDown = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
94    }
95}
96
97unsafe impl Encode for UIInterfaceOrientationMask {
98    const ENCODING: Encoding = NSUInteger::ENCODING;
99}
100
101unsafe impl RefEncode for UIInterfaceOrientationMask {
102    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
103}
104
105impl UIInterfaceOrientation {
106    // TODO: pub fn UIInterfaceOrientationIsPortrait(orientation: UIInterfaceOrientation,) -> Bool;
107
108    // TODO: pub fn UIInterfaceOrientationIsLandscape(orientation: UIInterfaceOrientation,) -> Bool;
109}