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

#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
unsafe impl NSAccessibility for NSBrowserCell {}

#[cfg(all(feature = "NSAccessibilityProtocols", feature = "NSCell"))]
unsafe impl NSAccessibilityElementProtocol for NSBrowserCell {}

#[cfg(feature = "NSCell")]
unsafe impl NSCoding for NSBrowserCell {}

#[cfg(feature = "NSCell")]
unsafe impl NSCopying for NSBrowserCell {}

#[cfg(feature = "NSCell")]
unsafe impl CopyingHelper for NSBrowserCell {
    type Result = Self;
}

#[cfg(feature = "NSCell")]
unsafe impl NSObjectProtocol for NSBrowserCell {}

#[cfg(all(feature = "NSCell", feature = "NSUserInterfaceItemIdentification"))]
unsafe impl NSUserInterfaceItemIdentification for NSBrowserCell {}

#[cfg(feature = "NSCell")]
impl NSBrowserCell {
    extern_methods!(
        #[unsafe(method(initTextCell:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initTextCell(this: Allocated<Self>, string: &NSString) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(initImageCell:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initImageCell(
            this: Allocated<Self>,
            image: Option<&NSImage>,
        ) -> Retained<Self>;

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

        #[cfg(feature = "NSImage")]
        #[unsafe(method(branchImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn branchImage(mtm: MainThreadMarker) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[unsafe(method(highlightedBranchImage))]
        #[unsafe(method_family = none)]
        pub unsafe fn highlightedBranchImage(mtm: MainThreadMarker) -> Option<Retained<NSImage>>;

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

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

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

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

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

        #[unsafe(method(reset))]
        #[unsafe(method_family = none)]
        pub unsafe fn reset(&self);

        #[unsafe(method(set))]
        #[unsafe(method_family = none)]
        pub unsafe fn set(&self);

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

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

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

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

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

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