objc2-ui-kit 0.3.2

Bindings to the UIKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uideviceorientation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIDeviceOrientation(pub NSInteger);
impl UIDeviceOrientation {
    #[doc(alias = "UIDeviceOrientationUnknown")]
    pub const Unknown: Self = Self(0);
    #[doc(alias = "UIDeviceOrientationPortrait")]
    pub const Portrait: Self = Self(1);
    #[doc(alias = "UIDeviceOrientationPortraitUpsideDown")]
    pub const PortraitUpsideDown: Self = Self(2);
    #[doc(alias = "UIDeviceOrientationLandscapeLeft")]
    pub const LandscapeLeft: Self = Self(3);
    #[doc(alias = "UIDeviceOrientationLandscapeRight")]
    pub const LandscapeRight: Self = Self(4);
    #[doc(alias = "UIDeviceOrientationFaceUp")]
    pub const FaceUp: Self = Self(5);
    #[doc(alias = "UIDeviceOrientationFaceDown")]
    pub const FaceDown: Self = Self(6);
}

unsafe impl Encode for UIDeviceOrientation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIDeviceOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

impl UIDeviceOrientation {
    // TODO: pub fn UIDeviceOrientationIsPortrait(orientation: UIDeviceOrientation,) -> Bool;

    // TODO: pub fn UIDeviceOrientationIsLandscape(orientation: UIDeviceOrientation,) -> Bool;

    // TODO: pub fn UIDeviceOrientationIsFlat(orientation: UIDeviceOrientation,) -> Bool;

    // TODO: pub fn UIDeviceOrientationIsValidInterfaceOrientation(orientation: UIDeviceOrientation,) -> Bool;
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientation?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIInterfaceOrientation(pub NSInteger);
impl UIInterfaceOrientation {
    #[doc(alias = "UIInterfaceOrientationUnknown")]
    pub const Unknown: Self = Self(UIDeviceOrientation::Unknown.0);
    #[doc(alias = "UIInterfaceOrientationPortrait")]
    pub const Portrait: Self = Self(UIDeviceOrientation::Portrait.0);
    #[doc(alias = "UIInterfaceOrientationPortraitUpsideDown")]
    pub const PortraitUpsideDown: Self = Self(UIDeviceOrientation::PortraitUpsideDown.0);
    #[doc(alias = "UIInterfaceOrientationLandscapeLeft")]
    pub const LandscapeLeft: Self = Self(UIDeviceOrientation::LandscapeRight.0);
    #[doc(alias = "UIInterfaceOrientationLandscapeRight")]
    pub const LandscapeRight: Self = Self(UIDeviceOrientation::LandscapeLeft.0);
}

unsafe impl Encode for UIInterfaceOrientation {
    const ENCODING: Encoding = NSInteger::ENCODING;
}

unsafe impl RefEncode for UIInterfaceOrientation {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask?language=objc)
// NS_OPTIONS
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIInterfaceOrientationMask(pub NSUInteger);
bitflags::bitflags! {
    impl UIInterfaceOrientationMask: NSUInteger {
        #[doc(alias = "UIInterfaceOrientationMaskPortrait")]
        const Portrait = 1<<UIInterfaceOrientation::Portrait.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscapeLeft")]
        const LandscapeLeft = 1<<UIInterfaceOrientation::LandscapeLeft.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscapeRight")]
        const LandscapeRight = 1<<UIInterfaceOrientation::LandscapeRight.0;
        #[doc(alias = "UIInterfaceOrientationMaskPortraitUpsideDown")]
        const PortraitUpsideDown = 1<<UIInterfaceOrientation::PortraitUpsideDown.0;
        #[doc(alias = "UIInterfaceOrientationMaskLandscape")]
        const Landscape = UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
        #[doc(alias = "UIInterfaceOrientationMaskAll")]
        const All = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0|UIInterfaceOrientationMask::PortraitUpsideDown.0;
        #[doc(alias = "UIInterfaceOrientationMaskAllButUpsideDown")]
        const AllButUpsideDown = UIInterfaceOrientationMask::Portrait.0|UIInterfaceOrientationMask::LandscapeLeft.0|UIInterfaceOrientationMask::LandscapeRight.0;
    }
}

unsafe impl Encode for UIInterfaceOrientationMask {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for UIInterfaceOrientationMask {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

impl UIInterfaceOrientation {
    // TODO: pub fn UIInterfaceOrientationIsPortrait(orientation: UIInterfaceOrientation,) -> Bool;

    // TODO: pub fn UIInterfaceOrientationIsLandscape(orientation: UIInterfaceOrientation,) -> Bool;
}