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