objc2-app-kit 0.2.2

Bindings to the AppKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(feature = "NSCell")]
    pub struct NSBrowserCell;

    #[cfg(feature = "NSCell")]
    unsafe impl ClassType for NSBrowserCell {
        #[inherits(NSObject)]
        type Super = NSCell;
        type Mutability = MainThreadOnly;
    }
);

#[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 NSObjectProtocol for NSBrowserCell {}

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

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

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Init initImageCell:)]
        pub unsafe fn initImageCell(
            this: Allocated<Self>,
            image: Option<&NSImage>,
        ) -> Retained<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other branchImage)]
        pub unsafe fn branchImage(mtm: MainThreadMarker) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other highlightedBranchImage)]
        pub unsafe fn highlightedBranchImage(mtm: MainThreadMarker) -> Option<Retained<NSImage>>;

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

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

        #[method(setLeaf:)]
        pub unsafe fn setLeaf(&self, leaf: bool);

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

        #[method(setLoaded:)]
        pub unsafe fn setLoaded(&self, loaded: bool);

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

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

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other image)]
        pub unsafe fn image(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[method(setImage:)]
        pub unsafe fn setImage(&self, image: Option<&NSImage>);

        #[cfg(feature = "NSImage")]
        #[method_id(@__retain_semantics Other alternateImage)]
        pub unsafe fn alternateImage(&self) -> Option<Retained<NSImage>>;

        #[cfg(feature = "NSImage")]
        #[method(setAlternateImage:)]
        pub unsafe fn setAlternateImage(&self, alternate_image: Option<&NSImage>);
    }
);

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

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