objc2_app_kit/generated/
NSMatrix.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmatrixmode?language=objc)
11// NS_ENUM
12#[repr(transparent)]
13#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
14pub struct NSMatrixMode(pub NSUInteger);
15impl NSMatrixMode {
16    #[doc(alias = "NSRadioModeMatrix")]
17    pub const RadioModeMatrix: Self = Self(0);
18    #[doc(alias = "NSHighlightModeMatrix")]
19    pub const HighlightModeMatrix: Self = Self(1);
20    #[doc(alias = "NSListModeMatrix")]
21    pub const ListModeMatrix: Self = Self(2);
22    #[doc(alias = "NSTrackModeMatrix")]
23    pub const TrackModeMatrix: Self = Self(3);
24}
25
26unsafe impl Encode for NSMatrixMode {
27    const ENCODING: Encoding = NSUInteger::ENCODING;
28}
29
30unsafe impl RefEncode for NSMatrixMode {
31    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34extern_class!(
35    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmatrix?language=objc)
36    #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
37    #[derive(Debug, PartialEq, Eq, Hash)]
38    #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
39    pub struct NSMatrix;
40);
41
42#[cfg(all(
43    feature = "NSAccessibilityProtocols",
44    feature = "NSControl",
45    feature = "NSResponder",
46    feature = "NSView"
47))]
48extern_conformance!(
49    unsafe impl NSAccessibility for NSMatrix {}
50);
51
52#[cfg(all(
53    feature = "NSAccessibilityProtocols",
54    feature = "NSControl",
55    feature = "NSResponder",
56    feature = "NSView"
57))]
58extern_conformance!(
59    unsafe impl NSAccessibilityElementProtocol for NSMatrix {}
60);
61
62#[cfg(all(
63    feature = "NSAnimation",
64    feature = "NSControl",
65    feature = "NSResponder",
66    feature = "NSView"
67))]
68extern_conformance!(
69    unsafe impl NSAnimatablePropertyContainer for NSMatrix {}
70);
71
72#[cfg(all(
73    feature = "NSAppearance",
74    feature = "NSControl",
75    feature = "NSResponder",
76    feature = "NSView"
77))]
78extern_conformance!(
79    unsafe impl NSAppearanceCustomization for NSMatrix {}
80);
81
82#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
83extern_conformance!(
84    unsafe impl NSCoding for NSMatrix {}
85);
86
87#[cfg(all(
88    feature = "NSControl",
89    feature = "NSDragging",
90    feature = "NSResponder",
91    feature = "NSView"
92))]
93extern_conformance!(
94    unsafe impl NSDraggingDestination for NSMatrix {}
95);
96
97#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
98extern_conformance!(
99    unsafe impl NSObjectProtocol for NSMatrix {}
100);
101
102#[cfg(all(
103    feature = "NSControl",
104    feature = "NSResponder",
105    feature = "NSUserInterfaceItemIdentification",
106    feature = "NSView"
107))]
108extern_conformance!(
109    unsafe impl NSUserInterfaceItemIdentification for NSMatrix {}
110);
111
112#[cfg(all(
113    feature = "NSControl",
114    feature = "NSResponder",
115    feature = "NSUserInterfaceValidation",
116    feature = "NSView"
117))]
118extern_conformance!(
119    unsafe impl NSUserInterfaceValidations for NSMatrix {}
120);
121
122#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
123extern_conformance!(
124    unsafe impl NSViewToolTipOwner for NSMatrix {}
125);
126
127#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
128impl NSMatrix {
129    extern_methods!(
130        #[unsafe(method(initWithFrame:))]
131        #[unsafe(method_family = init)]
132        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
133
134        #[cfg(feature = "NSCell")]
135        #[unsafe(method(initWithFrame:mode:prototype:numberOfRows:numberOfColumns:))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn initWithFrame_mode_prototype_numberOfRows_numberOfColumns(
138            this: Allocated<Self>,
139            frame_rect: NSRect,
140            mode: NSMatrixMode,
141            cell: &NSCell,
142            rows_high: NSInteger,
143            cols_wide: NSInteger,
144        ) -> Retained<Self>;
145
146        #[unsafe(method(initWithFrame:mode:cellClass:numberOfRows:numberOfColumns:))]
147        #[unsafe(method_family = init)]
148        pub unsafe fn initWithFrame_mode_cellClass_numberOfRows_numberOfColumns(
149            this: Allocated<Self>,
150            frame_rect: NSRect,
151            mode: NSMatrixMode,
152            factory_id: Option<&AnyClass>,
153            rows_high: NSInteger,
154            cols_wide: NSInteger,
155        ) -> Retained<Self>;
156
157        #[unsafe(method(cellClass))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn cellClass(&self) -> &'static AnyClass;
160
161        /// Setter for [`cellClass`][Self::cellClass].
162        #[unsafe(method(setCellClass:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn setCellClass(&self, cell_class: &AnyClass);
165
166        #[cfg(feature = "NSCell")]
167        #[unsafe(method(prototype))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn prototype(&self) -> Option<Retained<NSCell>>;
170
171        #[cfg(feature = "NSCell")]
172        /// Setter for [`prototype`][Self::prototype].
173        #[unsafe(method(setPrototype:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn setPrototype(&self, prototype: Option<&NSCell>);
176
177        #[cfg(feature = "NSCell")]
178        #[unsafe(method(makeCellAtRow:column:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn makeCellAtRow_column(
181            &self,
182            row: NSInteger,
183            col: NSInteger,
184        ) -> Retained<NSCell>;
185
186        #[unsafe(method(mode))]
187        #[unsafe(method_family = none)]
188        pub unsafe fn mode(&self) -> NSMatrixMode;
189
190        /// Setter for [`mode`][Self::mode].
191        #[unsafe(method(setMode:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn setMode(&self, mode: NSMatrixMode);
194
195        #[unsafe(method(allowsEmptySelection))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn allowsEmptySelection(&self) -> bool;
198
199        /// Setter for [`allowsEmptySelection`][Self::allowsEmptySelection].
200        #[unsafe(method(setAllowsEmptySelection:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setAllowsEmptySelection(&self, allows_empty_selection: bool);
203
204        #[unsafe(method(sendAction:to:forAllCells:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn sendAction_to_forAllCells(
207            &self,
208            selector: Sel,
209            object: &AnyObject,
210            flag: bool,
211        );
212
213        #[cfg(feature = "NSCell")]
214        #[unsafe(method(cells))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn cells(&self) -> Retained<NSArray<NSCell>>;
217
218        #[unsafe(method(sortUsingSelector:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn sortUsingSelector(&self, comparator: Sel);
221
222        #[unsafe(method(sortUsingFunction:context:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn sortUsingFunction_context(
225            &self,
226            compare: unsafe extern "C-unwind" fn(
227                NonNull<AnyObject>,
228                NonNull<AnyObject>,
229                *mut c_void,
230            ) -> NSInteger,
231            context: *mut c_void,
232        );
233
234        #[cfg(feature = "NSCell")]
235        #[unsafe(method(selectedCell))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn selectedCell(&self) -> Option<Retained<NSCell>>;
238
239        #[cfg(feature = "NSCell")]
240        #[unsafe(method(selectedCells))]
241        #[unsafe(method_family = none)]
242        pub unsafe fn selectedCells(&self) -> Retained<NSArray<NSCell>>;
243
244        #[unsafe(method(selectedRow))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn selectedRow(&self) -> NSInteger;
247
248        #[unsafe(method(selectedColumn))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn selectedColumn(&self) -> NSInteger;
251
252        #[unsafe(method(isSelectionByRect))]
253        #[unsafe(method_family = none)]
254        pub unsafe fn isSelectionByRect(&self) -> bool;
255
256        /// Setter for [`isSelectionByRect`][Self::isSelectionByRect].
257        #[unsafe(method(setSelectionByRect:))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn setSelectionByRect(&self, selection_by_rect: bool);
260
261        #[unsafe(method(setSelectionFrom:to:anchor:highlight:))]
262        #[unsafe(method_family = none)]
263        pub unsafe fn setSelectionFrom_to_anchor_highlight(
264            &self,
265            start_pos: NSInteger,
266            end_pos: NSInteger,
267            anchor_pos: NSInteger,
268            lit: bool,
269        );
270
271        #[unsafe(method(deselectSelectedCell))]
272        #[unsafe(method_family = none)]
273        pub unsafe fn deselectSelectedCell(&self);
274
275        #[unsafe(method(deselectAllCells))]
276        #[unsafe(method_family = none)]
277        pub unsafe fn deselectAllCells(&self);
278
279        #[unsafe(method(selectCellAtRow:column:))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn selectCellAtRow_column(&self, row: NSInteger, col: NSInteger);
282
283        #[unsafe(method(selectAll:))]
284        #[unsafe(method_family = none)]
285        pub unsafe fn selectAll(&self, sender: Option<&AnyObject>);
286
287        #[unsafe(method(selectCellWithTag:))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn selectCellWithTag(&self, tag: NSInteger) -> bool;
290
291        #[unsafe(method(cellSize))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn cellSize(&self) -> NSSize;
294
295        /// Setter for [`cellSize`][Self::cellSize].
296        #[unsafe(method(setCellSize:))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn setCellSize(&self, cell_size: NSSize);
299
300        #[unsafe(method(intercellSpacing))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn intercellSpacing(&self) -> NSSize;
303
304        /// Setter for [`intercellSpacing`][Self::intercellSpacing].
305        #[unsafe(method(setIntercellSpacing:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn setIntercellSpacing(&self, intercell_spacing: NSSize);
308
309        #[unsafe(method(setScrollable:))]
310        #[unsafe(method_family = none)]
311        pub unsafe fn setScrollable(&self, flag: bool);
312
313        #[cfg(feature = "NSColor")]
314        #[unsafe(method(backgroundColor))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn backgroundColor(&self) -> Retained<NSColor>;
317
318        #[cfg(feature = "NSColor")]
319        /// Setter for [`backgroundColor`][Self::backgroundColor].
320        #[unsafe(method(setBackgroundColor:))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn setBackgroundColor(&self, background_color: &NSColor);
323
324        #[cfg(feature = "NSColor")]
325        #[unsafe(method(cellBackgroundColor))]
326        #[unsafe(method_family = none)]
327        pub unsafe fn cellBackgroundColor(&self) -> Option<Retained<NSColor>>;
328
329        #[cfg(feature = "NSColor")]
330        /// Setter for [`cellBackgroundColor`][Self::cellBackgroundColor].
331        #[unsafe(method(setCellBackgroundColor:))]
332        #[unsafe(method_family = none)]
333        pub unsafe fn setCellBackgroundColor(&self, cell_background_color: Option<&NSColor>);
334
335        #[unsafe(method(drawsCellBackground))]
336        #[unsafe(method_family = none)]
337        pub unsafe fn drawsCellBackground(&self) -> bool;
338
339        /// Setter for [`drawsCellBackground`][Self::drawsCellBackground].
340        #[unsafe(method(setDrawsCellBackground:))]
341        #[unsafe(method_family = none)]
342        pub unsafe fn setDrawsCellBackground(&self, draws_cell_background: bool);
343
344        #[unsafe(method(drawsBackground))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn drawsBackground(&self) -> bool;
347
348        /// Setter for [`drawsBackground`][Self::drawsBackground].
349        #[unsafe(method(setDrawsBackground:))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn setDrawsBackground(&self, draws_background: bool);
352
353        #[unsafe(method(setState:atRow:column:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn setState_atRow_column(
356            &self,
357            value: NSInteger,
358            row: NSInteger,
359            col: NSInteger,
360        );
361
362        #[unsafe(method(getNumberOfRows:columns:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn getNumberOfRows_columns(
365            &self,
366            row_count: *mut NSInteger,
367            col_count: *mut NSInteger,
368        );
369
370        #[unsafe(method(numberOfRows))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn numberOfRows(&self) -> NSInteger;
373
374        #[unsafe(method(numberOfColumns))]
375        #[unsafe(method_family = none)]
376        pub unsafe fn numberOfColumns(&self) -> NSInteger;
377
378        #[cfg(feature = "NSCell")]
379        #[unsafe(method(cellAtRow:column:))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn cellAtRow_column(
382            &self,
383            row: NSInteger,
384            col: NSInteger,
385        ) -> Option<Retained<NSCell>>;
386
387        #[unsafe(method(cellFrameAtRow:column:))]
388        #[unsafe(method_family = none)]
389        pub unsafe fn cellFrameAtRow_column(&self, row: NSInteger, col: NSInteger) -> NSRect;
390
391        #[cfg(feature = "NSCell")]
392        #[unsafe(method(getRow:column:ofCell:))]
393        #[unsafe(method_family = none)]
394        pub unsafe fn getRow_column_ofCell(
395            &self,
396            row: NonNull<NSInteger>,
397            col: NonNull<NSInteger>,
398            cell: &NSCell,
399        ) -> bool;
400
401        #[unsafe(method(getRow:column:forPoint:))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn getRow_column_forPoint(
404            &self,
405            row: NonNull<NSInteger>,
406            col: NonNull<NSInteger>,
407            point: NSPoint,
408        ) -> bool;
409
410        #[unsafe(method(renewRows:columns:))]
411        #[unsafe(method_family = none)]
412        pub unsafe fn renewRows_columns(&self, new_rows: NSInteger, new_cols: NSInteger);
413
414        #[cfg(feature = "NSCell")]
415        #[unsafe(method(putCell:atRow:column:))]
416        #[unsafe(method_family = none)]
417        pub unsafe fn putCell_atRow_column(
418            &self,
419            new_cell: &NSCell,
420            row: NSInteger,
421            col: NSInteger,
422        );
423
424        #[unsafe(method(addRow))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn addRow(&self);
427
428        #[cfg(feature = "NSCell")]
429        #[unsafe(method(addRowWithCells:))]
430        #[unsafe(method_family = none)]
431        pub unsafe fn addRowWithCells(&self, new_cells: &NSArray<NSCell>);
432
433        #[unsafe(method(insertRow:))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn insertRow(&self, row: NSInteger);
436
437        #[cfg(feature = "NSCell")]
438        #[unsafe(method(insertRow:withCells:))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn insertRow_withCells(
441            &self,
442            row: NSInteger,
443            new_cells: Option<&NSArray<NSCell>>,
444        );
445
446        #[unsafe(method(removeRow:))]
447        #[unsafe(method_family = none)]
448        pub unsafe fn removeRow(&self, row: NSInteger);
449
450        #[unsafe(method(addColumn))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn addColumn(&self);
453
454        #[cfg(feature = "NSCell")]
455        #[unsafe(method(addColumnWithCells:))]
456        #[unsafe(method_family = none)]
457        pub unsafe fn addColumnWithCells(&self, new_cells: &NSArray<NSCell>);
458
459        #[unsafe(method(insertColumn:))]
460        #[unsafe(method_family = none)]
461        pub unsafe fn insertColumn(&self, column: NSInteger);
462
463        #[cfg(feature = "NSCell")]
464        #[unsafe(method(insertColumn:withCells:))]
465        #[unsafe(method_family = none)]
466        pub unsafe fn insertColumn_withCells(
467            &self,
468            column: NSInteger,
469            new_cells: Option<&NSArray<NSCell>>,
470        );
471
472        #[unsafe(method(removeColumn:))]
473        #[unsafe(method_family = none)]
474        pub unsafe fn removeColumn(&self, col: NSInteger);
475
476        #[cfg(feature = "NSCell")]
477        #[unsafe(method(cellWithTag:))]
478        #[unsafe(method_family = none)]
479        pub unsafe fn cellWithTag(&self, tag: NSInteger) -> Option<Retained<NSCell>>;
480
481        #[unsafe(method(doubleAction))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn doubleAction(&self) -> Option<Sel>;
484
485        /// Setter for [`doubleAction`][Self::doubleAction].
486        #[unsafe(method(setDoubleAction:))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn setDoubleAction(&self, double_action: Option<Sel>);
489
490        #[unsafe(method(autosizesCells))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn autosizesCells(&self) -> bool;
493
494        /// Setter for [`autosizesCells`][Self::autosizesCells].
495        #[unsafe(method(setAutosizesCells:))]
496        #[unsafe(method_family = none)]
497        pub unsafe fn setAutosizesCells(&self, autosizes_cells: bool);
498
499        #[unsafe(method(sizeToCells))]
500        #[unsafe(method_family = none)]
501        pub unsafe fn sizeToCells(&self);
502
503        #[unsafe(method(setValidateSize:))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn setValidateSize(&self, flag: bool);
506
507        #[unsafe(method(drawCellAtRow:column:))]
508        #[unsafe(method_family = none)]
509        pub unsafe fn drawCellAtRow_column(&self, row: NSInteger, col: NSInteger);
510
511        #[unsafe(method(highlightCell:atRow:column:))]
512        #[unsafe(method_family = none)]
513        pub unsafe fn highlightCell_atRow_column(&self, flag: bool, row: NSInteger, col: NSInteger);
514
515        #[unsafe(method(isAutoscroll))]
516        #[unsafe(method_family = none)]
517        pub unsafe fn isAutoscroll(&self) -> bool;
518
519        /// Setter for [`isAutoscroll`][Self::isAutoscroll].
520        #[unsafe(method(setAutoscroll:))]
521        #[unsafe(method_family = none)]
522        pub unsafe fn setAutoscroll(&self, autoscroll: bool);
523
524        #[unsafe(method(scrollCellToVisibleAtRow:column:))]
525        #[unsafe(method_family = none)]
526        pub unsafe fn scrollCellToVisibleAtRow_column(&self, row: NSInteger, col: NSInteger);
527
528        #[unsafe(method(mouseDownFlags))]
529        #[unsafe(method_family = none)]
530        pub unsafe fn mouseDownFlags(&self) -> NSInteger;
531
532        #[cfg(feature = "NSEvent")]
533        #[unsafe(method(mouseDown:))]
534        #[unsafe(method_family = none)]
535        pub unsafe fn mouseDown(&self, event: &NSEvent);
536
537        #[cfg(feature = "NSEvent")]
538        #[unsafe(method(performKeyEquivalent:))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn performKeyEquivalent(&self, event: &NSEvent) -> bool;
541
542        #[unsafe(method(sendAction))]
543        #[unsafe(method_family = none)]
544        pub unsafe fn sendAction(&self) -> bool;
545
546        #[unsafe(method(sendDoubleAction))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn sendDoubleAction(&self);
549
550        #[unsafe(method(delegate))]
551        #[unsafe(method_family = none)]
552        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSMatrixDelegate>>>;
553
554        /// This is a [weak property][objc2::topics::weak_property].
555        /// Setter for [`delegate`][Self::delegate].
556        #[unsafe(method(setDelegate:))]
557        #[unsafe(method_family = none)]
558        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSMatrixDelegate>>);
559
560        #[cfg(feature = "NSText")]
561        #[unsafe(method(textShouldBeginEditing:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn textShouldBeginEditing(&self, text_object: &NSText) -> bool;
564
565        #[cfg(feature = "NSText")]
566        #[unsafe(method(textShouldEndEditing:))]
567        #[unsafe(method_family = none)]
568        pub unsafe fn textShouldEndEditing(&self, text_object: &NSText) -> bool;
569
570        #[unsafe(method(textDidBeginEditing:))]
571        #[unsafe(method_family = none)]
572        pub unsafe fn textDidBeginEditing(&self, notification: &NSNotification);
573
574        #[unsafe(method(textDidEndEditing:))]
575        #[unsafe(method_family = none)]
576        pub unsafe fn textDidEndEditing(&self, notification: &NSNotification);
577
578        #[unsafe(method(textDidChange:))]
579        #[unsafe(method_family = none)]
580        pub unsafe fn textDidChange(&self, notification: &NSNotification);
581
582        #[unsafe(method(selectText:))]
583        #[unsafe(method_family = none)]
584        pub unsafe fn selectText(&self, sender: Option<&AnyObject>);
585
586        #[cfg(feature = "NSCell")]
587        #[unsafe(method(selectTextAtRow:column:))]
588        #[unsafe(method_family = none)]
589        pub unsafe fn selectTextAtRow_column(
590            &self,
591            row: NSInteger,
592            col: NSInteger,
593        ) -> Option<Retained<NSCell>>;
594
595        #[cfg(feature = "NSEvent")]
596        #[unsafe(method(acceptsFirstMouse:))]
597        #[unsafe(method_family = none)]
598        pub unsafe fn acceptsFirstMouse(&self, event: Option<&NSEvent>) -> bool;
599
600        #[unsafe(method(resetCursorRects))]
601        #[unsafe(method_family = none)]
602        pub unsafe fn resetCursorRects(&self);
603
604        #[cfg(feature = "NSCell")]
605        #[unsafe(method(setToolTip:forCell:))]
606        #[unsafe(method_family = none)]
607        pub unsafe fn setToolTip_forCell(&self, tool_tip_string: Option<&NSString>, cell: &NSCell);
608
609        #[cfg(feature = "NSCell")]
610        #[unsafe(method(toolTipForCell:))]
611        #[unsafe(method_family = none)]
612        pub unsafe fn toolTipForCell(&self, cell: &NSCell) -> Option<Retained<NSString>>;
613
614        #[unsafe(method(autorecalculatesCellSize))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn autorecalculatesCellSize(&self) -> bool;
617
618        /// Setter for [`autorecalculatesCellSize`][Self::autorecalculatesCellSize].
619        #[unsafe(method(setAutorecalculatesCellSize:))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn setAutorecalculatesCellSize(&self, autorecalculates_cell_size: bool);
622    );
623}
624
625/// Methods declared on superclass `NSControl`.
626#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
627impl NSMatrix {
628    extern_methods!(
629        #[unsafe(method(initWithCoder:))]
630        #[unsafe(method_family = init)]
631        pub unsafe fn initWithCoder(
632            this: Allocated<Self>,
633            coder: &NSCoder,
634        ) -> Option<Retained<Self>>;
635    );
636}
637
638/// Methods declared on superclass `NSResponder`.
639#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
640impl NSMatrix {
641    extern_methods!(
642        #[unsafe(method(init))]
643        #[unsafe(method_family = init)]
644        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
645    );
646}
647
648/// Methods declared on superclass `NSObject`.
649#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
650impl NSMatrix {
651    extern_methods!(
652        #[unsafe(method(new))]
653        #[unsafe(method_family = new)]
654        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
655    );
656}
657
658/// NSKeyboardUI.
659#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
660impl NSMatrix {
661    extern_methods!(
662        #[unsafe(method(tabKeyTraversesCells))]
663        #[unsafe(method_family = none)]
664        pub unsafe fn tabKeyTraversesCells(&self) -> bool;
665
666        /// Setter for [`tabKeyTraversesCells`][Self::tabKeyTraversesCells].
667        #[unsafe(method(setTabKeyTraversesCells:))]
668        #[unsafe(method_family = none)]
669        pub unsafe fn setTabKeyTraversesCells(&self, tab_key_traverses_cells: bool);
670
671        #[cfg(feature = "NSCell")]
672        #[unsafe(method(keyCell))]
673        #[unsafe(method_family = none)]
674        pub unsafe fn keyCell(&self) -> Option<Retained<NSCell>>;
675
676        #[cfg(feature = "NSCell")]
677        /// Setter for [`keyCell`][Self::keyCell].
678        #[unsafe(method(setKeyCell:))]
679        #[unsafe(method_family = none)]
680        pub unsafe fn setKeyCell(&self, key_cell: Option<&NSCell>);
681    );
682}
683
684extern_protocol!(
685    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsmatrixdelegate?language=objc)
686    #[cfg(feature = "NSControl")]
687    pub unsafe trait NSMatrixDelegate: NSControlTextEditingDelegate {}
688);