//! 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::*;

/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmatrixmode?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSMatrixMode(pub NSUInteger);
impl NSMatrixMode {
    #[doc(alias = "NSRadioModeMatrix")]
    pub const RadioModeMatrix: Self = Self(0);
    #[doc(alias = "NSHighlightModeMatrix")]
    pub const HighlightModeMatrix: Self = Self(1);
    #[doc(alias = "NSListModeMatrix")]
    pub const ListModeMatrix: Self = Self(2);
    #[doc(alias = "NSTrackModeMatrix")]
    pub const TrackModeMatrix: Self = Self(3);
}

unsafe impl Encode for NSMatrixMode {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for NSMatrixMode {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

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

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibility for NSMatrix {}

#[cfg(all(
    feature = "NSAccessibilityProtocols",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAccessibilityElementProtocol for NSMatrix {}

#[cfg(all(
    feature = "NSAnimation",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAnimatablePropertyContainer for NSMatrix {}

#[cfg(all(
    feature = "NSAppearance",
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSAppearanceCustomization for NSMatrix {}

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSCoding for NSMatrix {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSDragging",
    feature = "NSResponder",
    feature = "NSView"
))]
unsafe impl NSDraggingDestination for NSMatrix {}

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSObjectProtocol for NSMatrix {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSUserInterfaceItemIdentification",
    feature = "NSView"
))]
unsafe impl NSUserInterfaceItemIdentification for NSMatrix {}

#[cfg(all(
    feature = "NSControl",
    feature = "NSResponder",
    feature = "NSUserInterfaceValidation",
    feature = "NSView"
))]
unsafe impl NSUserInterfaceValidations for NSMatrix {}

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
unsafe impl NSViewToolTipOwner for NSMatrix {}

#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSMatrix {
    extern_methods!(
        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[cfg(feature = "NSCell")]
        #[unsafe(method(initWithFrame:mode:prototype:numberOfRows:numberOfColumns:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame_mode_prototype_numberOfRows_numberOfColumns(
            this: Allocated<Self>,
            frame_rect: NSRect,
            mode: NSMatrixMode,
            cell: &NSCell,
            rows_high: NSInteger,
            cols_wide: NSInteger,
        ) -> Retained<Self>;

        #[unsafe(method(initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame_mode_cellClass_numberOfRows_numberOfColumns(
            this: Allocated<Self>,
            frame_rect: NSRect,
            mode: NSMatrixMode,
            factory_id: Option<&AnyClass>,
            rows_high: NSInteger,
            cols_wide: NSInteger,
        ) -> Retained<Self>;

        #[unsafe(method(cellClass))]
        #[unsafe(method_family = none)]
        pub unsafe fn cellClass(&self) -> &'static AnyClass;

        /// Setter for [`cellClass`][Self::cellClass].
        #[unsafe(method(setCellClass:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCellClass(&self, cell_class: &AnyClass);

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

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(makeCellAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn makeCellAtRow_column(
            &self,
            row: NSInteger,
            col: NSInteger,
        ) -> Retained<NSCell>;

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

        /// Setter for [`mode`][Self::mode].
        #[unsafe(method(setMode:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMode(&self, mode: NSMatrixMode);

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

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

        #[unsafe(method(sendAction:to:forAllCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sendAction_to_forAllCells(
            &self,
            selector: Sel,
            object: &AnyObject,
            flag: bool,
        );

        #[cfg(feature = "NSCell")]
        #[unsafe(method(cells))]
        #[unsafe(method_family = none)]
        pub unsafe fn cells(&self) -> Retained<NSArray<NSCell>>;

        #[unsafe(method(sortUsingSelector:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sortUsingSelector(&self, comparator: Sel);

        #[unsafe(method(sortUsingFunction:context:))]
        #[unsafe(method_family = none)]
        pub unsafe fn sortUsingFunction_context(
            &self,
            compare: unsafe extern "C-unwind" fn(
                NonNull<AnyObject>,
                NonNull<AnyObject>,
                *mut c_void,
            ) -> NSInteger,
            context: *mut c_void,
        );

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(selectedCells))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectedCells(&self) -> Retained<NSArray<NSCell>>;

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

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

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

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

        #[unsafe(method(setSelectionFrom:to:anchor:highlight:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSelectionFrom_to_anchor_highlight(
            &self,
            start_pos: NSInteger,
            end_pos: NSInteger,
            anchor_pos: NSInteger,
            lit: bool,
        );

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

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

        #[unsafe(method(selectCellAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectCellAtRow_column(&self, row: NSInteger, col: NSInteger);

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

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

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

        /// Setter for [`cellSize`][Self::cellSize].
        #[unsafe(method(setCellSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setCellSize(&self, cell_size: NSSize);

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

        /// Setter for [`intercellSpacing`][Self::intercellSpacing].
        #[unsafe(method(setIntercellSpacing:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIntercellSpacing(&self, intercell_spacing: NSSize);

        #[unsafe(method(setScrollable:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScrollable(&self, flag: bool);

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

        #[cfg(feature = "NSColor")]
        /// Setter for [`backgroundColor`][Self::backgroundColor].
        #[unsafe(method(setBackgroundColor:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);

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

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

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

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

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

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

        #[unsafe(method(setState:atRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setState_atRow_column(
            &self,
            value: NSInteger,
            row: NSInteger,
            col: NSInteger,
        );

        #[unsafe(method(getNumberOfRows:columns:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getNumberOfRows_columns(
            &self,
            row_count: *mut NSInteger,
            col_count: *mut NSInteger,
        );

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

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(cellAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cellAtRow_column(
            &self,
            row: NSInteger,
            col: NSInteger,
        ) -> Option<Retained<NSCell>>;

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(getRow:column:ofCell:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getRow_column_ofCell(
            &self,
            row: NonNull<NSInteger>,
            col: NonNull<NSInteger>,
            cell: &NSCell,
        ) -> bool;

        #[unsafe(method(getRow:column:forPoint:))]
        #[unsafe(method_family = none)]
        pub unsafe fn getRow_column_forPoint(
            &self,
            row: NonNull<NSInteger>,
            col: NonNull<NSInteger>,
            point: NSPoint,
        ) -> bool;

        #[unsafe(method(renewRows:columns:))]
        #[unsafe(method_family = none)]
        pub unsafe fn renewRows_columns(&self, new_rows: NSInteger, new_cols: NSInteger);

        #[cfg(feature = "NSCell")]
        #[unsafe(method(putCell:atRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn putCell_atRow_column(
            &self,
            new_cell: &NSCell,
            row: NSInteger,
            col: NSInteger,
        );

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(addRowWithCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addRowWithCells(&self, new_cells: &NSArray<NSCell>);

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(insertRow:withCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertRow_withCells(
            &self,
            row: NSInteger,
            new_cells: Option<&NSArray<NSCell>>,
        );

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

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(addColumnWithCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addColumnWithCells(&self, new_cells: &NSArray<NSCell>);

        #[unsafe(method(insertColumn:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertColumn(&self, column: NSInteger);

        #[cfg(feature = "NSCell")]
        #[unsafe(method(insertColumn:withCells:))]
        #[unsafe(method_family = none)]
        pub unsafe fn insertColumn_withCells(
            &self,
            column: NSInteger,
            new_cells: Option<&NSArray<NSCell>>,
        );

        #[unsafe(method(removeColumn:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeColumn(&self, col: NSInteger);

        #[cfg(feature = "NSCell")]
        #[unsafe(method(cellWithTag:))]
        #[unsafe(method_family = none)]
        pub unsafe fn cellWithTag(&self, tag: NSInteger) -> Option<Retained<NSCell>>;

        #[unsafe(method(doubleAction))]
        #[unsafe(method_family = none)]
        pub unsafe fn doubleAction(&self) -> Option<Sel>;

        /// Setter for [`doubleAction`][Self::doubleAction].
        #[unsafe(method(setDoubleAction:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDoubleAction(&self, double_action: Option<Sel>);

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

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

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

        #[unsafe(method(setValidateSize:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setValidateSize(&self, flag: bool);

        #[unsafe(method(drawCellAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn drawCellAtRow_column(&self, row: NSInteger, col: NSInteger);

        #[unsafe(method(highlightCell:atRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn highlightCell_atRow_column(&self, flag: bool, row: NSInteger, col: NSInteger);

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

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

        #[unsafe(method(scrollCellToVisibleAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn scrollCellToVisibleAtRow_column(&self, row: NSInteger, col: NSInteger);

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

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(mouseDown:))]
        #[unsafe(method_family = none)]
        pub unsafe fn mouseDown(&self, event: &NSEvent);

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(performKeyEquivalent:))]
        #[unsafe(method_family = none)]
        pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool;

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

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

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

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

        #[cfg(feature = "NSText")]
        #[unsafe(method(textShouldBeginEditing:))]
        #[unsafe(method_family = none)]
        pub unsafe fn textShouldBeginEditing(&self, text_object: &NSText) -> bool;

        #[cfg(feature = "NSText")]
        #[unsafe(method(textShouldEndEditing:))]
        #[unsafe(method_family = none)]
        pub unsafe fn textShouldEndEditing(&self, text_object: &NSText) -> bool;

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

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

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

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(selectTextAtRow:column:))]
        #[unsafe(method_family = none)]
        pub unsafe fn selectTextAtRow_column(
            &self,
            row: NSInteger,
            col: NSInteger,
        ) -> Option<Retained<NSCell>>;

        #[cfg(feature = "NSEvent")]
        #[unsafe(method(acceptsFirstMouse:))]
        #[unsafe(method_family = none)]
        pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool;

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

        #[cfg(feature = "NSCell")]
        #[unsafe(method(setToolTip:forCell:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setToolTip_forCell(&self, tool_tip_string: Option<&NSString>, cell: &NSCell);

        #[cfg(feature = "NSCell")]
        #[unsafe(method(toolTipForCell:))]
        #[unsafe(method_family = none)]
        pub unsafe fn toolTipForCell(&self, cell: &NSCell) -> Option<Retained<NSString>>;

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

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

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

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

/// NSKeyboardUI.
#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
impl NSMatrix {
    extern_methods!(
        #[unsafe(method(tabKeyTraversesCells))]
        #[unsafe(method_family = none)]
        pub unsafe fn tabKeyTraversesCells(&self) -> bool;

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

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

        #[cfg(feature = "NSCell")]
        /// Setter for [`keyCell`][Self::keyCell].
        #[unsafe(method(setKeyCell:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setKeyCell(&self, key_cell: Option<&NSCell>);
    );
}

extern_protocol!(
    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmatrixdelegate?language=objc)
    #[cfg(feature = "NSControl")]
    pub unsafe trait NSMatrixDelegate: NSControlTextEditingDelegate {}
);
