//! 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::*;

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

#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
    unsafe impl NSCoding for NSCustomTouchBarItem {}
);

#[cfg(feature = "NSTouchBarItem")]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSCustomTouchBarItem {}
);

#[cfg(feature = "NSTouchBarItem")]
impl NSCustomTouchBarItem {
    extern_methods!(
        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        #[unsafe(method(view))]
        #[unsafe(method_family = none)]
        pub unsafe fn view(&self) -> Retained<NSView>;

        #[cfg(all(feature = "NSResponder", feature = "NSView"))]
        /// Setter for [`view`][Self::view].
        #[unsafe(method(setView:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setView(&self, view: &NSView);

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

        #[cfg(all(feature = "NSResponder", feature = "NSViewController"))]
        /// Setter for [`viewController`][Self::viewController].
        #[unsafe(method(setViewController:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setViewController(&self, view_controller: Option<&NSViewController>);

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

        /// Setter for [`customizationLabel`][Self::customizationLabel].
        #[unsafe(method(setCustomizationLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCustomizationLabel(&self, customization_label: Option<&NSString>);
    );
}

/// Methods declared on superclass `NSTouchBarItem`.
#[cfg(feature = "NSTouchBarItem")]
impl NSCustomTouchBarItem {
    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>;
    );
}

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