1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct NSTableViewDropOperation(pub NSUInteger);
17impl NSTableViewDropOperation {
18 #[doc(alias = "NSTableViewDropOn")]
19 pub const On: Self = Self(0);
20 #[doc(alias = "NSTableViewDropAbove")]
21 pub const Above: Self = Self(1);
22}
23
24unsafe impl Encode for NSTableViewDropOperation {
25 const ENCODING: Encoding = NSUInteger::ENCODING;
26}
27
28unsafe impl RefEncode for NSTableViewDropOperation {
29 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
30}
31
32#[repr(transparent)]
35#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
36pub struct NSTableViewColumnAutoresizingStyle(pub NSUInteger);
37impl NSTableViewColumnAutoresizingStyle {
38 #[doc(alias = "NSTableViewNoColumnAutoresizing")]
39 pub const NoColumnAutoresizing: Self = Self(0);
40 #[doc(alias = "NSTableViewUniformColumnAutoresizingStyle")]
41 pub const UniformColumnAutoresizingStyle: Self = Self(1);
42 #[doc(alias = "NSTableViewSequentialColumnAutoresizingStyle")]
43 pub const SequentialColumnAutoresizingStyle: Self = Self(2);
44 #[doc(alias = "NSTableViewReverseSequentialColumnAutoresizingStyle")]
45 pub const ReverseSequentialColumnAutoresizingStyle: Self = Self(3);
46 #[doc(alias = "NSTableViewLastColumnOnlyAutoresizingStyle")]
47 pub const LastColumnOnlyAutoresizingStyle: Self = Self(4);
48 #[doc(alias = "NSTableViewFirstColumnOnlyAutoresizingStyle")]
49 pub const FirstColumnOnlyAutoresizingStyle: Self = Self(5);
50}
51
52unsafe impl Encode for NSTableViewColumnAutoresizingStyle {
53 const ENCODING: Encoding = NSUInteger::ENCODING;
54}
55
56unsafe impl RefEncode for NSTableViewColumnAutoresizingStyle {
57 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
58}
59
60#[repr(transparent)]
63#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
64pub struct NSTableViewGridLineStyle(pub NSUInteger);
65bitflags::bitflags! {
66 impl NSTableViewGridLineStyle: NSUInteger {
67 #[doc(alias = "NSTableViewGridNone")]
68 const GridNone = 0;
69 #[doc(alias = "NSTableViewSolidVerticalGridLineMask")]
70 const SolidVerticalGridLineMask = 1<<0;
71 #[doc(alias = "NSTableViewSolidHorizontalGridLineMask")]
72 const SolidHorizontalGridLineMask = 1<<1;
73 #[doc(alias = "NSTableViewDashedHorizontalGridLineMask")]
74 const DashedHorizontalGridLineMask = 1<<3;
75 }
76}
77
78unsafe impl Encode for NSTableViewGridLineStyle {
79 const ENCODING: Encoding = NSUInteger::ENCODING;
80}
81
82unsafe impl RefEncode for NSTableViewGridLineStyle {
83 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
84}
85
86#[repr(transparent)]
89#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
90pub struct NSTableViewRowSizeStyle(pub NSInteger);
91impl NSTableViewRowSizeStyle {
92 #[doc(alias = "NSTableViewRowSizeStyleDefault")]
93 pub const Default: Self = Self(-1);
94 #[doc(alias = "NSTableViewRowSizeStyleCustom")]
95 pub const Custom: Self = Self(0);
96 #[doc(alias = "NSTableViewRowSizeStyleSmall")]
97 pub const Small: Self = Self(1);
98 #[doc(alias = "NSTableViewRowSizeStyleMedium")]
99 pub const Medium: Self = Self(2);
100 #[doc(alias = "NSTableViewRowSizeStyleLarge")]
101 pub const Large: Self = Self(3);
102}
103
104unsafe impl Encode for NSTableViewRowSizeStyle {
105 const ENCODING: Encoding = NSInteger::ENCODING;
106}
107
108unsafe impl RefEncode for NSTableViewRowSizeStyle {
109 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
110}
111
112#[repr(transparent)]
115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
116pub struct NSTableViewStyle(pub NSInteger);
117impl NSTableViewStyle {
118 #[doc(alias = "NSTableViewStyleAutomatic")]
119 pub const Automatic: Self = Self(0);
120 #[doc(alias = "NSTableViewStyleFullWidth")]
121 pub const FullWidth: Self = Self(1);
122 #[doc(alias = "NSTableViewStyleInset")]
123 pub const Inset: Self = Self(2);
124 #[doc(alias = "NSTableViewStyleSourceList")]
125 pub const SourceList: Self = Self(3);
126 #[doc(alias = "NSTableViewStylePlain")]
127 pub const Plain: Self = Self(4);
128}
129
130unsafe impl Encode for NSTableViewStyle {
131 const ENCODING: Encoding = NSInteger::ENCODING;
132}
133
134unsafe impl RefEncode for NSTableViewStyle {
135 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
136}
137
138#[repr(transparent)]
141#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
142pub struct NSTableViewSelectionHighlightStyle(pub NSInteger);
143impl NSTableViewSelectionHighlightStyle {
144 #[doc(alias = "NSTableViewSelectionHighlightStyleNone")]
145 pub const None: Self = Self(-1);
146 #[doc(alias = "NSTableViewSelectionHighlightStyleRegular")]
147 pub const Regular: Self = Self(0);
148 #[doc(alias = "NSTableViewSelectionHighlightStyleSourceList")]
149 #[deprecated = "Set the NSTableView.style property to NSTableViewStyleSourceList instead."]
150 pub const SourceList: Self = Self(1);
151}
152
153unsafe impl Encode for NSTableViewSelectionHighlightStyle {
154 const ENCODING: Encoding = NSInteger::ENCODING;
155}
156
157unsafe impl RefEncode for NSTableViewSelectionHighlightStyle {
158 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
159}
160
161#[repr(transparent)]
164#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
165pub struct NSTableViewDraggingDestinationFeedbackStyle(pub NSInteger);
166impl NSTableViewDraggingDestinationFeedbackStyle {
167 #[doc(alias = "NSTableViewDraggingDestinationFeedbackStyleNone")]
168 pub const None: Self = Self(-1);
169 #[doc(alias = "NSTableViewDraggingDestinationFeedbackStyleRegular")]
170 pub const Regular: Self = Self(0);
171 #[doc(alias = "NSTableViewDraggingDestinationFeedbackStyleSourceList")]
172 pub const SourceList: Self = Self(1);
173 #[doc(alias = "NSTableViewDraggingDestinationFeedbackStyleGap")]
174 pub const Gap: Self = Self(2);
175}
176
177unsafe impl Encode for NSTableViewDraggingDestinationFeedbackStyle {
178 const ENCODING: Encoding = NSInteger::ENCODING;
179}
180
181unsafe impl RefEncode for NSTableViewDraggingDestinationFeedbackStyle {
182 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
183}
184
185#[repr(transparent)]
188#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
189pub struct NSTableRowActionEdge(pub NSInteger);
190impl NSTableRowActionEdge {
191 #[doc(alias = "NSTableRowActionEdgeLeading")]
192 pub const Leading: Self = Self(0);
193 #[doc(alias = "NSTableRowActionEdgeTrailing")]
194 pub const Trailing: Self = Self(1);
195}
196
197unsafe impl Encode for NSTableRowActionEdge {
198 const ENCODING: Encoding = NSInteger::ENCODING;
199}
200
201unsafe impl RefEncode for NSTableRowActionEdge {
202 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
203}
204
205pub type NSTableViewAutosaveName = NSString;
207
208#[repr(transparent)]
211#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
212pub struct NSTableViewAnimationOptions(pub NSUInteger);
213bitflags::bitflags! {
214 impl NSTableViewAnimationOptions: NSUInteger {
215 #[doc(alias = "NSTableViewAnimationEffectNone")]
216 const EffectNone = 0x0;
217 #[doc(alias = "NSTableViewAnimationEffectFade")]
218 const EffectFade = 0x1;
219 #[doc(alias = "NSTableViewAnimationEffectGap")]
220 const EffectGap = 0x2;
221 #[doc(alias = "NSTableViewAnimationSlideUp")]
222 const SlideUp = 0x10;
223 #[doc(alias = "NSTableViewAnimationSlideDown")]
224 const SlideDown = 0x20;
225 #[doc(alias = "NSTableViewAnimationSlideLeft")]
226 const SlideLeft = 0x30;
227 #[doc(alias = "NSTableViewAnimationSlideRight")]
228 const SlideRight = 0x40;
229 }
230}
231
232unsafe impl Encode for NSTableViewAnimationOptions {
233 const ENCODING: Encoding = NSUInteger::ENCODING;
234}
235
236unsafe impl RefEncode for NSTableViewAnimationOptions {
237 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
238}
239
240extern_class!(
241 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
243 #[derive(Debug, PartialEq, Eq, Hash)]
244 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
245 pub struct NSTableView;
246);
247
248#[cfg(all(
249 feature = "NSAccessibilityProtocols",
250 feature = "NSControl",
251 feature = "NSResponder",
252 feature = "NSView"
253))]
254extern_conformance!(
255 unsafe impl NSAccessibility for NSTableView {}
256);
257
258#[cfg(all(
259 feature = "NSAccessibilityProtocols",
260 feature = "NSControl",
261 feature = "NSResponder",
262 feature = "NSView"
263))]
264extern_conformance!(
265 unsafe impl NSAccessibilityElementProtocol for NSTableView {}
266);
267
268#[cfg(all(
269 feature = "NSAccessibilityProtocols",
270 feature = "NSControl",
271 feature = "NSResponder",
272 feature = "NSView"
273))]
274extern_conformance!(
275 unsafe impl NSAccessibilityGroup for NSTableView {}
276);
277
278#[cfg(all(
279 feature = "NSAccessibilityProtocols",
280 feature = "NSControl",
281 feature = "NSResponder",
282 feature = "NSView"
283))]
284extern_conformance!(
285 unsafe impl NSAccessibilityTable for NSTableView {}
286);
287
288#[cfg(all(
289 feature = "NSAnimation",
290 feature = "NSControl",
291 feature = "NSResponder",
292 feature = "NSView"
293))]
294extern_conformance!(
295 unsafe impl NSAnimatablePropertyContainer for NSTableView {}
296);
297
298#[cfg(all(
299 feature = "NSAppearance",
300 feature = "NSControl",
301 feature = "NSResponder",
302 feature = "NSView"
303))]
304extern_conformance!(
305 unsafe impl NSAppearanceCustomization for NSTableView {}
306);
307
308#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
309extern_conformance!(
310 unsafe impl NSCoding for NSTableView {}
311);
312
313#[cfg(all(
314 feature = "NSControl",
315 feature = "NSDragging",
316 feature = "NSResponder",
317 feature = "NSView"
318))]
319extern_conformance!(
320 unsafe impl NSDraggingDestination for NSTableView {}
321);
322
323#[cfg(all(
324 feature = "NSControl",
325 feature = "NSDragging",
326 feature = "NSResponder",
327 feature = "NSView"
328))]
329extern_conformance!(
330 unsafe impl NSDraggingSource for NSTableView {}
331);
332
333#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
334extern_conformance!(
335 unsafe impl NSObjectProtocol for NSTableView {}
336);
337
338#[cfg(all(
339 feature = "NSControl",
340 feature = "NSResponder",
341 feature = "NSText",
342 feature = "NSView"
343))]
344extern_conformance!(
345 unsafe impl NSTextDelegate for NSTableView {}
346);
347
348#[cfg(all(
349 feature = "NSControl",
350 feature = "NSResponder",
351 feature = "NSText",
352 feature = "NSTextView",
353 feature = "NSView"
354))]
355extern_conformance!(
356 unsafe impl NSTextViewDelegate for NSTableView {}
357);
358
359#[cfg(all(
360 feature = "NSControl",
361 feature = "NSResponder",
362 feature = "NSUserInterfaceItemIdentification",
363 feature = "NSView"
364))]
365extern_conformance!(
366 unsafe impl NSUserInterfaceItemIdentification for NSTableView {}
367);
368
369#[cfg(all(
370 feature = "NSControl",
371 feature = "NSResponder",
372 feature = "NSUserInterfaceValidation",
373 feature = "NSView"
374))]
375extern_conformance!(
376 unsafe impl NSUserInterfaceValidations for NSTableView {}
377);
378
379#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
380impl NSTableView {
381 extern_methods!(
382 #[unsafe(method(initWithFrame:))]
383 #[unsafe(method_family = init)]
384 pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
385
386 #[unsafe(method(initWithCoder:))]
390 #[unsafe(method_family = init)]
391 pub unsafe fn initWithCoder(
392 this: Allocated<Self>,
393 coder: &NSCoder,
394 ) -> Option<Retained<Self>>;
395
396 #[unsafe(method(dataSource))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn dataSource(
399 &self,
400 ) -> Option<Retained<ProtocolObject<dyn NSTableViewDataSource>>>;
401
402 #[unsafe(method(setDataSource:))]
406 #[unsafe(method_family = none)]
407 pub unsafe fn setDataSource(
408 &self,
409 data_source: Option<&ProtocolObject<dyn NSTableViewDataSource>>,
410 );
411
412 #[unsafe(method(delegate))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSTableViewDelegate>>>;
415
416 #[unsafe(method(setDelegate:))]
420 #[unsafe(method_family = none)]
421 pub unsafe fn setDelegate(
422 &self,
423 delegate: Option<&ProtocolObject<dyn NSTableViewDelegate>>,
424 );
425
426 #[cfg(feature = "NSTableHeaderView")]
427 #[unsafe(method(headerView))]
428 #[unsafe(method_family = none)]
429 pub fn headerView(&self) -> Option<Retained<NSTableHeaderView>>;
430
431 #[cfg(feature = "NSTableHeaderView")]
432 #[unsafe(method(setHeaderView:))]
434 #[unsafe(method_family = none)]
435 pub fn setHeaderView(&self, header_view: Option<&NSTableHeaderView>);
436
437 #[unsafe(method(cornerView))]
438 #[unsafe(method_family = none)]
439 pub fn cornerView(&self) -> Option<Retained<NSView>>;
440
441 #[unsafe(method(setCornerView:))]
443 #[unsafe(method_family = none)]
444 pub fn setCornerView(&self, corner_view: Option<&NSView>);
445
446 #[unsafe(method(allowsColumnReordering))]
447 #[unsafe(method_family = none)]
448 pub fn allowsColumnReordering(&self) -> bool;
449
450 #[unsafe(method(setAllowsColumnReordering:))]
452 #[unsafe(method_family = none)]
453 pub fn setAllowsColumnReordering(&self, allows_column_reordering: bool);
454
455 #[unsafe(method(allowsColumnResizing))]
456 #[unsafe(method_family = none)]
457 pub fn allowsColumnResizing(&self) -> bool;
458
459 #[unsafe(method(setAllowsColumnResizing:))]
461 #[unsafe(method_family = none)]
462 pub fn setAllowsColumnResizing(&self, allows_column_resizing: bool);
463
464 #[unsafe(method(columnAutoresizingStyle))]
465 #[unsafe(method_family = none)]
466 pub fn columnAutoresizingStyle(&self) -> NSTableViewColumnAutoresizingStyle;
467
468 #[unsafe(method(setColumnAutoresizingStyle:))]
470 #[unsafe(method_family = none)]
471 pub fn setColumnAutoresizingStyle(
472 &self,
473 column_autoresizing_style: NSTableViewColumnAutoresizingStyle,
474 );
475
476 #[unsafe(method(gridStyleMask))]
477 #[unsafe(method_family = none)]
478 pub fn gridStyleMask(&self) -> NSTableViewGridLineStyle;
479
480 #[unsafe(method(setGridStyleMask:))]
482 #[unsafe(method_family = none)]
483 pub fn setGridStyleMask(&self, grid_style_mask: NSTableViewGridLineStyle);
484
485 #[unsafe(method(intercellSpacing))]
486 #[unsafe(method_family = none)]
487 pub fn intercellSpacing(&self) -> NSSize;
488
489 #[unsafe(method(setIntercellSpacing:))]
491 #[unsafe(method_family = none)]
492 pub fn setIntercellSpacing(&self, intercell_spacing: NSSize);
493
494 #[unsafe(method(usesAlternatingRowBackgroundColors))]
495 #[unsafe(method_family = none)]
496 pub fn usesAlternatingRowBackgroundColors(&self) -> bool;
497
498 #[unsafe(method(setUsesAlternatingRowBackgroundColors:))]
500 #[unsafe(method_family = none)]
501 pub fn setUsesAlternatingRowBackgroundColors(
502 &self,
503 uses_alternating_row_background_colors: bool,
504 );
505
506 #[cfg(feature = "NSColor")]
507 #[unsafe(method(backgroundColor))]
508 #[unsafe(method_family = none)]
509 pub fn backgroundColor(&self) -> Retained<NSColor>;
510
511 #[cfg(feature = "NSColor")]
512 #[unsafe(method(setBackgroundColor:))]
516 #[unsafe(method_family = none)]
517 pub fn setBackgroundColor(&self, background_color: &NSColor);
518
519 #[cfg(feature = "NSColor")]
520 #[unsafe(method(gridColor))]
521 #[unsafe(method_family = none)]
522 pub fn gridColor(&self) -> Retained<NSColor>;
523
524 #[cfg(feature = "NSColor")]
525 #[unsafe(method(setGridColor:))]
529 #[unsafe(method_family = none)]
530 pub fn setGridColor(&self, grid_color: &NSColor);
531
532 #[unsafe(method(rowSizeStyle))]
533 #[unsafe(method_family = none)]
534 pub fn rowSizeStyle(&self) -> NSTableViewRowSizeStyle;
535
536 #[unsafe(method(setRowSizeStyle:))]
538 #[unsafe(method_family = none)]
539 pub fn setRowSizeStyle(&self, row_size_style: NSTableViewRowSizeStyle);
540
541 #[unsafe(method(effectiveRowSizeStyle))]
542 #[unsafe(method_family = none)]
543 pub fn effectiveRowSizeStyle(&self) -> NSTableViewRowSizeStyle;
544
545 #[cfg(feature = "objc2-core-foundation")]
546 #[unsafe(method(rowHeight))]
547 #[unsafe(method_family = none)]
548 pub fn rowHeight(&self) -> CGFloat;
549
550 #[cfg(feature = "objc2-core-foundation")]
551 #[unsafe(method(setRowHeight:))]
553 #[unsafe(method_family = none)]
554 pub fn setRowHeight(&self, row_height: CGFloat);
555
556 #[unsafe(method(noteHeightOfRowsWithIndexesChanged:))]
557 #[unsafe(method_family = none)]
558 pub fn noteHeightOfRowsWithIndexesChanged(&self, index_set: &NSIndexSet);
559
560 #[cfg(feature = "NSTableColumn")]
561 #[unsafe(method(tableColumns))]
562 #[unsafe(method_family = none)]
563 pub fn tableColumns(&self) -> Retained<NSArray<NSTableColumn>>;
564
565 #[unsafe(method(numberOfColumns))]
566 #[unsafe(method_family = none)]
567 pub fn numberOfColumns(&self) -> NSInteger;
568
569 #[unsafe(method(numberOfRows))]
570 #[unsafe(method_family = none)]
571 pub fn numberOfRows(&self) -> NSInteger;
572
573 #[cfg(feature = "NSTableColumn")]
574 #[unsafe(method(addTableColumn:))]
575 #[unsafe(method_family = none)]
576 pub fn addTableColumn(&self, table_column: &NSTableColumn);
577
578 #[cfg(feature = "NSTableColumn")]
579 #[unsafe(method(removeTableColumn:))]
580 #[unsafe(method_family = none)]
581 pub fn removeTableColumn(&self, table_column: &NSTableColumn);
582
583 #[unsafe(method(moveColumn:toColumn:))]
584 #[unsafe(method_family = none)]
585 pub fn moveColumn_toColumn(&self, old_index: NSInteger, new_index: NSInteger);
586
587 #[cfg(feature = "NSUserInterfaceItemIdentification")]
588 #[unsafe(method(columnWithIdentifier:))]
589 #[unsafe(method_family = none)]
590 pub fn columnWithIdentifier(&self, identifier: &NSUserInterfaceItemIdentifier)
591 -> NSInteger;
592
593 #[cfg(all(
594 feature = "NSTableColumn",
595 feature = "NSUserInterfaceItemIdentification"
596 ))]
597 #[unsafe(method(tableColumnWithIdentifier:))]
598 #[unsafe(method_family = none)]
599 pub fn tableColumnWithIdentifier(
600 &self,
601 identifier: &NSUserInterfaceItemIdentifier,
602 ) -> Option<Retained<NSTableColumn>>;
603
604 #[unsafe(method(tile))]
605 #[unsafe(method_family = none)]
606 pub fn tile(&self);
607
608 #[unsafe(method(sizeToFit))]
609 #[unsafe(method_family = none)]
610 pub fn sizeToFit(&self);
611
612 #[unsafe(method(sizeLastColumnToFit))]
613 #[unsafe(method_family = none)]
614 pub fn sizeLastColumnToFit(&self);
615
616 #[unsafe(method(scrollRowToVisible:))]
617 #[unsafe(method_family = none)]
618 pub fn scrollRowToVisible(&self, row: NSInteger);
619
620 #[unsafe(method(scrollColumnToVisible:))]
621 #[unsafe(method_family = none)]
622 pub fn scrollColumnToVisible(&self, column: NSInteger);
623
624 #[unsafe(method(reloadData))]
625 #[unsafe(method_family = none)]
626 pub fn reloadData(&self);
627
628 #[unsafe(method(noteNumberOfRowsChanged))]
629 #[unsafe(method_family = none)]
630 pub fn noteNumberOfRowsChanged(&self);
631
632 #[unsafe(method(reloadDataForRowIndexes:columnIndexes:))]
633 #[unsafe(method_family = none)]
634 pub fn reloadDataForRowIndexes_columnIndexes(
635 &self,
636 row_indexes: &NSIndexSet,
637 column_indexes: &NSIndexSet,
638 );
639
640 #[unsafe(method(editedColumn))]
641 #[unsafe(method_family = none)]
642 pub fn editedColumn(&self) -> NSInteger;
643
644 #[unsafe(method(editedRow))]
645 #[unsafe(method_family = none)]
646 pub fn editedRow(&self) -> NSInteger;
647
648 #[unsafe(method(clickedColumn))]
649 #[unsafe(method_family = none)]
650 pub fn clickedColumn(&self) -> NSInteger;
651
652 #[unsafe(method(clickedRow))]
653 #[unsafe(method_family = none)]
654 pub fn clickedRow(&self) -> NSInteger;
655
656 #[unsafe(method(doubleAction))]
657 #[unsafe(method_family = none)]
658 pub fn doubleAction(&self) -> Option<Sel>;
659
660 #[unsafe(method(setDoubleAction:))]
666 #[unsafe(method_family = none)]
667 pub unsafe fn setDoubleAction(&self, double_action: Option<Sel>);
668
669 #[unsafe(method(sortDescriptors))]
670 #[unsafe(method_family = none)]
671 pub fn sortDescriptors(&self) -> Retained<NSArray<NSSortDescriptor>>;
672
673 #[unsafe(method(setSortDescriptors:))]
677 #[unsafe(method_family = none)]
678 pub fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
679
680 #[cfg(all(feature = "NSImage", feature = "NSTableColumn"))]
681 #[unsafe(method(setIndicatorImage:inTableColumn:))]
682 #[unsafe(method_family = none)]
683 pub fn setIndicatorImage_inTableColumn(
684 &self,
685 image: Option<&NSImage>,
686 table_column: &NSTableColumn,
687 );
688
689 #[cfg(all(feature = "NSImage", feature = "NSTableColumn"))]
690 #[unsafe(method(indicatorImageInTableColumn:))]
691 #[unsafe(method_family = none)]
692 pub fn indicatorImageInTableColumn(
693 &self,
694 table_column: &NSTableColumn,
695 ) -> Option<Retained<NSImage>>;
696
697 #[cfg(feature = "NSTableColumn")]
698 #[unsafe(method(highlightedTableColumn))]
699 #[unsafe(method_family = none)]
700 pub fn highlightedTableColumn(&self) -> Option<Retained<NSTableColumn>>;
701
702 #[cfg(feature = "NSTableColumn")]
703 #[unsafe(method(setHighlightedTableColumn:))]
707 #[unsafe(method_family = none)]
708 pub fn setHighlightedTableColumn(&self, highlighted_table_column: Option<&NSTableColumn>);
709
710 #[unsafe(method(verticalMotionCanBeginDrag))]
711 #[unsafe(method_family = none)]
712 pub fn verticalMotionCanBeginDrag(&self) -> bool;
713
714 #[unsafe(method(setVerticalMotionCanBeginDrag:))]
716 #[unsafe(method_family = none)]
717 pub fn setVerticalMotionCanBeginDrag(&self, vertical_motion_can_begin_drag: bool);
718
719 #[unsafe(method(canDragRowsWithIndexes:atPoint:))]
720 #[unsafe(method_family = none)]
721 pub fn canDragRowsWithIndexes_atPoint(
722 &self,
723 row_indexes: &NSIndexSet,
724 mouse_down_point: NSPoint,
725 ) -> bool;
726
727 #[cfg(all(feature = "NSEvent", feature = "NSImage", feature = "NSTableColumn"))]
728 #[unsafe(method(dragImageForRowsWithIndexes:tableColumns:event:offset:))]
732 #[unsafe(method_family = none)]
733 pub unsafe fn dragImageForRowsWithIndexes_tableColumns_event_offset(
734 &self,
735 drag_rows: &NSIndexSet,
736 table_columns: &NSArray<NSTableColumn>,
737 drag_event: &NSEvent,
738 drag_image_offset: NSPointPointer,
739 ) -> Retained<NSImage>;
740
741 #[cfg(feature = "NSDragging")]
742 #[unsafe(method(setDraggingSourceOperationMask:forLocal:))]
743 #[unsafe(method_family = none)]
744 pub fn setDraggingSourceOperationMask_forLocal(
745 &self,
746 mask: NSDragOperation,
747 is_local: bool,
748 );
749
750 #[unsafe(method(setDropRow:dropOperation:))]
751 #[unsafe(method_family = none)]
752 pub fn setDropRow_dropOperation(
753 &self,
754 row: NSInteger,
755 drop_operation: NSTableViewDropOperation,
756 );
757
758 #[unsafe(method(allowsMultipleSelection))]
759 #[unsafe(method_family = none)]
760 pub fn allowsMultipleSelection(&self) -> bool;
761
762 #[unsafe(method(setAllowsMultipleSelection:))]
764 #[unsafe(method_family = none)]
765 pub fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);
766
767 #[unsafe(method(allowsEmptySelection))]
768 #[unsafe(method_family = none)]
769 pub fn allowsEmptySelection(&self) -> bool;
770
771 #[unsafe(method(setAllowsEmptySelection:))]
773 #[unsafe(method_family = none)]
774 pub fn setAllowsEmptySelection(&self, allows_empty_selection: bool);
775
776 #[unsafe(method(allowsColumnSelection))]
777 #[unsafe(method_family = none)]
778 pub fn allowsColumnSelection(&self) -> bool;
779
780 #[unsafe(method(setAllowsColumnSelection:))]
782 #[unsafe(method_family = none)]
783 pub fn setAllowsColumnSelection(&self, allows_column_selection: bool);
784
785 #[unsafe(method(selectAll:))]
789 #[unsafe(method_family = none)]
790 pub unsafe fn selectAll(&self, sender: Option<&AnyObject>);
791
792 #[unsafe(method(deselectAll:))]
796 #[unsafe(method_family = none)]
797 pub unsafe fn deselectAll(&self, sender: Option<&AnyObject>);
798
799 #[unsafe(method(selectColumnIndexes:byExtendingSelection:))]
800 #[unsafe(method_family = none)]
801 pub fn selectColumnIndexes_byExtendingSelection(&self, indexes: &NSIndexSet, extend: bool);
802
803 #[unsafe(method(selectRowIndexes:byExtendingSelection:))]
804 #[unsafe(method_family = none)]
805 pub fn selectRowIndexes_byExtendingSelection(&self, indexes: &NSIndexSet, extend: bool);
806
807 #[unsafe(method(selectedColumnIndexes))]
808 #[unsafe(method_family = none)]
809 pub fn selectedColumnIndexes(&self) -> Retained<NSIndexSet>;
810
811 #[unsafe(method(selectedRowIndexes))]
812 #[unsafe(method_family = none)]
813 pub fn selectedRowIndexes(&self) -> Retained<NSIndexSet>;
814
815 #[unsafe(method(deselectColumn:))]
816 #[unsafe(method_family = none)]
817 pub fn deselectColumn(&self, column: NSInteger);
818
819 #[unsafe(method(deselectRow:))]
820 #[unsafe(method_family = none)]
821 pub fn deselectRow(&self, row: NSInteger);
822
823 #[unsafe(method(selectedColumn))]
824 #[unsafe(method_family = none)]
825 pub fn selectedColumn(&self) -> NSInteger;
826
827 #[unsafe(method(selectedRow))]
828 #[unsafe(method_family = none)]
829 pub fn selectedRow(&self) -> NSInteger;
830
831 #[unsafe(method(isColumnSelected:))]
832 #[unsafe(method_family = none)]
833 pub fn isColumnSelected(&self, column: NSInteger) -> bool;
834
835 #[unsafe(method(isRowSelected:))]
836 #[unsafe(method_family = none)]
837 pub fn isRowSelected(&self, row: NSInteger) -> bool;
838
839 #[unsafe(method(numberOfSelectedColumns))]
840 #[unsafe(method_family = none)]
841 pub fn numberOfSelectedColumns(&self) -> NSInteger;
842
843 #[unsafe(method(numberOfSelectedRows))]
844 #[unsafe(method_family = none)]
845 pub fn numberOfSelectedRows(&self) -> NSInteger;
846
847 #[unsafe(method(allowsTypeSelect))]
848 #[unsafe(method_family = none)]
849 pub fn allowsTypeSelect(&self) -> bool;
850
851 #[unsafe(method(setAllowsTypeSelect:))]
853 #[unsafe(method_family = none)]
854 pub fn setAllowsTypeSelect(&self, allows_type_select: bool);
855
856 #[unsafe(method(style))]
857 #[unsafe(method_family = none)]
858 pub fn style(&self) -> NSTableViewStyle;
859
860 #[unsafe(method(setStyle:))]
862 #[unsafe(method_family = none)]
863 pub fn setStyle(&self, style: NSTableViewStyle);
864
865 #[unsafe(method(effectiveStyle))]
866 #[unsafe(method_family = none)]
867 pub fn effectiveStyle(&self) -> NSTableViewStyle;
868
869 #[unsafe(method(selectionHighlightStyle))]
870 #[unsafe(method_family = none)]
871 pub fn selectionHighlightStyle(&self) -> NSTableViewSelectionHighlightStyle;
872
873 #[unsafe(method(setSelectionHighlightStyle:))]
875 #[unsafe(method_family = none)]
876 pub fn setSelectionHighlightStyle(
877 &self,
878 selection_highlight_style: NSTableViewSelectionHighlightStyle,
879 );
880
881 #[unsafe(method(draggingDestinationFeedbackStyle))]
882 #[unsafe(method_family = none)]
883 pub fn draggingDestinationFeedbackStyle(
884 &self,
885 ) -> NSTableViewDraggingDestinationFeedbackStyle;
886
887 #[unsafe(method(setDraggingDestinationFeedbackStyle:))]
889 #[unsafe(method_family = none)]
890 pub fn setDraggingDestinationFeedbackStyle(
891 &self,
892 dragging_destination_feedback_style: NSTableViewDraggingDestinationFeedbackStyle,
893 );
894
895 #[unsafe(method(rectOfColumn:))]
896 #[unsafe(method_family = none)]
897 pub fn rectOfColumn(&self, column: NSInteger) -> NSRect;
898
899 #[unsafe(method(rectOfRow:))]
900 #[unsafe(method_family = none)]
901 pub fn rectOfRow(&self, row: NSInteger) -> NSRect;
902
903 #[unsafe(method(columnIndexesInRect:))]
904 #[unsafe(method_family = none)]
905 pub fn columnIndexesInRect(&self, rect: NSRect) -> Retained<NSIndexSet>;
906
907 #[unsafe(method(rowsInRect:))]
908 #[unsafe(method_family = none)]
909 pub fn rowsInRect(&self, rect: NSRect) -> NSRange;
910
911 #[unsafe(method(columnAtPoint:))]
912 #[unsafe(method_family = none)]
913 pub fn columnAtPoint(&self, point: NSPoint) -> NSInteger;
914
915 #[unsafe(method(rowAtPoint:))]
916 #[unsafe(method_family = none)]
917 pub fn rowAtPoint(&self, point: NSPoint) -> NSInteger;
918
919 #[unsafe(method(frameOfCellAtColumn:row:))]
920 #[unsafe(method_family = none)]
921 pub fn frameOfCellAtColumn_row(&self, column: NSInteger, row: NSInteger) -> NSRect;
922
923 #[unsafe(method(autosaveName))]
924 #[unsafe(method_family = none)]
925 pub fn autosaveName(&self) -> Option<Retained<NSTableViewAutosaveName>>;
926
927 #[unsafe(method(setAutosaveName:))]
931 #[unsafe(method_family = none)]
932 pub fn setAutosaveName(&self, autosave_name: Option<&NSTableViewAutosaveName>);
933
934 #[unsafe(method(autosaveTableColumns))]
935 #[unsafe(method_family = none)]
936 pub fn autosaveTableColumns(&self) -> bool;
937
938 #[unsafe(method(setAutosaveTableColumns:))]
940 #[unsafe(method_family = none)]
941 pub fn setAutosaveTableColumns(&self, autosave_table_columns: bool);
942
943 #[cfg(feature = "NSEvent")]
944 #[unsafe(method(editColumn:row:withEvent:select:))]
945 #[unsafe(method_family = none)]
946 pub fn editColumn_row_withEvent_select(
947 &self,
948 column: NSInteger,
949 row: NSInteger,
950 event: Option<&NSEvent>,
951 select: bool,
952 );
953
954 #[unsafe(method(drawRow:clipRect:))]
955 #[unsafe(method_family = none)]
956 pub fn drawRow_clipRect(&self, row: NSInteger, clip_rect: NSRect);
957
958 #[unsafe(method(highlightSelectionInClipRect:))]
959 #[unsafe(method_family = none)]
960 pub fn highlightSelectionInClipRect(&self, clip_rect: NSRect);
961
962 #[unsafe(method(drawGridInClipRect:))]
963 #[unsafe(method_family = none)]
964 pub fn drawGridInClipRect(&self, clip_rect: NSRect);
965
966 #[unsafe(method(drawBackgroundInClipRect:))]
967 #[unsafe(method_family = none)]
968 pub fn drawBackgroundInClipRect(&self, clip_rect: NSRect);
969
970 #[unsafe(method(viewAtColumn:row:makeIfNecessary:))]
971 #[unsafe(method_family = none)]
972 pub fn viewAtColumn_row_makeIfNecessary(
973 &self,
974 column: NSInteger,
975 row: NSInteger,
976 make_if_necessary: bool,
977 ) -> Option<Retained<NSView>>;
978
979 #[cfg(feature = "NSTableRowView")]
980 #[unsafe(method(rowViewAtRow:makeIfNecessary:))]
981 #[unsafe(method_family = none)]
982 pub fn rowViewAtRow_makeIfNecessary(
983 &self,
984 row: NSInteger,
985 make_if_necessary: bool,
986 ) -> Option<Retained<NSTableRowView>>;
987
988 #[unsafe(method(rowForView:))]
989 #[unsafe(method_family = none)]
990 pub fn rowForView(&self, view: &NSView) -> NSInteger;
991
992 #[unsafe(method(columnForView:))]
993 #[unsafe(method_family = none)]
994 pub fn columnForView(&self, view: &NSView) -> NSInteger;
995
996 #[cfg(feature = "NSUserInterfaceItemIdentification")]
997 #[unsafe(method(makeViewWithIdentifier:owner:))]
1001 #[unsafe(method_family = none)]
1002 pub unsafe fn makeViewWithIdentifier_owner(
1003 &self,
1004 identifier: &NSUserInterfaceItemIdentifier,
1005 owner: Option<&AnyObject>,
1006 ) -> Option<Retained<NSView>>;
1007
1008 #[cfg(all(feature = "NSTableRowView", feature = "block2"))]
1009 #[unsafe(method(enumerateAvailableRowViewsUsingBlock:))]
1010 #[unsafe(method_family = none)]
1011 pub fn enumerateAvailableRowViewsUsingBlock(
1012 &self,
1013 handler: &block2::DynBlock<dyn Fn(NonNull<NSTableRowView>, NSInteger) + '_>,
1014 );
1015
1016 #[unsafe(method(floatsGroupRows))]
1017 #[unsafe(method_family = none)]
1018 pub fn floatsGroupRows(&self) -> bool;
1019
1020 #[unsafe(method(setFloatsGroupRows:))]
1022 #[unsafe(method_family = none)]
1023 pub fn setFloatsGroupRows(&self, floats_group_rows: bool);
1024
1025 #[unsafe(method(rowActionsVisible))]
1026 #[unsafe(method_family = none)]
1027 pub fn rowActionsVisible(&self) -> bool;
1028
1029 #[unsafe(method(setRowActionsVisible:))]
1031 #[unsafe(method_family = none)]
1032 pub fn setRowActionsVisible(&self, row_actions_visible: bool);
1033
1034 #[unsafe(method(beginUpdates))]
1035 #[unsafe(method_family = none)]
1036 pub fn beginUpdates(&self);
1037
1038 #[unsafe(method(endUpdates))]
1039 #[unsafe(method_family = none)]
1040 pub fn endUpdates(&self);
1041
1042 #[unsafe(method(insertRowsAtIndexes:withAnimation:))]
1043 #[unsafe(method_family = none)]
1044 pub fn insertRowsAtIndexes_withAnimation(
1045 &self,
1046 indexes: &NSIndexSet,
1047 animation_options: NSTableViewAnimationOptions,
1048 );
1049
1050 #[unsafe(method(removeRowsAtIndexes:withAnimation:))]
1051 #[unsafe(method_family = none)]
1052 pub fn removeRowsAtIndexes_withAnimation(
1053 &self,
1054 indexes: &NSIndexSet,
1055 animation_options: NSTableViewAnimationOptions,
1056 );
1057
1058 #[unsafe(method(moveRowAtIndex:toIndex:))]
1059 #[unsafe(method_family = none)]
1060 pub fn moveRowAtIndex_toIndex(&self, old_index: NSInteger, new_index: NSInteger);
1061
1062 #[unsafe(method(hideRowsAtIndexes:withAnimation:))]
1063 #[unsafe(method_family = none)]
1064 pub fn hideRowsAtIndexes_withAnimation(
1065 &self,
1066 indexes: &NSIndexSet,
1067 row_animation: NSTableViewAnimationOptions,
1068 );
1069
1070 #[unsafe(method(unhideRowsAtIndexes:withAnimation:))]
1071 #[unsafe(method_family = none)]
1072 pub fn unhideRowsAtIndexes_withAnimation(
1073 &self,
1074 indexes: &NSIndexSet,
1075 row_animation: NSTableViewAnimationOptions,
1076 );
1077
1078 #[unsafe(method(hiddenRowIndexes))]
1079 #[unsafe(method_family = none)]
1080 pub fn hiddenRowIndexes(&self) -> Retained<NSIndexSet>;
1081
1082 #[cfg(all(feature = "NSNib", feature = "NSUserInterfaceItemIdentification"))]
1083 #[unsafe(method(registerNib:forIdentifier:))]
1084 #[unsafe(method_family = none)]
1085 pub fn registerNib_forIdentifier(
1086 &self,
1087 nib: Option<&NSNib>,
1088 identifier: &NSUserInterfaceItemIdentifier,
1089 );
1090
1091 #[cfg(all(feature = "NSNib", feature = "NSUserInterfaceItemIdentification"))]
1092 #[unsafe(method(registeredNibsByIdentifier))]
1093 #[unsafe(method_family = none)]
1094 pub fn registeredNibsByIdentifier(
1095 &self,
1096 ) -> Option<Retained<NSDictionary<NSUserInterfaceItemIdentifier, NSNib>>>;
1097
1098 #[cfg(feature = "NSTableRowView")]
1099 #[unsafe(method(didAddRowView:forRow:))]
1100 #[unsafe(method_family = none)]
1101 pub fn didAddRowView_forRow(&self, row_view: &NSTableRowView, row: NSInteger);
1102
1103 #[cfg(feature = "NSTableRowView")]
1104 #[unsafe(method(didRemoveRowView:forRow:))]
1105 #[unsafe(method_family = none)]
1106 pub fn didRemoveRowView_forRow(&self, row_view: &NSTableRowView, row: NSInteger);
1107
1108 #[unsafe(method(usesStaticContents))]
1109 #[unsafe(method_family = none)]
1110 pub fn usesStaticContents(&self) -> bool;
1111
1112 #[unsafe(method(setUsesStaticContents:))]
1114 #[unsafe(method_family = none)]
1115 pub fn setUsesStaticContents(&self, uses_static_contents: bool);
1116
1117 #[cfg(feature = "NSUserInterfaceLayout")]
1118 #[unsafe(method(userInterfaceLayoutDirection))]
1119 #[unsafe(method_family = none)]
1120 pub fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
1121
1122 #[cfg(feature = "NSUserInterfaceLayout")]
1123 #[unsafe(method(setUserInterfaceLayoutDirection:))]
1125 #[unsafe(method_family = none)]
1126 pub fn setUserInterfaceLayoutDirection(
1127 &self,
1128 user_interface_layout_direction: NSUserInterfaceLayoutDirection,
1129 );
1130
1131 #[unsafe(method(usesAutomaticRowHeights))]
1132 #[unsafe(method_family = none)]
1133 pub fn usesAutomaticRowHeights(&self) -> bool;
1134
1135 #[unsafe(method(setUsesAutomaticRowHeights:))]
1137 #[unsafe(method_family = none)]
1138 pub fn setUsesAutomaticRowHeights(&self, uses_automatic_row_heights: bool);
1139 );
1140}
1141
1142#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1144impl NSTableView {
1145 extern_methods!(
1146 #[unsafe(method(init))]
1147 #[unsafe(method_family = init)]
1148 pub fn init(this: Allocated<Self>) -> Retained<Self>;
1149 );
1150}
1151
1152#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1154impl NSTableView {
1155 extern_methods!(
1156 #[unsafe(method(new))]
1157 #[unsafe(method_family = new)]
1158 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
1159 );
1160}
1161
1162extern_protocol!(
1163 #[cfg(feature = "NSControl")]
1165 pub unsafe trait NSTableViewDelegate: NSControlTextEditingDelegate {
1166 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1167 #[optional]
1168 #[unsafe(method(tableView:viewForTableColumn:row:))]
1169 #[unsafe(method_family = none)]
1170 fn tableView_viewForTableColumn_row(
1171 &self,
1172 table_view: &NSTableView,
1173 table_column: Option<&NSTableColumn>,
1174 row: NSInteger,
1175 ) -> Option<Retained<NSView>>;
1176
1177 #[cfg(all(
1178 feature = "NSResponder",
1179 feature = "NSTableRowView",
1180 feature = "NSView"
1181 ))]
1182 #[optional]
1183 #[unsafe(method(tableView:rowViewForRow:))]
1184 #[unsafe(method_family = none)]
1185 fn tableView_rowViewForRow(
1186 &self,
1187 table_view: &NSTableView,
1188 row: NSInteger,
1189 ) -> Option<Retained<NSTableRowView>>;
1190
1191 #[cfg(all(
1192 feature = "NSResponder",
1193 feature = "NSTableRowView",
1194 feature = "NSView"
1195 ))]
1196 #[optional]
1197 #[unsafe(method(tableView:didAddRowView:forRow:))]
1198 #[unsafe(method_family = none)]
1199 fn tableView_didAddRowView_forRow(
1200 &self,
1201 table_view: &NSTableView,
1202 row_view: &NSTableRowView,
1203 row: NSInteger,
1204 );
1205
1206 #[cfg(all(
1207 feature = "NSResponder",
1208 feature = "NSTableRowView",
1209 feature = "NSView"
1210 ))]
1211 #[optional]
1212 #[unsafe(method(tableView:didRemoveRowView:forRow:))]
1213 #[unsafe(method_family = none)]
1214 fn tableView_didRemoveRowView_forRow(
1215 &self,
1216 table_view: &NSTableView,
1217 row_view: &NSTableRowView,
1218 row: NSInteger,
1219 );
1220
1221 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1222 #[optional]
1226 #[unsafe(method(tableView:willDisplayCell:forTableColumn:row:))]
1227 #[unsafe(method_family = none)]
1228 unsafe fn tableView_willDisplayCell_forTableColumn_row(
1229 &self,
1230 table_view: &NSTableView,
1231 cell: &AnyObject,
1232 table_column: Option<&NSTableColumn>,
1233 row: NSInteger,
1234 );
1235
1236 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1237 #[optional]
1238 #[unsafe(method(tableView:shouldEditTableColumn:row:))]
1239 #[unsafe(method_family = none)]
1240 fn tableView_shouldEditTableColumn_row(
1241 &self,
1242 table_view: &NSTableView,
1243 table_column: Option<&NSTableColumn>,
1244 row: NSInteger,
1245 ) -> bool;
1246
1247 #[cfg(all(
1248 feature = "NSCell",
1249 feature = "NSResponder",
1250 feature = "NSTableColumn",
1251 feature = "NSView"
1252 ))]
1253 #[optional]
1257 #[unsafe(method(tableView:toolTipForCell:rect:tableColumn:row:mouseLocation:))]
1258 #[unsafe(method_family = none)]
1259 unsafe fn tableView_toolTipForCell_rect_tableColumn_row_mouseLocation(
1260 &self,
1261 table_view: &NSTableView,
1262 cell: &NSCell,
1263 rect: NSRectPointer,
1264 table_column: Option<&NSTableColumn>,
1265 row: NSInteger,
1266 mouse_location: NSPoint,
1267 ) -> Retained<NSString>;
1268
1269 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1270 #[optional]
1271 #[unsafe(method(tableView:shouldShowCellExpansionForTableColumn:row:))]
1272 #[unsafe(method_family = none)]
1273 fn tableView_shouldShowCellExpansionForTableColumn_row(
1274 &self,
1275 table_view: &NSTableView,
1276 table_column: Option<&NSTableColumn>,
1277 row: NSInteger,
1278 ) -> bool;
1279
1280 #[cfg(all(
1281 feature = "NSCell",
1282 feature = "NSResponder",
1283 feature = "NSTableColumn",
1284 feature = "NSView"
1285 ))]
1286 #[optional]
1287 #[unsafe(method(tableView:shouldTrackCell:forTableColumn:row:))]
1288 #[unsafe(method_family = none)]
1289 fn tableView_shouldTrackCell_forTableColumn_row(
1290 &self,
1291 table_view: &NSTableView,
1292 cell: &NSCell,
1293 table_column: Option<&NSTableColumn>,
1294 row: NSInteger,
1295 ) -> bool;
1296
1297 #[cfg(all(
1298 feature = "NSCell",
1299 feature = "NSResponder",
1300 feature = "NSTableColumn",
1301 feature = "NSView"
1302 ))]
1303 #[optional]
1304 #[unsafe(method(tableView:dataCellForTableColumn:row:))]
1305 #[unsafe(method_family = none)]
1306 fn tableView_dataCellForTableColumn_row(
1307 &self,
1308 table_view: &NSTableView,
1309 table_column: Option<&NSTableColumn>,
1310 row: NSInteger,
1311 ) -> Option<Retained<NSCell>>;
1312
1313 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1314 #[optional]
1315 #[unsafe(method(selectionShouldChangeInTableView:))]
1316 #[unsafe(method_family = none)]
1317 fn selectionShouldChangeInTableView(&self, table_view: &NSTableView) -> bool;
1318
1319 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1320 #[optional]
1321 #[unsafe(method(tableView:shouldSelectRow:))]
1322 #[unsafe(method_family = none)]
1323 fn tableView_shouldSelectRow(&self, table_view: &NSTableView, row: NSInteger) -> bool;
1324
1325 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1326 #[optional]
1327 #[unsafe(method(tableView:selectionIndexesForProposedSelection:))]
1328 #[unsafe(method_family = none)]
1329 fn tableView_selectionIndexesForProposedSelection(
1330 &self,
1331 table_view: &NSTableView,
1332 proposed_selection_indexes: &NSIndexSet,
1333 ) -> Retained<NSIndexSet>;
1334
1335 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1336 #[optional]
1337 #[unsafe(method(tableView:shouldSelectTableColumn:))]
1338 #[unsafe(method_family = none)]
1339 fn tableView_shouldSelectTableColumn(
1340 &self,
1341 table_view: &NSTableView,
1342 table_column: Option<&NSTableColumn>,
1343 ) -> bool;
1344
1345 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1346 #[optional]
1347 #[unsafe(method(tableView:mouseDownInHeaderOfTableColumn:))]
1348 #[unsafe(method_family = none)]
1349 fn tableView_mouseDownInHeaderOfTableColumn(
1350 &self,
1351 table_view: &NSTableView,
1352 table_column: &NSTableColumn,
1353 );
1354
1355 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1356 #[optional]
1357 #[unsafe(method(tableView:didClickTableColumn:))]
1358 #[unsafe(method_family = none)]
1359 fn tableView_didClickTableColumn(
1360 &self,
1361 table_view: &NSTableView,
1362 table_column: &NSTableColumn,
1363 );
1364
1365 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1366 #[optional]
1367 #[unsafe(method(tableView:didDragTableColumn:))]
1368 #[unsafe(method_family = none)]
1369 fn tableView_didDragTableColumn(
1370 &self,
1371 table_view: &NSTableView,
1372 table_column: &NSTableColumn,
1373 );
1374
1375 #[cfg(all(
1376 feature = "NSResponder",
1377 feature = "NSView",
1378 feature = "objc2-core-foundation"
1379 ))]
1380 #[optional]
1381 #[unsafe(method(tableView:heightOfRow:))]
1382 #[unsafe(method_family = none)]
1383 fn tableView_heightOfRow(&self, table_view: &NSTableView, row: NSInteger) -> CGFloat;
1384
1385 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1386 #[optional]
1387 #[unsafe(method(tableView:typeSelectStringForTableColumn:row:))]
1388 #[unsafe(method_family = none)]
1389 fn tableView_typeSelectStringForTableColumn_row(
1390 &self,
1391 table_view: &NSTableView,
1392 table_column: Option<&NSTableColumn>,
1393 row: NSInteger,
1394 ) -> Option<Retained<NSString>>;
1395
1396 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1397 #[optional]
1398 #[unsafe(method(tableView:nextTypeSelectMatchFromRow:toRow:forString:))]
1399 #[unsafe(method_family = none)]
1400 fn tableView_nextTypeSelectMatchFromRow_toRow_forString(
1401 &self,
1402 table_view: &NSTableView,
1403 start_row: NSInteger,
1404 end_row: NSInteger,
1405 search_string: &NSString,
1406 ) -> NSInteger;
1407
1408 #[cfg(all(feature = "NSEvent", feature = "NSResponder", feature = "NSView"))]
1409 #[optional]
1410 #[unsafe(method(tableView:shouldTypeSelectForEvent:withCurrentSearchString:))]
1411 #[unsafe(method_family = none)]
1412 fn tableView_shouldTypeSelectForEvent_withCurrentSearchString(
1413 &self,
1414 table_view: &NSTableView,
1415 event: &NSEvent,
1416 search_string: Option<&NSString>,
1417 ) -> bool;
1418
1419 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1420 #[optional]
1421 #[unsafe(method(tableView:isGroupRow:))]
1422 #[unsafe(method_family = none)]
1423 fn tableView_isGroupRow(&self, table_view: &NSTableView, row: NSInteger) -> bool;
1424
1425 #[cfg(all(
1426 feature = "NSResponder",
1427 feature = "NSView",
1428 feature = "objc2-core-foundation"
1429 ))]
1430 #[optional]
1431 #[unsafe(method(tableView:sizeToFitWidthOfColumn:))]
1432 #[unsafe(method_family = none)]
1433 fn tableView_sizeToFitWidthOfColumn(
1434 &self,
1435 table_view: &NSTableView,
1436 column: NSInteger,
1437 ) -> CGFloat;
1438
1439 #[cfg(all(feature = "NSResponder", feature = "NSView"))]
1440 #[optional]
1441 #[unsafe(method(tableView:shouldReorderColumn:toColumn:))]
1442 #[unsafe(method_family = none)]
1443 fn tableView_shouldReorderColumn_toColumn(
1444 &self,
1445 table_view: &NSTableView,
1446 column_index: NSInteger,
1447 new_column_index: NSInteger,
1448 ) -> bool;
1449
1450 #[cfg(all(
1451 feature = "NSResponder",
1452 feature = "NSTableViewRowAction",
1453 feature = "NSView"
1454 ))]
1455 #[optional]
1456 #[unsafe(method(tableView:rowActionsForRow:edge:))]
1457 #[unsafe(method_family = none)]
1458 fn tableView_rowActionsForRow_edge(
1459 &self,
1460 table_view: &NSTableView,
1461 row: NSInteger,
1462 edge: NSTableRowActionEdge,
1463 ) -> Retained<NSArray<NSTableViewRowAction>>;
1464
1465 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1466 #[optional]
1467 #[unsafe(method(tableView:userCanChangeVisibilityOfTableColumn:))]
1468 #[unsafe(method_family = none)]
1469 fn tableView_userCanChangeVisibilityOfTableColumn(
1470 &self,
1471 table_view: &NSTableView,
1472 column: &NSTableColumn,
1473 ) -> bool;
1474
1475 #[cfg(all(feature = "NSResponder", feature = "NSTableColumn", feature = "NSView"))]
1476 #[optional]
1477 #[unsafe(method(tableView:userDidChangeVisibilityOfTableColumns:))]
1478 #[unsafe(method_family = none)]
1479 fn tableView_userDidChangeVisibilityOfTableColumns(
1480 &self,
1481 table_view: &NSTableView,
1482 columns: &NSArray<NSTableColumn>,
1483 );
1484
1485 #[optional]
1486 #[unsafe(method(tableViewSelectionDidChange:))]
1487 #[unsafe(method_family = none)]
1488 fn tableViewSelectionDidChange(&self, notification: &NSNotification);
1489
1490 #[optional]
1491 #[unsafe(method(tableViewColumnDidMove:))]
1492 #[unsafe(method_family = none)]
1493 fn tableViewColumnDidMove(&self, notification: &NSNotification);
1494
1495 #[optional]
1496 #[unsafe(method(tableViewColumnDidResize:))]
1497 #[unsafe(method_family = none)]
1498 fn tableViewColumnDidResize(&self, notification: &NSNotification);
1499
1500 #[optional]
1501 #[unsafe(method(tableViewSelectionIsChanging:))]
1502 #[unsafe(method_family = none)]
1503 fn tableViewSelectionIsChanging(&self, notification: &NSNotification);
1504 }
1505);
1506
1507extern "C" {
1508 pub static NSTableViewSelectionDidChangeNotification: &'static NSNotificationName;
1510}
1511
1512extern "C" {
1513 pub static NSTableViewColumnDidMoveNotification: &'static NSNotificationName;
1515}
1516
1517extern "C" {
1518 pub static NSTableViewColumnDidResizeNotification: &'static NSNotificationName;
1520}
1521
1522extern "C" {
1523 pub static NSTableViewSelectionIsChangingNotification: &'static NSNotificationName;
1525}
1526
1527extern "C" {
1528 #[cfg(feature = "NSUserInterfaceItemIdentification")]
1530 pub static NSTableViewRowViewKey: &'static NSUserInterfaceItemIdentifier;
1531}
1532
1533extern_protocol!(
1534 pub unsafe trait NSTableViewDataSource: NSObjectProtocol {
1536 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1537 #[optional]
1538 #[unsafe(method(numberOfRowsInTableView:))]
1539 #[unsafe(method_family = none)]
1540 fn numberOfRowsInTableView(&self, table_view: &NSTableView) -> NSInteger;
1541
1542 #[cfg(all(
1543 feature = "NSControl",
1544 feature = "NSResponder",
1545 feature = "NSTableColumn",
1546 feature = "NSView"
1547 ))]
1548 #[optional]
1549 #[unsafe(method(tableView:objectValueForTableColumn:row:))]
1550 #[unsafe(method_family = none)]
1551 fn tableView_objectValueForTableColumn_row(
1552 &self,
1553 table_view: &NSTableView,
1554 table_column: Option<&NSTableColumn>,
1555 row: NSInteger,
1556 ) -> Option<Retained<AnyObject>>;
1557
1558 #[cfg(all(
1559 feature = "NSControl",
1560 feature = "NSResponder",
1561 feature = "NSTableColumn",
1562 feature = "NSView"
1563 ))]
1564 #[optional]
1568 #[unsafe(method(tableView:setObjectValue:forTableColumn:row:))]
1569 #[unsafe(method_family = none)]
1570 unsafe fn tableView_setObjectValue_forTableColumn_row(
1571 &self,
1572 table_view: &NSTableView,
1573 object: Option<&AnyObject>,
1574 table_column: Option<&NSTableColumn>,
1575 row: NSInteger,
1576 );
1577
1578 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1579 #[optional]
1580 #[unsafe(method(tableView:sortDescriptorsDidChange:))]
1581 #[unsafe(method_family = none)]
1582 fn tableView_sortDescriptorsDidChange(
1583 &self,
1584 table_view: &NSTableView,
1585 old_descriptors: &NSArray<NSSortDescriptor>,
1586 );
1587
1588 #[cfg(all(
1589 feature = "NSControl",
1590 feature = "NSPasteboard",
1591 feature = "NSResponder",
1592 feature = "NSView"
1593 ))]
1594 #[optional]
1595 #[unsafe(method(tableView:pasteboardWriterForRow:))]
1596 #[unsafe(method_family = none)]
1597 fn tableView_pasteboardWriterForRow(
1598 &self,
1599 table_view: &NSTableView,
1600 row: NSInteger,
1601 ) -> Option<Retained<ProtocolObject<dyn NSPasteboardWriting>>>;
1602
1603 #[cfg(all(
1604 feature = "NSControl",
1605 feature = "NSDraggingSession",
1606 feature = "NSResponder",
1607 feature = "NSView"
1608 ))]
1609 #[optional]
1610 #[unsafe(method(tableView:draggingSession:willBeginAtPoint:forRowIndexes:))]
1611 #[unsafe(method_family = none)]
1612 fn tableView_draggingSession_willBeginAtPoint_forRowIndexes(
1613 &self,
1614 table_view: &NSTableView,
1615 session: &NSDraggingSession,
1616 screen_point: NSPoint,
1617 row_indexes: &NSIndexSet,
1618 );
1619
1620 #[cfg(all(
1621 feature = "NSControl",
1622 feature = "NSDragging",
1623 feature = "NSDraggingSession",
1624 feature = "NSResponder",
1625 feature = "NSView"
1626 ))]
1627 #[optional]
1628 #[unsafe(method(tableView:draggingSession:endedAtPoint:operation:))]
1629 #[unsafe(method_family = none)]
1630 fn tableView_draggingSession_endedAtPoint_operation(
1631 &self,
1632 table_view: &NSTableView,
1633 session: &NSDraggingSession,
1634 screen_point: NSPoint,
1635 operation: NSDragOperation,
1636 );
1637
1638 #[cfg(all(
1639 feature = "NSControl",
1640 feature = "NSDragging",
1641 feature = "NSResponder",
1642 feature = "NSView"
1643 ))]
1644 #[optional]
1645 #[unsafe(method(tableView:updateDraggingItemsForDrag:))]
1646 #[unsafe(method_family = none)]
1647 fn tableView_updateDraggingItemsForDrag(
1648 &self,
1649 table_view: &NSTableView,
1650 dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
1651 );
1652
1653 #[cfg(all(
1654 feature = "NSControl",
1655 feature = "NSPasteboard",
1656 feature = "NSResponder",
1657 feature = "NSView"
1658 ))]
1659 #[deprecated = "Use -tableView:pasteboardWriterForRow: instead"]
1660 #[optional]
1661 #[unsafe(method(tableView:writeRowsWithIndexes:toPasteboard:))]
1662 #[unsafe(method_family = none)]
1663 fn tableView_writeRowsWithIndexes_toPasteboard(
1664 &self,
1665 table_view: &NSTableView,
1666 row_indexes: &NSIndexSet,
1667 pboard: &NSPasteboard,
1668 ) -> bool;
1669
1670 #[cfg(all(
1671 feature = "NSControl",
1672 feature = "NSDragging",
1673 feature = "NSResponder",
1674 feature = "NSView"
1675 ))]
1676 #[optional]
1677 #[unsafe(method(tableView:validateDrop:proposedRow:proposedDropOperation:))]
1678 #[unsafe(method_family = none)]
1679 fn tableView_validateDrop_proposedRow_proposedDropOperation(
1680 &self,
1681 table_view: &NSTableView,
1682 info: &ProtocolObject<dyn NSDraggingInfo>,
1683 row: NSInteger,
1684 drop_operation: NSTableViewDropOperation,
1685 ) -> NSDragOperation;
1686
1687 #[cfg(all(
1688 feature = "NSControl",
1689 feature = "NSDragging",
1690 feature = "NSResponder",
1691 feature = "NSView"
1692 ))]
1693 #[optional]
1694 #[unsafe(method(tableView:acceptDrop:row:dropOperation:))]
1695 #[unsafe(method_family = none)]
1696 fn tableView_acceptDrop_row_dropOperation(
1697 &self,
1698 table_view: &NSTableView,
1699 info: &ProtocolObject<dyn NSDraggingInfo>,
1700 row: NSInteger,
1701 drop_operation: NSTableViewDropOperation,
1702 ) -> bool;
1703
1704 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1705 #[deprecated = "Use NSFilePromiseReceiver objects instead"]
1706 #[optional]
1707 #[unsafe(method(tableView:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:))]
1708 #[unsafe(method_family = none)]
1709 fn tableView_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes(
1710 &self,
1711 table_view: &NSTableView,
1712 drop_destination: &NSURL,
1713 index_set: &NSIndexSet,
1714 ) -> Retained<NSArray<NSString>>;
1715 }
1716);
1717
1718#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1720impl NSTableView {
1721 extern_methods!(
1722 #[deprecated]
1723 #[unsafe(method(setDrawsGrid:))]
1724 #[unsafe(method_family = none)]
1725 pub fn setDrawsGrid(&self, flag: bool);
1726
1727 #[deprecated]
1728 #[unsafe(method(drawsGrid))]
1729 #[unsafe(method_family = none)]
1730 pub fn drawsGrid(&self) -> bool;
1731
1732 #[deprecated]
1733 #[unsafe(method(selectColumn:byExtendingSelection:))]
1734 #[unsafe(method_family = none)]
1735 pub fn selectColumn_byExtendingSelection(&self, column: NSInteger, extend: bool);
1736
1737 #[deprecated]
1738 #[unsafe(method(selectRow:byExtendingSelection:))]
1739 #[unsafe(method_family = none)]
1740 pub fn selectRow_byExtendingSelection(&self, row: NSInteger, extend: bool);
1741
1742 #[deprecated]
1746 #[unsafe(method(selectedColumnEnumerator))]
1747 #[unsafe(method_family = none)]
1748 pub unsafe fn selectedColumnEnumerator(&self) -> Retained<NSEnumerator>;
1749
1750 #[deprecated]
1754 #[unsafe(method(selectedRowEnumerator))]
1755 #[unsafe(method_family = none)]
1756 pub unsafe fn selectedRowEnumerator(&self) -> Retained<NSEnumerator>;
1757
1758 #[cfg(all(feature = "NSEvent", feature = "NSImage"))]
1759 #[deprecated]
1764 #[unsafe(method(dragImageForRows:event:dragImageOffset:))]
1765 #[unsafe(method_family = none)]
1766 pub unsafe fn dragImageForRows_event_dragImageOffset(
1767 &self,
1768 drag_rows: &NSArray,
1769 drag_event: &NSEvent,
1770 drag_image_offset: NSPointPointer,
1771 ) -> Option<Retained<NSImage>>;
1772
1773 #[deprecated]
1774 #[unsafe(method(setAutoresizesAllColumnsToFit:))]
1775 #[unsafe(method_family = none)]
1776 pub fn setAutoresizesAllColumnsToFit(&self, flag: bool);
1777
1778 #[deprecated]
1779 #[unsafe(method(autoresizesAllColumnsToFit))]
1780 #[unsafe(method_family = none)]
1781 pub fn autoresizesAllColumnsToFit(&self) -> bool;
1782
1783 #[deprecated]
1784 #[unsafe(method(columnsInRect:))]
1785 #[unsafe(method_family = none)]
1786 pub fn columnsInRect(&self, rect: NSRect) -> NSRange;
1787
1788 #[cfg(feature = "NSCell")]
1789 #[deprecated = "Use View Based TableView and -viewAtColumn:row:"]
1790 #[unsafe(method(preparedCellAtColumn:row:))]
1791 #[unsafe(method_family = none)]
1792 pub fn preparedCellAtColumn_row(
1793 &self,
1794 column: NSInteger,
1795 row: NSInteger,
1796 ) -> Option<Retained<NSCell>>;
1797
1798 #[cfg(feature = "NSText")]
1799 #[deprecated = "Use a View Based TableView with an NSTextField"]
1800 #[unsafe(method(textShouldBeginEditing:))]
1801 #[unsafe(method_family = none)]
1802 pub fn textShouldBeginEditing(&self, text_object: &NSText) -> bool;
1803
1804 #[cfg(feature = "NSText")]
1805 #[deprecated = "Use a View Based TableView with an NSTextField"]
1806 #[unsafe(method(textShouldEndEditing:))]
1807 #[unsafe(method_family = none)]
1808 pub fn textShouldEndEditing(&self, text_object: &NSText) -> bool;
1809
1810 #[deprecated = "Use a View Based TableView with an NSTextField"]
1811 #[unsafe(method(textDidBeginEditing:))]
1812 #[unsafe(method_family = none)]
1813 pub fn textDidBeginEditing(&self, notification: &NSNotification);
1814
1815 #[deprecated = "Use a View Based TableView with an NSTextField"]
1816 #[unsafe(method(textDidEndEditing:))]
1817 #[unsafe(method_family = none)]
1818 pub fn textDidEndEditing(&self, notification: &NSNotification);
1819
1820 #[deprecated = "Use a View Based TableView with an NSTextField"]
1821 #[unsafe(method(textDidChange:))]
1822 #[unsafe(method_family = none)]
1823 pub fn textDidChange(&self, notification: &NSNotification);
1824
1825 #[cfg(feature = "NSCell")]
1826 #[deprecated = "Use a View Based TableView; observe the window’s firstResponder for focus change notifications"]
1827 #[unsafe(method(shouldFocusCell:atColumn:row:))]
1828 #[unsafe(method_family = none)]
1829 pub fn shouldFocusCell_atColumn_row(
1830 &self,
1831 cell: &NSCell,
1832 column: NSInteger,
1833 row: NSInteger,
1834 ) -> bool;
1835
1836 #[deprecated = "Use a View Based TableView and observe the window.firstResponder"]
1837 #[unsafe(method(focusedColumn))]
1838 #[unsafe(method_family = none)]
1839 pub fn focusedColumn(&self) -> NSInteger;
1840
1841 #[deprecated = "Use a View Based TableView; make a particular view the first responder with [window makeFirstResponder:view] to focus it."]
1842 #[unsafe(method(setFocusedColumn:))]
1843 #[unsafe(method_family = none)]
1844 pub fn setFocusedColumn(&self, focused_column: NSInteger);
1845
1846 #[deprecated = "Use a View Based TableView; directly interact with a particular view as required and call -performClick: on it, if necessary"]
1847 #[unsafe(method(performClickOnCellAtColumn:row:))]
1848 #[unsafe(method_family = none)]
1849 pub fn performClickOnCellAtColumn_row(&self, column: NSInteger, row: NSInteger);
1850 );
1851}