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
37// TODO: pub fn UIDeviceOrientationIsPortrait(orientation: UIDeviceOrientation,) -> Bool;
38
39// TODO: pub fn UIDeviceOrientationIsLandscape(orientation: UIDeviceOrientation,) -> Bool;
40
41// TODO: pub fn UIDeviceOrientationIsFlat(orientation: UIDeviceOrientation,) -> Bool;
42
43// TODO: pub fn UIDeviceOrientationIsValidInterfaceOrientation(orientation: UIDeviceOrientation,) -> Bool;
44
45/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientation?language=objc)
46// NS_ENUM
47#[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/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask?language=objc)
72// NS_OPTIONS
73#[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// TODO: pub fn UIInterfaceOrientationIsPortrait(orientation: UIInterfaceOrientation,) -> Bool;
104
105// TODO: pub fn UIInterfaceOrientationIsLandscape(orientation: UIInterfaceOrientation,) -> Bool;