//! 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/nspopovertouchbaritem?language=objc)
    #[unsafe(super(NSTouchBarItem, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSTouchBarItem")]
    pub struct NSPopoverTouchBarItem;
);

#[cfg(feature = "NSTouchBarItem")]
unsafe impl NSCoding for NSPopoverTouchBarItem {}

#[cfg(feature = "NSTouchBarItem")]
unsafe impl NSObjectProtocol for NSPopoverTouchBarItem {}

#[cfg(feature = "NSTouchBarItem")]
impl NSPopoverTouchBarItem {
    extern_methods!(
        #[cfg(feature = "NSTouchBar")]
        #[unsafe(method(popoverTouchBar))]
        #[unsafe(method_family = none)]
        pub unsafe fn popoverTouchBar(&self) -> Retained<NSTouchBar>;

        #[cfg(feature = "NSTouchBar")]
        /// Setter for [`popoverTouchBar`][Self::popoverTouchBar].
        #[unsafe(method(setPopoverTouchBar:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPopoverTouchBar(&self, popover_touch_bar: &NSTouchBar);

        #[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>);

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

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

        #[cfg(feature = "NSImage")]
        #[unsafe(method(collapsedRepresentationImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn collapsedRepresentationImage(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        /// Setter for [`collapsedRepresentationImage`][Self::collapsedRepresentationImage].
        #[unsafe(method(setCollapsedRepresentationImage:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCollapsedRepresentationImage(
            &self,
            collapsed_representation_image: Option<&NSImage>,
        );

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

        /// Setter for [`collapsedRepresentationLabel`][Self::collapsedRepresentationLabel].
        #[unsafe(method(setCollapsedRepresentationLabel:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCollapsedRepresentationLabel(
            &self,
            collapsed_representation_label: &NSString,
        );

        #[cfg(feature = "NSTouchBar")]
        #[unsafe(method(pressAndHoldTouchBar))]
        #[unsafe(method_family = none)]
        pub unsafe fn pressAndHoldTouchBar(&self) -> Option<Retained<NSTouchBar>>;

        #[cfg(feature = "NSTouchBar")]
        /// Setter for [`pressAndHoldTouchBar`][Self::pressAndHoldTouchBar].
        #[unsafe(method(setPressAndHoldTouchBar:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setPressAndHoldTouchBar(&self, press_and_hold_touch_bar: Option<&NSTouchBar>);

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

        /// Setter for [`showsCloseButton`][Self::showsCloseButton].
        #[unsafe(method(setShowsCloseButton:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShowsCloseButton(&self, shows_close_button: bool);

        #[unsafe(method(showPopover:))]
        #[unsafe(method_family = none)]
        pub unsafe fn showPopover(&self, sender: Option<&AnyObject>);

        #[unsafe(method(dismissPopover:))]
        #[unsafe(method_family = none)]
        pub unsafe fn dismissPopover(&self, sender: Option<&AnyObject>);

        #[cfg(feature = "NSGestureRecognizer")]
        #[unsafe(method(makeStandardActivatePopoverGestureRecognizer))]
        #[unsafe(method_family = none)]
        pub unsafe fn makeStandardActivatePopoverGestureRecognizer(
            &self,
        ) -> Retained<NSGestureRecognizer>;
    );
}

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