objc2_ui_kit/generated/
UIOrientation.rs1use objc2::__framework_prelude::*;
4
5use crate::*;
6
7#[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
37#[repr(transparent)]
48#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
49pub struct UIInterfaceOrientation(pub NSInteger);
50impl UIInterfaceOrientation {
51 #[doc(alias = "UIInterfaceOrientationUnknown")]
52 pub const Unknown: Self = Self(UIDeviceOrientation::Unknown.0);
53 #[doc(alias = "UIInterfaceOrientationPortrait")]
54 pub const Portrait: Self = Self(UIDeviceOrientation::Portrait.0);
55 #[doc(alias = "UIInterfaceOrientationPortraitUpsideDown")]
56 pub const PortraitUpsideDown: Self = Self(UIDeviceOrientation::PortraitUpsideDown.0);
57 #[doc(alias = "UIInterfaceOrientationLandscapeLeft")]
58 pub const LandscapeLeft: Self = Self(UIDeviceOrientation::LandscapeRight.0);
59 #[doc(alias = "UIInterfaceOrientationLandscapeRight")]
60 pub const LandscapeRight: Self = Self(UIDeviceOrientation::LandscapeLeft.0);
61}
62
63unsafe impl Encode for UIInterfaceOrientation {
64 const ENCODING: Encoding = NSInteger::ENCODING;
65}
66
67unsafe impl RefEncode for UIInterfaceOrientation {
68 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
69}
70
71#[repr(transparent)]
74#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
75pub struct UIInterfaceOrientationMask(pub NSUInteger);
76bitflags::bitflags! {
77 impl UIInterfaceOrientationMask: NSUInteger {
78 #[doc(alias = "UIInterfaceOrientationMaskPortrait")]
79 const Portrait = 1<<UIInterfaceOrientation::Portrait.0;
80 #[doc(alias = "UIInterfaceOrientationMaskLandscapeLeft")]
81 const LandscapeLeft = 1<<UIInterfaceOrientation::LandscapeLeft.0;
82 #[doc(alias = "UIInterfaceOrientationMaskLandscapeRight")]
83 const LandscapeRight = 1<<UIInterfaceOrientation::LandscapeRight.0;
84 #[doc(alias = "UIInterfaceOrientationMaskPortraitUpsideDown")]
85 const PortraitUpsideDown = 1<<UIInterfaceOrientation::PortraitUpsideDown.0;
86 #[doc(alias = "UIInterfaceOrientationMaskLandscape")]
87 const Landscape = UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
88 #[doc(alias = "UIInterfaceOrientationMaskAll")]
89 const All = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0|UIInterfaceOrientationMask::PortraitUpsideDown.0;
90 #[doc(alias = "UIInterfaceOrientationMaskAllButUpsideDown")]
91 const AllButUpsideDown = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
92 }
93}
94
95unsafe impl Encode for UIInterfaceOrientationMask {
96 const ENCODING: Encoding = NSUInteger::ENCODING;
97}
98
99unsafe impl RefEncode for UIInterfaceOrientationMask {
100 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
101}
102
103