//! 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/uibarmetrics?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarMetrics(pub NSInteger);
impl UIBarMetrics {
    #[doc(alias = "UIBarMetricsDefault")]
    pub const Default: Self = Self(0);
    #[doc(alias = "UIBarMetricsCompact")]
    pub const Compact: Self = Self(1);
    #[doc(alias = "UIBarMetricsDefaultPrompt")]
    pub const DefaultPrompt: Self = Self(101);
    #[doc(alias = "UIBarMetricsCompactPrompt")]
    pub const CompactPrompt: Self = Self(102);
    #[doc(alias = "UIBarMetricsLandscapePhone")]
    #[deprecated]
    pub const LandscapePhone: Self = Self(UIBarMetrics::Compact.0);
    #[doc(alias = "UIBarMetricsLandscapePhonePrompt")]
    #[deprecated]
    pub const LandscapePhonePrompt: Self = Self(UIBarMetrics::CompactPrompt.0);
}

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

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

/// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibarposition?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct UIBarPosition(pub NSInteger);
impl UIBarPosition {
    #[doc(alias = "UIBarPositionAny")]
    pub const Any: Self = Self(0);
    #[doc(alias = "UIBarPositionBottom")]
    pub const Bottom: Self = Self(1);
    #[doc(alias = "UIBarPositionTop")]
    pub const Top: Self = Self(2);
    #[doc(alias = "UIBarPositionTopAttached")]
    pub const TopAttached: Self = Self(3);
}

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibarpositioning?language=objc)
    pub unsafe trait UIBarPositioning: NSObjectProtocol + MainThreadOnly {
        #[unsafe(method(barPosition))]
        #[unsafe(method_family = none)]
        fn barPosition(&self) -> UIBarPosition;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/uikit/uibarpositioningdelegate?language=objc)
    pub unsafe trait UIBarPositioningDelegate: NSObjectProtocol + MainThreadOnly {
        #[optional]
        #[unsafe(method(positionForBar:))]
        #[unsafe(method_family = none)]
        fn positionForBar(&self, bar: &ProtocolObject<dyn UIBarPositioning>) -> UIBarPosition;
    }
);
