//! 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::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewdroponitemindex?language=objc)
pub const NSOutlineViewDropOnItemIndex: c_int = -1;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineview?language=objc)
    #[unsafe(super(NSTableView, NSControl, NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(
        feature = "NSControl",
        feature = "NSResponder",
        feature = "NSTableView",
        feature = "NSView"
    ))]
    pub struct NSOutlineView;
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibility for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityGroup for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityOutline for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAccessibilityTable for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for NSOutlineView {}
);

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSAppearanceCustomization for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSCoding for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSDraggingDestination for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSDraggingSource for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSObjectProtocol for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSText",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSTextDelegate for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSText",
    feature = "NSTextView",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSTextViewDelegate for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSUserInterfaceValidation",
    feature = "NSView"
))]
extern_conformance!(
    unsafe impl NSUserInterfaceValidations for NSOutlineView {}
);

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
impl NSOutlineView {
    extern_methods!(
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn NSOutlineViewDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(
            &self,
            delegate: Option<&ProtocolObject<dyn NSOutlineViewDelegate>>,
        );

        #[unsafe(method(dataSource))]
        #[unsafe(method_family = none)]
        pub unsafe fn dataSource(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn NSOutlineViewDataSource>>>;

        /// Setter for [`dataSource`][Self::dataSource].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        #[unsafe(method(setDataSource:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDataSource(
            &self,
            data_source: Option<&ProtocolObject<dyn NSOutlineViewDataSource>>,
        );

        #[cfg(feature = "NSTableColumn")]
        /// # Safety
        ///
        /// This is not retained internally, you must ensure the object is still alive.
        #[unsafe(method(outlineTableColumn))]
        #[unsafe(method_family = none)]
        pub unsafe fn outlineTableColumn(&self) -> Option<Retained<NSTableColumn>>;

        #[cfg(feature = "NSTableColumn")]
        /// Setter for [`outlineTableColumn`][Self::outlineTableColumn].
        ///
        /// # Safety
        ///
        /// This is unretained, you must ensure the object is kept alive while in use.
        #[unsafe(method(setOutlineTableColumn:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setOutlineTableColumn(&self, outline_table_column: Option<&NSTableColumn>);

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(isExpandable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isExpandable(&self, item: Option<&AnyObject>) -> bool;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(numberOfChildrenOfItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn numberOfChildrenOfItem(&self, item: Option<&AnyObject>) -> NSInteger;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(child:ofItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn child_ofItem(
            &self,
            index: NSInteger,
            item: Option<&AnyObject>,
        ) -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(expandItem:expandChildren:))]
        #[unsafe(method_family = none)]
        pub unsafe fn expandItem_expandChildren(
            &self,
            item: Option<&AnyObject>,
            expand_children: bool,
        );

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(expandItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn expandItem(&self, item: Option<&AnyObject>);

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(collapseItem:collapseChildren:))]
        #[unsafe(method_family = none)]
        pub unsafe fn collapseItem_collapseChildren(
            &self,
            item: Option<&AnyObject>,
            collapse_children: bool,
        );

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(collapseItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn collapseItem(&self, item: Option<&AnyObject>);

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(reloadItem:reloadChildren:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadItem_reloadChildren(
            &self,
            item: Option<&AnyObject>,
            reload_children: bool,
        );

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(reloadItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn reloadItem(&self, item: Option<&AnyObject>);

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(parentForItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn parentForItem(&self, item: Option<&AnyObject>)
            -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(childIndexForItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn childIndexForItem(&self, item: &AnyObject) -> NSInteger;

        #[unsafe(method(itemAtRow:))]
        #[unsafe(method_family = none)]
        pub fn itemAtRow(&self, row: NSInteger) -> Option<Retained<AnyObject>>;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(rowForItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn rowForItem(&self, item: Option<&AnyObject>) -> NSInteger;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(levelForItem:))]
        #[unsafe(method_family = none)]
        pub unsafe fn levelForItem(&self, item: Option<&AnyObject>) -> NSInteger;

        #[unsafe(method(levelForRow:))]
        #[unsafe(method_family = none)]
        pub fn levelForRow(&self, row: NSInteger) -> NSInteger;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(isItemExpanded:))]
        #[unsafe(method_family = none)]
        pub unsafe fn isItemExpanded(&self, item: Option<&AnyObject>) -> bool;

        #[cfg(feature = "objc2-core-foundation")]
        #[unsafe(method(indentationPerLevel))]
        #[unsafe(method_family = none)]
        pub fn indentationPerLevel(&self) -> CGFloat;

        #[cfg(feature = "objc2-core-foundation")]
        /// Setter for [`indentationPerLevel`][Self::indentationPerLevel].
        #[unsafe(method(setIndentationPerLevel:))]
        #[unsafe(method_family = none)]
        pub fn setIndentationPerLevel(&self, indentation_per_level: CGFloat);

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

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

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

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

        #[unsafe(method(frameOfOutlineCellAtRow:))]
        #[unsafe(method_family = none)]
        pub fn frameOfOutlineCellAtRow(&self, row: NSInteger) -> NSRect;

        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[unsafe(method(setDropItem:dropChildIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDropItem_dropChildIndex(&self, item: Option<&AnyObject>, index: NSInteger);

        #[unsafe(method(shouldCollapseAutoExpandedItemsForDeposited:))]
        #[unsafe(method_family = none)]
        pub fn shouldCollapseAutoExpandedItemsForDeposited(&self, deposited: bool) -> bool;

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

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

        /// # Safety
        ///
        /// `parent` should be of the correct type.
        #[unsafe(method(insertItemsAtIndexes:inParent:withAnimation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertItemsAtIndexes_inParent_withAnimation(
            &self,
            indexes: &NSIndexSet,
            parent: Option<&AnyObject>,
            animation_options: NSTableViewAnimationOptions,
        );

        /// # Safety
        ///
        /// `parent` should be of the correct type.
        #[unsafe(method(removeItemsAtIndexes:inParent:withAnimation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeItemsAtIndexes_inParent_withAnimation(
            &self,
            indexes: &NSIndexSet,
            parent: Option<&AnyObject>,
            animation_options: NSTableViewAnimationOptions,
        );

        /// # Safety
        ///
        /// - `old_parent` should be of the correct type.
        /// - `new_parent` should be of the correct type.
        #[unsafe(method(moveItemAtIndex:inParent:toIndex:inParent:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveItemAtIndex_inParent_toIndex_inParent(
            &self,
            from_index: NSInteger,
            old_parent: Option<&AnyObject>,
            to_index: NSInteger,
            new_parent: Option<&AnyObject>,
        );

        #[unsafe(method(insertRowsAtIndexes:withAnimation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertRowsAtIndexes_withAnimation(
            &self,
            indexes: &NSIndexSet,
            animation_options: NSTableViewAnimationOptions,
        );

        #[unsafe(method(removeRowsAtIndexes:withAnimation:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeRowsAtIndexes_withAnimation(
            &self,
            indexes: &NSIndexSet,
            animation_options: NSTableViewAnimationOptions,
        );

        #[unsafe(method(moveRowAtIndex:toIndex:))]
        #[unsafe(method_family = none)]
        pub unsafe fn moveRowAtIndex_toIndex(&self, old_index: NSInteger, new_index: NSInteger);

        #[cfg(feature = "NSUserInterfaceLayout")]
        #[unsafe(method(userInterfaceLayoutDirection))]
        #[unsafe(method_family = none)]
        pub fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;

        #[cfg(feature = "NSUserInterfaceLayout")]
        /// Setter for [`userInterfaceLayoutDirection`][Self::userInterfaceLayoutDirection].
        #[unsafe(method(setUserInterfaceLayoutDirection:))]
        #[unsafe(method_family = none)]
        pub fn setUserInterfaceLayoutDirection(
            &self,
            user_interface_layout_direction: NSUserInterfaceLayoutDirection,
        );

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

        /// Setter for [`stronglyReferencesItems`][Self::stronglyReferencesItems].
        #[unsafe(method(setStronglyReferencesItems:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setStronglyReferencesItems(&self, strongly_references_items: bool);
    );
}

/// Methods declared on superclass `NSTableView`.
#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSTableView",
    feature = "NSView"
))]
impl NSOutlineView {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;
    );
}

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

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

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewdatasource?language=objc)
    pub unsafe trait NSOutlineViewDataSource: NSObjectProtocol {
        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:numberOfChildrenOfItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_numberOfChildrenOfItem(
            &self,
            outline_view: &NSOutlineView,
            item: Option<&AnyObject>,
        ) -> NSInteger;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:child:ofItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_child_ofItem(
            &self,
            outline_view: &NSOutlineView,
            index: NSInteger,
            item: Option<&AnyObject>,
        ) -> Retained<AnyObject>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:isItemExpandable:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_isItemExpandable(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:objectValueForTableColumn:byItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_objectValueForTableColumn_byItem(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: Option<&AnyObject>,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// - `object` should be of the correct type.
        /// - `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:setObjectValue:forTableColumn:byItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_setObjectValue_forTableColumn_byItem(
            &self,
            outline_view: &NSOutlineView,
            object: Option<&AnyObject>,
            table_column: Option<&NSTableColumn>,
            item: Option<&AnyObject>,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `object` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:itemForPersistentObject:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_itemForPersistentObject(
            &self,
            outline_view: &NSOutlineView,
            object: &AnyObject,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:persistentObjectForItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_persistentObjectForItem(
            &self,
            outline_view: &NSOutlineView,
            item: Option<&AnyObject>,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:sortDescriptorsDidChange:))]
        #[unsafe(method_family = none)]
        fn outlineView_sortDescriptorsDidChange(
            &self,
            outline_view: &NSOutlineView,
            old_descriptors: &NSArray<NSSortDescriptor>,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSPasteboard",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:pasteboardWriterForItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_pasteboardWriterForItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> Option<Retained<ProtocolObject<dyn NSPasteboardWriting>>>;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDraggingSession",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `dragged_items` generic should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:draggingSession:willBeginAtPoint:forItems:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_draggingSession_willBeginAtPoint_forItems(
            &self,
            outline_view: &NSOutlineView,
            session: &NSDraggingSession,
            screen_point: NSPoint,
            dragged_items: &NSArray,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSDraggingSession",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:draggingSession:endedAtPoint:operation:))]
        #[unsafe(method_family = none)]
        fn outlineView_draggingSession_endedAtPoint_operation(
            &self,
            outline_view: &NSOutlineView,
            session: &NSDraggingSession,
            screen_point: NSPoint,
            operation: NSDragOperation,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSPasteboard",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `items` generic should be of the correct type.
        #[deprecated = "Use -outlineView:pasteboardWriterForItem: instead"]
        #[optional]
        #[unsafe(method(outlineView:writeItems:toPasteboard:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_writeItems_toPasteboard(
            &self,
            outline_view: &NSOutlineView,
            items: &NSArray,
            pasteboard: &NSPasteboard,
        ) -> bool;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:updateDraggingItemsForDrag:))]
        #[unsafe(method_family = none)]
        fn outlineView_updateDraggingItemsForDrag(
            &self,
            outline_view: &NSOutlineView,
            dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
        );

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:validateDrop:proposedItem:proposedChildIndex:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_validateDrop_proposedItem_proposedChildIndex(
            &self,
            outline_view: &NSOutlineView,
            info: &ProtocolObject<dyn NSDraggingInfo>,
            item: Option<&AnyObject>,
            index: NSInteger,
        ) -> NSDragOperation;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSDragging",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:acceptDrop:item:childIndex:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_acceptDrop_item_childIndex(
            &self,
            outline_view: &NSOutlineView,
            info: &ProtocolObject<dyn NSDraggingInfo>,
            item: Option<&AnyObject>,
            index: NSInteger,
        ) -> bool;

        #[cfg(all(
            feature = "NSControl",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `items` generic should be of the correct type.
        #[deprecated = "Use NSFilePromiseReceiver objects instead"]
        #[optional]
        #[unsafe(method(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems(
            &self,
            outline_view: &NSOutlineView,
            drop_destination: &NSURL,
            items: &NSArray,
        ) -> Retained<NSArray<NSString>>;
    }
);

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewdelegate?language=objc)
    #[cfg(feature = "NSControl")]
    pub unsafe trait NSOutlineViewDelegate:
        NSControlTextEditingDelegate + MainThreadOnly
    {
        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:viewForTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_viewForTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> Option<Retained<NSView>>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableRowView",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:rowViewForItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_rowViewForItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> Option<Retained<NSTableRowView>>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableRowView",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:didAddRowView:forRow:))]
        #[unsafe(method_family = none)]
        fn outlineView_didAddRowView_forRow(
            &self,
            outline_view: &NSOutlineView,
            row_view: &NSTableRowView,
            row: NSInteger,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableRowView",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:didRemoveRowView:forRow:))]
        #[unsafe(method_family = none)]
        fn outlineView_didRemoveRowView_forRow(
            &self,
            outline_view: &NSOutlineView,
            row_view: &NSTableRowView,
            row: NSInteger,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// - `cell` should be of the correct type.
        /// - `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:willDisplayCell:forTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_willDisplayCell_forTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            cell: &AnyObject,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldEditTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldEditTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        #[optional]
        #[unsafe(method(selectionShouldChangeInOutlineView:))]
        #[unsafe(method_family = none)]
        fn selectionShouldChangeInOutlineView(&self, outline_view: &NSOutlineView) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldSelectItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldSelectItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        #[optional]
        #[unsafe(method(outlineView:selectionIndexesForProposedSelection:))]
        #[unsafe(method_family = none)]
        fn outlineView_selectionIndexesForProposedSelection(
            &self,
            outline_view: &NSOutlineView,
            proposed_selection_indexes: &NSIndexSet,
        ) -> Retained<NSIndexSet>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:shouldSelectTableColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_shouldSelectTableColumn(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
        ) -> bool;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:mouseDownInHeaderOfTableColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_mouseDownInHeaderOfTableColumn(
            &self,
            outline_view: &NSOutlineView,
            table_column: &NSTableColumn,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:didClickTableColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_didClickTableColumn(
            &self,
            outline_view: &NSOutlineView,
            table_column: &NSTableColumn,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:didDragTableColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_didDragTableColumn(
            &self,
            outline_view: &NSOutlineView,
            table_column: &NSTableColumn,
        );

        #[cfg(all(
            feature = "NSCell",
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// - `rect` must be a valid pointer.
        /// - `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_toolTipForCell_rect_tableColumn_item_mouseLocation(
            &self,
            outline_view: &NSOutlineView,
            cell: &NSCell,
            rect: NSRectPointer,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
            mouse_location: NSPoint,
        ) -> Retained<NSString>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView",
            feature = "objc2-core-foundation"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:heightOfRowByItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_heightOfRowByItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> CGFloat;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSTintConfiguration",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:tintConfigurationForItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_tintConfigurationForItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> Option<Retained<NSTintConfiguration>>;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:typeSelectStringForTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_typeSelectStringForTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> Option<Retained<NSString>>;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// - `start_item` should be of the correct type.
        /// - `end_item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:nextTypeSelectMatchFromItem:toItem:forString:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_nextTypeSelectMatchFromItem_toItem_forString(
            &self,
            outline_view: &NSOutlineView,
            start_item: &AnyObject,
            end_item: &AnyObject,
            search_string: &NSString,
        ) -> Option<Retained<AnyObject>>;

        #[cfg(all(
            feature = "NSEvent",
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:shouldTypeSelectForEvent:withCurrentSearchString:))]
        #[unsafe(method_family = none)]
        fn outlineView_shouldTypeSelectForEvent_withCurrentSearchString(
            &self,
            outline_view: &NSOutlineView,
            event: &NSEvent,
            search_string: Option<&NSString>,
        ) -> bool;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldShowCellExpansionForTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldShowCellExpansionForTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(
            feature = "NSCell",
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldTrackCell:forTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldTrackCell_forTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            cell: &NSCell,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(
            feature = "NSCell",
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:dataCellForTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_dataCellForTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        ) -> Option<Retained<NSCell>>;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:isGroupItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_isGroupItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldExpandItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldExpandItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldCollapseItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldCollapseItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        /// # Safety
        ///
        /// - `cell` should be of the correct type.
        /// - `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:willDisplayOutlineCell:forTableColumn:item:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_willDisplayOutlineCell_forTableColumn_item(
            &self,
            outline_view: &NSOutlineView,
            cell: &AnyObject,
            table_column: Option<&NSTableColumn>,
            item: &AnyObject,
        );

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableView",
            feature = "NSView",
            feature = "objc2-core-foundation"
        ))]
        #[optional]
        #[unsafe(method(outlineView:sizeToFitWidthOfColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_sizeToFitWidthOfColumn(
            &self,
            outline_view: &NSOutlineView,
            column: NSInteger,
        ) -> CGFloat;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        #[optional]
        #[unsafe(method(outlineView:shouldReorderColumn:toColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_shouldReorderColumn_toColumn(
            &self,
            outline_view: &NSOutlineView,
            column_index: NSInteger,
            new_column_index: NSInteger,
        ) -> bool;

        #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
        /// # Safety
        ///
        /// `item` should be of the correct type.
        #[optional]
        #[unsafe(method(outlineView:shouldShowOutlineCellForItem:))]
        #[unsafe(method_family = none)]
        unsafe fn outlineView_shouldShowOutlineCellForItem(
            &self,
            outline_view: &NSOutlineView,
            item: &AnyObject,
        ) -> bool;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:userCanChangeVisibilityOfTableColumn:))]
        #[unsafe(method_family = none)]
        fn outlineView_userCanChangeVisibilityOfTableColumn(
            &self,
            outline_view: &NSOutlineView,
            column: &NSTableColumn,
        ) -> bool;

        #[cfg(all(
            feature = "NSResponder",
            feature = "NSTableColumn",
            feature = "NSTableView",
            feature = "NSView"
        ))]
        #[optional]
        #[unsafe(method(outlineView:userDidChangeVisibilityOfTableColumns:))]
        #[unsafe(method_family = none)]
        fn outlineView_userDidChangeVisibilityOfTableColumns(
            &self,
            outline_view: &NSOutlineView,
            columns: &NSArray<NSTableColumn>,
        );

        #[optional]
        #[unsafe(method(outlineViewSelectionDidChange:))]
        #[unsafe(method_family = none)]
        fn outlineViewSelectionDidChange(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewColumnDidMove:))]
        #[unsafe(method_family = none)]
        fn outlineViewColumnDidMove(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewColumnDidResize:))]
        #[unsafe(method_family = none)]
        fn outlineViewColumnDidResize(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewSelectionIsChanging:))]
        #[unsafe(method_family = none)]
        fn outlineViewSelectionIsChanging(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewItemWillExpand:))]
        #[unsafe(method_family = none)]
        fn outlineViewItemWillExpand(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewItemDidExpand:))]
        #[unsafe(method_family = none)]
        fn outlineViewItemDidExpand(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewItemWillCollapse:))]
        #[unsafe(method_family = none)]
        fn outlineViewItemWillCollapse(&self, notification: &NSNotification);

        #[optional]
        #[unsafe(method(outlineViewItemDidCollapse:))]
        #[unsafe(method_family = none)]
        fn outlineViewItemDidCollapse(&self, notification: &NSNotification);
    }
);

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewdisclosurebuttonkey?language=objc)
    #[cfg(feature = "NSUserInterfaceItemIdentification")]
    pub static NSOutlineViewDisclosureButtonKey: &'static NSUserInterfaceItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewshowhidebuttonkey?language=objc)
    #[cfg(feature = "NSUserInterfaceItemIdentification")]
    pub static NSOutlineViewShowHideButtonKey: &'static NSUserInterfaceItemIdentifier;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewselectiondidchangenotification?language=objc)
    pub static NSOutlineViewSelectionDidChangeNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewcolumndidmovenotification?language=objc)
    pub static NSOutlineViewColumnDidMoveNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewcolumndidresizenotification?language=objc)
    pub static NSOutlineViewColumnDidResizeNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewselectionischangingnotification?language=objc)
    pub static NSOutlineViewSelectionIsChangingNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewitemwillexpandnotification?language=objc)
    pub static NSOutlineViewItemWillExpandNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewitemdidexpandnotification?language=objc)
    pub static NSOutlineViewItemDidExpandNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewitemwillcollapsenotification?language=objc)
    pub static NSOutlineViewItemWillCollapseNotification: &'static NSNotificationName;
}

extern "C" {
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsoutlineviewitemdidcollapsenotification?language=objc)
    pub static NSOutlineViewItemDidCollapseNotification: &'static NSNotificationName;
}
