//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uisplitviewcontrollerlayoutenvironment?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UISplitViewControllerLayoutEnvironment(pub NSInteger);
impl UISplitViewControllerLayoutEnvironment {
    /// There is no containing split view controller.
    #[doc(alias = "UISplitViewControllerLayoutEnvironmentNone")]
    pub const None: Self = Self(0);
    /// Contained within an expanded split view controller.
    #[doc(alias = "UISplitViewControllerLayoutEnvironmentExpanded")]
    pub const Expanded: Self = Self(1);
    /// Contained within a collapsed split view controller.
    #[doc(alias = "UISplitViewControllerLayoutEnvironmentCollapsed")]
    pub const Collapsed: Self = Self(2);
}

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

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

extern_class!(
    /// A trait that specifies whether an ancestor split view controller, if any, is expanded or collapsed.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/uikit/uitraitsplitviewcontrollerlayoutenvironment?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct UITraitSplitViewControllerLayoutEnvironment;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for UITraitSplitViewControllerLayoutEnvironment {}
);

#[cfg(feature = "UITrait")]
extern_conformance!(
    unsafe impl UINSIntegerTraitDefinition for UITraitSplitViewControllerLayoutEnvironment {}
);

#[cfg(feature = "UITrait")]
extern_conformance!(
    unsafe impl UITraitDefinition for UITraitSplitViewControllerLayoutEnvironment {}
);

impl UITraitSplitViewControllerLayoutEnvironment {
    extern_methods!();
}

/// Methods declared on superclass `NSObject`.
impl UITraitSplitViewControllerLayoutEnvironment {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
