//! 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"))]
extern_conformance!(
    unsafe impl NSAccessibility for NSBrowserCell {}
);

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

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

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

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

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

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

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

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

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[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 fn branchImage(mtm: MainThreadMarker) -> Option<Retained<NSImage>>;

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

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

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

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

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

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

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

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

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

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

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

        #[cfg(feature = "NSImage")]
        /// Setter for [`alternateImage`][Self::alternateImage].
        #[unsafe(method(setAlternateImage:))]
        #[unsafe(method_family = none)]
        pub 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 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 fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}
