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

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifier?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTouchBarItemIdentifier = NSString;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritempriority?language=objc)
// NS_TYPED_EXTENSIBLE_ENUM
pub type NSTouchBarItemPriority = c_float;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritempriorityhigh?language=objc)
pub static NSTouchBarItemPriorityHigh: NSTouchBarItemPriority = 1000 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemprioritynormal?language=objc)
pub static NSTouchBarItemPriorityNormal: NSTouchBarItemPriority = 0 as _;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemprioritylow?language=objc)
pub static NSTouchBarItemPriorityLow: NSTouchBarItemPriority = -1000 as _;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritem?language=objc)
    #[unsafe(super(NSObject))]
    #[thread_kind = MainThreadOnly]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSTouchBarItem;
);

unsafe impl NSCoding for NSTouchBarItem {}

unsafe impl NSObjectProtocol for NSTouchBarItem {}

impl NSTouchBarItem {
    extern_methods!(
        #[unsafe(method(initWithIdentifier:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithIdentifier(
            this: Allocated<Self>,
            identifier: &NSTouchBarItemIdentifier,
        ) -> Retained<Self>;

        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(identifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn identifier(&self) -> Retained<NSTouchBarItemIdentifier>;

        #[unsafe(method(visibilityPriority))]
        #[unsafe(method_family = none)]
        pub unsafe fn visibilityPriority(&self) -> NSTouchBarItemPriority;

        /// Setter for [`visibilityPriority`][Self::visibilityPriority].
        #[unsafe(method(setVisibilityPriority:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setVisibilityPriority(&self, visibility_priority: NSTouchBarItemPriority);

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(view))]
        #[unsafe(method_family = none)]
        pub unsafe fn view(&self) -> Option<Retained<NSView>>;

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        #[unsafe(method(viewController))]
        #[unsafe(method_family = none)]
        pub unsafe fn viewController(&self) -> Option<Retained<NSViewController>>;

        #[unsafe(method(customizationLabel))]
        #[unsafe(method_family = none)]
        pub unsafe fn customizationLabel(&self) -> Retained<NSString>;

        #[unsafe(method(isVisible))]
        #[unsafe(method_family = none)]
        pub unsafe fn isVisible(&self) -> bool;
    );
}

/// Methods declared on superclass `NSObject`.
impl NSTouchBarItem {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifierfixedspacesmall?language=objc)
    pub static NSTouchBarItemIdentifierFixedSpaceSmall: &'static NSTouchBarItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifierfixedspacelarge?language=objc)
    pub static NSTouchBarItemIdentifierFixedSpaceLarge: &'static NSTouchBarItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifierflexiblespace?language=objc)
    pub static NSTouchBarItemIdentifierFlexibleSpace: &'static NSTouchBarItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstouchbaritemidentifierotheritemsproxy?language=objc)
    pub static NSTouchBarItemIdentifierOtherItemsProxy: &'static NSTouchBarItemIdentifier;
}
