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#[cfg(feature = "NSApplication")]
14pub static NSAppKitVersionNumberWithContinuousScrollingBrowser: NSAppKitVersion = 680.0 as _;
15
16#[cfg(feature = "NSApplication")]
18pub static NSAppKitVersionNumberWithColumnResizingBrowser: NSAppKitVersion = 685.0 as _;
19
20pub type NSBrowserColumnsAutosaveName = NSString;
22
23#[repr(transparent)]
26#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
27pub struct NSBrowserColumnResizingType(pub NSUInteger);
28impl NSBrowserColumnResizingType {
29 #[doc(alias = "NSBrowserNoColumnResizing")]
30 pub const NoColumnResizing: Self = Self(0);
31 #[doc(alias = "NSBrowserAutoColumnResizing")]
32 pub const AutoColumnResizing: Self = Self(1);
33 #[doc(alias = "NSBrowserUserColumnResizing")]
34 pub const UserColumnResizing: Self = Self(2);
35}
36
37unsafe impl Encode for NSBrowserColumnResizingType {
38 const ENCODING: Encoding = NSUInteger::ENCODING;
39}
40
41unsafe impl RefEncode for NSBrowserColumnResizingType {
42 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
43}
44
45#[repr(transparent)]
48#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
49pub struct NSBrowserDropOperation(pub NSUInteger);
50impl NSBrowserDropOperation {
51 #[doc(alias = "NSBrowserDropOn")]
52 pub const On: Self = Self(0);
53 #[doc(alias = "NSBrowserDropAbove")]
54 pub const Above: Self = Self(1);
55}
56
57unsafe impl Encode for NSBrowserDropOperation {
58 const ENCODING: Encoding = NSUInteger::ENCODING;
59}
60
61unsafe impl RefEncode for NSBrowserDropOperation {
62 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
63}
64
65extern_class!(
66 #[unsafe(super(NSControl, NSView, NSResponder, NSObject))]
68 #[derive(Debug, PartialEq, Eq, Hash)]
69 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
70 pub struct NSBrowser;
71);
72
73#[cfg(all(
74 feature = "NSAccessibilityProtocols",
75 feature = "NSControl",
76 feature = "NSResponder",
77 feature = "NSView"
78))]
79extern_conformance!(
80 unsafe impl NSAccessibility for NSBrowser {}
81);
82
83#[cfg(all(
84 feature = "NSAccessibilityProtocols",
85 feature = "NSControl",
86 feature = "NSResponder",
87 feature = "NSView"
88))]
89extern_conformance!(
90 unsafe impl NSAccessibilityElementProtocol for NSBrowser {}
91);
92
93#[cfg(all(
94 feature = "NSAnimation",
95 feature = "NSControl",
96 feature = "NSResponder",
97 feature = "NSView"
98))]
99extern_conformance!(
100 unsafe impl NSAnimatablePropertyContainer for NSBrowser {}
101);
102
103#[cfg(all(
104 feature = "NSAppearance",
105 feature = "NSControl",
106 feature = "NSResponder",
107 feature = "NSView"
108))]
109extern_conformance!(
110 unsafe impl NSAppearanceCustomization for NSBrowser {}
111);
112
113#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
114extern_conformance!(
115 unsafe impl NSCoding for NSBrowser {}
116);
117
118#[cfg(all(
119 feature = "NSControl",
120 feature = "NSDragging",
121 feature = "NSResponder",
122 feature = "NSView"
123))]
124extern_conformance!(
125 unsafe impl NSDraggingDestination for NSBrowser {}
126);
127
128#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
129extern_conformance!(
130 unsafe impl NSObjectProtocol for NSBrowser {}
131);
132
133#[cfg(all(
134 feature = "NSControl",
135 feature = "NSResponder",
136 feature = "NSUserInterfaceItemIdentification",
137 feature = "NSView"
138))]
139extern_conformance!(
140 unsafe impl NSUserInterfaceItemIdentification for NSBrowser {}
141);
142
143#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
144impl NSBrowser {
145 extern_methods!(
146 #[unsafe(method(cellClass))]
147 #[unsafe(method_family = none)]
148 pub fn cellClass(mtm: MainThreadMarker) -> &'static AnyClass;
149
150 #[unsafe(method(loadColumnZero))]
151 #[unsafe(method_family = none)]
152 pub fn loadColumnZero(&self);
153
154 #[unsafe(method(isLoaded))]
155 #[unsafe(method_family = none)]
156 pub fn isLoaded(&self) -> bool;
157
158 #[unsafe(method(doubleAction))]
159 #[unsafe(method_family = none)]
160 pub fn doubleAction(&self) -> Option<Sel>;
161
162 #[unsafe(method(setDoubleAction:))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn setDoubleAction(&self, double_action: Option<Sel>);
170
171 #[unsafe(method(setCellClass:))]
175 #[unsafe(method_family = none)]
176 pub unsafe fn setCellClass(&self, factory_id: &AnyClass);
177
178 #[unsafe(method(cellPrototype))]
179 #[unsafe(method_family = none)]
180 pub fn cellPrototype(&self) -> Option<Retained<AnyObject>>;
181
182 #[unsafe(method(setCellPrototype:))]
189 #[unsafe(method_family = none)]
190 pub unsafe fn setCellPrototype(&self, cell_prototype: Option<&AnyObject>);
191
192 #[unsafe(method(delegate))]
193 #[unsafe(method_family = none)]
194 pub fn delegate(&self) -> Option<Retained<ProtocolObject<dyn NSBrowserDelegate>>>;
195
196 #[unsafe(method(setDelegate:))]
200 #[unsafe(method_family = none)]
201 pub fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn NSBrowserDelegate>>);
202
203 #[unsafe(method(reusesColumns))]
204 #[unsafe(method_family = none)]
205 pub fn reusesColumns(&self) -> bool;
206
207 #[unsafe(method(setReusesColumns:))]
209 #[unsafe(method_family = none)]
210 pub fn setReusesColumns(&self, reuses_columns: bool);
211
212 #[unsafe(method(hasHorizontalScroller))]
213 #[unsafe(method_family = none)]
214 pub fn hasHorizontalScroller(&self) -> bool;
215
216 #[unsafe(method(setHasHorizontalScroller:))]
218 #[unsafe(method_family = none)]
219 pub fn setHasHorizontalScroller(&self, has_horizontal_scroller: bool);
220
221 #[unsafe(method(autohidesScroller))]
222 #[unsafe(method_family = none)]
223 pub fn autohidesScroller(&self) -> bool;
224
225 #[unsafe(method(setAutohidesScroller:))]
227 #[unsafe(method_family = none)]
228 pub fn setAutohidesScroller(&self, autohides_scroller: bool);
229
230 #[unsafe(method(separatesColumns))]
231 #[unsafe(method_family = none)]
232 pub fn separatesColumns(&self) -> bool;
233
234 #[unsafe(method(setSeparatesColumns:))]
236 #[unsafe(method_family = none)]
237 pub fn setSeparatesColumns(&self, separates_columns: bool);
238
239 #[unsafe(method(isTitled))]
240 #[unsafe(method_family = none)]
241 pub fn isTitled(&self) -> bool;
242
243 #[unsafe(method(setTitled:))]
245 #[unsafe(method_family = none)]
246 pub fn setTitled(&self, titled: bool);
247
248 #[cfg(feature = "objc2-core-foundation")]
249 #[unsafe(method(minColumnWidth))]
250 #[unsafe(method_family = none)]
251 pub fn minColumnWidth(&self) -> CGFloat;
252
253 #[cfg(feature = "objc2-core-foundation")]
254 #[unsafe(method(setMinColumnWidth:))]
256 #[unsafe(method_family = none)]
257 pub fn setMinColumnWidth(&self, min_column_width: CGFloat);
258
259 #[unsafe(method(maxVisibleColumns))]
260 #[unsafe(method_family = none)]
261 pub fn maxVisibleColumns(&self) -> NSInteger;
262
263 #[unsafe(method(setMaxVisibleColumns:))]
265 #[unsafe(method_family = none)]
266 pub fn setMaxVisibleColumns(&self, max_visible_columns: NSInteger);
267
268 #[unsafe(method(allowsMultipleSelection))]
269 #[unsafe(method_family = none)]
270 pub fn allowsMultipleSelection(&self) -> bool;
271
272 #[unsafe(method(setAllowsMultipleSelection:))]
274 #[unsafe(method_family = none)]
275 pub fn setAllowsMultipleSelection(&self, allows_multiple_selection: bool);
276
277 #[unsafe(method(allowsBranchSelection))]
278 #[unsafe(method_family = none)]
279 pub fn allowsBranchSelection(&self) -> bool;
280
281 #[unsafe(method(setAllowsBranchSelection:))]
283 #[unsafe(method_family = none)]
284 pub fn setAllowsBranchSelection(&self, allows_branch_selection: bool);
285
286 #[unsafe(method(allowsEmptySelection))]
287 #[unsafe(method_family = none)]
288 pub fn allowsEmptySelection(&self) -> bool;
289
290 #[unsafe(method(setAllowsEmptySelection:))]
292 #[unsafe(method_family = none)]
293 pub fn setAllowsEmptySelection(&self, allows_empty_selection: bool);
294
295 #[unsafe(method(takesTitleFromPreviousColumn))]
296 #[unsafe(method_family = none)]
297 pub fn takesTitleFromPreviousColumn(&self) -> bool;
298
299 #[unsafe(method(setTakesTitleFromPreviousColumn:))]
301 #[unsafe(method_family = none)]
302 pub fn setTakesTitleFromPreviousColumn(&self, takes_title_from_previous_column: bool);
303
304 #[unsafe(method(sendsActionOnArrowKeys))]
305 #[unsafe(method_family = none)]
306 pub fn sendsActionOnArrowKeys(&self) -> bool;
307
308 #[unsafe(method(setSendsActionOnArrowKeys:))]
310 #[unsafe(method_family = none)]
311 pub fn setSendsActionOnArrowKeys(&self, sends_action_on_arrow_keys: bool);
312
313 #[unsafe(method(itemAtIndexPath:))]
314 #[unsafe(method_family = none)]
315 pub fn itemAtIndexPath(&self, index_path: &NSIndexPath) -> Option<Retained<AnyObject>>;
316
317 #[unsafe(method(itemAtRow:inColumn:))]
318 #[unsafe(method_family = none)]
319 pub fn itemAtRow_inColumn(
320 &self,
321 row: NSInteger,
322 column: NSInteger,
323 ) -> Option<Retained<AnyObject>>;
324
325 #[unsafe(method(indexPathForColumn:))]
326 #[unsafe(method_family = none)]
327 pub fn indexPathForColumn(&self, column: NSInteger) -> Retained<NSIndexPath>;
328
329 #[unsafe(method(isLeafItem:))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn isLeafItem(&self, item: Option<&AnyObject>) -> bool;
335
336 #[unsafe(method(reloadDataForRowIndexes:inColumn:))]
337 #[unsafe(method_family = none)]
338 pub fn reloadDataForRowIndexes_inColumn(&self, row_indexes: &NSIndexSet, column: NSInteger);
339
340 #[unsafe(method(parentForItemsInColumn:))]
341 #[unsafe(method_family = none)]
342 pub fn parentForItemsInColumn(&self, column: NSInteger) -> Option<Retained<AnyObject>>;
343
344 #[unsafe(method(scrollRowToVisible:inColumn:))]
345 #[unsafe(method_family = none)]
346 pub fn scrollRowToVisible_inColumn(&self, row: NSInteger, column: NSInteger);
347
348 #[unsafe(method(setTitle:ofColumn:))]
349 #[unsafe(method_family = none)]
350 pub fn setTitle_ofColumn(&self, string: &NSString, column: NSInteger);
351
352 #[unsafe(method(titleOfColumn:))]
353 #[unsafe(method_family = none)]
354 pub fn titleOfColumn(&self, column: NSInteger) -> Option<Retained<NSString>>;
355
356 #[unsafe(method(pathSeparator))]
357 #[unsafe(method_family = none)]
358 pub fn pathSeparator(&self) -> Retained<NSString>;
359
360 #[unsafe(method(setPathSeparator:))]
364 #[unsafe(method_family = none)]
365 pub fn setPathSeparator(&self, path_separator: &NSString);
366
367 #[unsafe(method(setPath:))]
368 #[unsafe(method_family = none)]
369 pub fn setPath(&self, path: &NSString) -> bool;
370
371 #[unsafe(method(path))]
372 #[unsafe(method_family = none)]
373 pub fn path(&self) -> Retained<NSString>;
374
375 #[unsafe(method(pathToColumn:))]
376 #[unsafe(method_family = none)]
377 pub fn pathToColumn(&self, column: NSInteger) -> Retained<NSString>;
378
379 #[unsafe(method(clickedColumn))]
380 #[unsafe(method_family = none)]
381 pub fn clickedColumn(&self) -> NSInteger;
382
383 #[unsafe(method(clickedRow))]
384 #[unsafe(method_family = none)]
385 pub fn clickedRow(&self) -> NSInteger;
386
387 #[unsafe(method(selectedColumn))]
388 #[unsafe(method_family = none)]
389 pub fn selectedColumn(&self) -> NSInteger;
390
391 #[unsafe(method(selectedCell))]
392 #[unsafe(method_family = none)]
393 pub fn selectedCell(&self) -> Option<Retained<AnyObject>>;
394
395 #[unsafe(method(selectedCellInColumn:))]
396 #[unsafe(method_family = none)]
397 pub fn selectedCellInColumn(&self, column: NSInteger) -> Option<Retained<AnyObject>>;
398
399 #[cfg(feature = "NSCell")]
400 #[unsafe(method(selectedCells))]
401 #[unsafe(method_family = none)]
402 pub fn selectedCells(&self) -> Option<Retained<NSArray<NSCell>>>;
403
404 #[unsafe(method(selectRow:inColumn:))]
405 #[unsafe(method_family = none)]
406 pub fn selectRow_inColumn(&self, row: NSInteger, column: NSInteger);
407
408 #[unsafe(method(selectedRowInColumn:))]
409 #[unsafe(method_family = none)]
410 pub fn selectedRowInColumn(&self, column: NSInteger) -> NSInteger;
411
412 #[unsafe(method(selectionIndexPath))]
413 #[unsafe(method_family = none)]
414 pub fn selectionIndexPath(&self) -> Option<Retained<NSIndexPath>>;
415
416 #[unsafe(method(setSelectionIndexPath:))]
420 #[unsafe(method_family = none)]
421 pub fn setSelectionIndexPath(&self, selection_index_path: Option<&NSIndexPath>);
422
423 #[unsafe(method(selectionIndexPaths))]
424 #[unsafe(method_family = none)]
425 pub fn selectionIndexPaths(&self) -> Retained<NSArray<NSIndexPath>>;
426
427 #[unsafe(method(setSelectionIndexPaths:))]
431 #[unsafe(method_family = none)]
432 pub fn setSelectionIndexPaths(&self, selection_index_paths: &NSArray<NSIndexPath>);
433
434 #[unsafe(method(selectRowIndexes:inColumn:))]
435 #[unsafe(method_family = none)]
436 pub fn selectRowIndexes_inColumn(&self, indexes: &NSIndexSet, column: NSInteger);
437
438 #[unsafe(method(selectedRowIndexesInColumn:))]
439 #[unsafe(method_family = none)]
440 pub fn selectedRowIndexesInColumn(&self, column: NSInteger)
441 -> Option<Retained<NSIndexSet>>;
442
443 #[unsafe(method(reloadColumn:))]
444 #[unsafe(method_family = none)]
445 pub fn reloadColumn(&self, column: NSInteger);
446
447 #[unsafe(method(validateVisibleColumns))]
448 #[unsafe(method_family = none)]
449 pub fn validateVisibleColumns(&self);
450
451 #[unsafe(method(scrollColumnsRightBy:))]
452 #[unsafe(method_family = none)]
453 pub fn scrollColumnsRightBy(&self, shift_amount: NSInteger);
454
455 #[unsafe(method(scrollColumnsLeftBy:))]
456 #[unsafe(method_family = none)]
457 pub fn scrollColumnsLeftBy(&self, shift_amount: NSInteger);
458
459 #[unsafe(method(scrollColumnToVisible:))]
460 #[unsafe(method_family = none)]
461 pub fn scrollColumnToVisible(&self, column: NSInteger);
462
463 #[unsafe(method(lastColumn))]
464 #[unsafe(method_family = none)]
465 pub fn lastColumn(&self) -> NSInteger;
466
467 #[unsafe(method(setLastColumn:))]
469 #[unsafe(method_family = none)]
470 pub fn setLastColumn(&self, last_column: NSInteger);
471
472 #[unsafe(method(addColumn))]
473 #[unsafe(method_family = none)]
474 pub fn addColumn(&self);
475
476 #[unsafe(method(numberOfVisibleColumns))]
477 #[unsafe(method_family = none)]
478 pub fn numberOfVisibleColumns(&self) -> NSInteger;
479
480 #[unsafe(method(firstVisibleColumn))]
481 #[unsafe(method_family = none)]
482 pub fn firstVisibleColumn(&self) -> NSInteger;
483
484 #[unsafe(method(lastVisibleColumn))]
485 #[unsafe(method_family = none)]
486 pub fn lastVisibleColumn(&self) -> NSInteger;
487
488 #[unsafe(method(loadedCellAtRow:column:))]
489 #[unsafe(method_family = none)]
490 pub fn loadedCellAtRow_column(
491 &self,
492 row: NSInteger,
493 col: NSInteger,
494 ) -> Option<Retained<AnyObject>>;
495
496 #[unsafe(method(selectAll:))]
500 #[unsafe(method_family = none)]
501 pub unsafe fn selectAll(&self, sender: Option<&AnyObject>);
502
503 #[unsafe(method(tile))]
504 #[unsafe(method_family = none)]
505 pub fn tile(&self);
506
507 #[unsafe(method(doClick:))]
511 #[unsafe(method_family = none)]
512 pub unsafe fn doClick(&self, sender: Option<&AnyObject>);
513
514 #[unsafe(method(doDoubleClick:))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn doDoubleClick(&self, sender: Option<&AnyObject>);
520
521 #[unsafe(method(sendAction))]
522 #[unsafe(method_family = none)]
523 pub fn sendAction(&self) -> bool;
524
525 #[unsafe(method(titleFrameOfColumn:))]
526 #[unsafe(method_family = none)]
527 pub fn titleFrameOfColumn(&self, column: NSInteger) -> NSRect;
528
529 #[unsafe(method(drawTitleOfColumn:inRect:))]
530 #[unsafe(method_family = none)]
531 pub fn drawTitleOfColumn_inRect(&self, column: NSInteger, rect: NSRect);
532
533 #[cfg(feature = "objc2-core-foundation")]
534 #[unsafe(method(titleHeight))]
535 #[unsafe(method_family = none)]
536 pub fn titleHeight(&self) -> CGFloat;
537
538 #[unsafe(method(frameOfColumn:))]
539 #[unsafe(method_family = none)]
540 pub fn frameOfColumn(&self, column: NSInteger) -> NSRect;
541
542 #[unsafe(method(frameOfInsideOfColumn:))]
543 #[unsafe(method_family = none)]
544 pub fn frameOfInsideOfColumn(&self, column: NSInteger) -> NSRect;
545
546 #[unsafe(method(frameOfRow:inColumn:))]
547 #[unsafe(method_family = none)]
548 pub fn frameOfRow_inColumn(&self, row: NSInteger, column: NSInteger) -> NSRect;
549
550 #[unsafe(method(getRow:column:forPoint:))]
555 #[unsafe(method_family = none)]
556 pub unsafe fn getRow_column_forPoint(
557 &self,
558 row: *mut NSInteger,
559 column: *mut NSInteger,
560 point: NSPoint,
561 ) -> bool;
562
563 #[cfg(feature = "objc2-core-foundation")]
564 #[unsafe(method(columnWidthForColumnContentWidth:))]
565 #[unsafe(method_family = none)]
566 pub fn columnWidthForColumnContentWidth(&self, column_content_width: CGFloat) -> CGFloat;
567
568 #[cfg(feature = "objc2-core-foundation")]
569 #[unsafe(method(columnContentWidthForColumnWidth:))]
570 #[unsafe(method_family = none)]
571 pub fn columnContentWidthForColumnWidth(&self, column_width: CGFloat) -> CGFloat;
572
573 #[unsafe(method(columnResizingType))]
574 #[unsafe(method_family = none)]
575 pub fn columnResizingType(&self) -> NSBrowserColumnResizingType;
576
577 #[unsafe(method(setColumnResizingType:))]
579 #[unsafe(method_family = none)]
580 pub fn setColumnResizingType(&self, column_resizing_type: NSBrowserColumnResizingType);
581
582 #[unsafe(method(prefersAllColumnUserResizing))]
583 #[unsafe(method_family = none)]
584 pub fn prefersAllColumnUserResizing(&self) -> bool;
585
586 #[unsafe(method(setPrefersAllColumnUserResizing:))]
588 #[unsafe(method_family = none)]
589 pub fn setPrefersAllColumnUserResizing(&self, prefers_all_column_user_resizing: bool);
590
591 #[cfg(feature = "objc2-core-foundation")]
592 #[unsafe(method(setWidth:ofColumn:))]
593 #[unsafe(method_family = none)]
594 pub fn setWidth_ofColumn(&self, column_width: CGFloat, column_index: NSInteger);
595
596 #[cfg(feature = "objc2-core-foundation")]
597 #[unsafe(method(widthOfColumn:))]
598 #[unsafe(method_family = none)]
599 pub fn widthOfColumn(&self, column: NSInteger) -> CGFloat;
600
601 #[cfg(feature = "objc2-core-foundation")]
602 #[unsafe(method(rowHeight))]
603 #[unsafe(method_family = none)]
604 pub fn rowHeight(&self) -> CGFloat;
605
606 #[cfg(feature = "objc2-core-foundation")]
607 #[unsafe(method(setRowHeight:))]
609 #[unsafe(method_family = none)]
610 pub fn setRowHeight(&self, row_height: CGFloat);
611
612 #[unsafe(method(noteHeightOfRowsWithIndexesChanged:inColumn:))]
613 #[unsafe(method_family = none)]
614 pub fn noteHeightOfRowsWithIndexesChanged_inColumn(
615 &self,
616 index_set: &NSIndexSet,
617 column_index: NSInteger,
618 );
619
620 #[cfg(feature = "objc2-core-foundation")]
621 #[unsafe(method(setDefaultColumnWidth:))]
622 #[unsafe(method_family = none)]
623 pub fn setDefaultColumnWidth(&self, column_width: CGFloat);
624
625 #[cfg(feature = "objc2-core-foundation")]
626 #[unsafe(method(defaultColumnWidth))]
627 #[unsafe(method_family = none)]
628 pub fn defaultColumnWidth(&self) -> CGFloat;
629
630 #[unsafe(method(columnsAutosaveName))]
631 #[unsafe(method_family = none)]
632 pub fn columnsAutosaveName(&self) -> Retained<NSBrowserColumnsAutosaveName>;
633
634 #[unsafe(method(setColumnsAutosaveName:))]
638 #[unsafe(method_family = none)]
639 pub fn setColumnsAutosaveName(&self, columns_autosave_name: &NSBrowserColumnsAutosaveName);
640
641 #[unsafe(method(removeSavedColumnsWithAutosaveName:))]
642 #[unsafe(method_family = none)]
643 pub fn removeSavedColumnsWithAutosaveName(
644 name: &NSBrowserColumnsAutosaveName,
645 mtm: MainThreadMarker,
646 );
647
648 #[cfg(feature = "NSEvent")]
649 #[unsafe(method(canDragRowsWithIndexes:inColumn:withEvent:))]
650 #[unsafe(method_family = none)]
651 pub fn canDragRowsWithIndexes_inColumn_withEvent(
652 &self,
653 row_indexes: &NSIndexSet,
654 column: NSInteger,
655 event: &NSEvent,
656 ) -> bool;
657
658 #[cfg(all(feature = "NSEvent", feature = "NSImage"))]
659 #[unsafe(method(draggingImageForRowsWithIndexes:inColumn:withEvent:offset:))]
663 #[unsafe(method_family = none)]
664 pub unsafe fn draggingImageForRowsWithIndexes_inColumn_withEvent_offset(
665 &self,
666 row_indexes: &NSIndexSet,
667 column: NSInteger,
668 event: &NSEvent,
669 drag_image_offset: NSPointPointer,
670 ) -> Option<Retained<NSImage>>;
671
672 #[cfg(feature = "NSDragging")]
673 #[unsafe(method(setDraggingSourceOperationMask:forLocal:))]
674 #[unsafe(method_family = none)]
675 pub fn setDraggingSourceOperationMask_forLocal(
676 &self,
677 mask: NSDragOperation,
678 is_local: bool,
679 );
680
681 #[unsafe(method(allowsTypeSelect))]
682 #[unsafe(method_family = none)]
683 pub fn allowsTypeSelect(&self) -> bool;
684
685 #[unsafe(method(setAllowsTypeSelect:))]
687 #[unsafe(method_family = none)]
688 pub fn setAllowsTypeSelect(&self, allows_type_select: bool);
689
690 #[cfg(feature = "NSColor")]
691 #[unsafe(method(backgroundColor))]
692 #[unsafe(method_family = none)]
693 pub fn backgroundColor(&self) -> Retained<NSColor>;
694
695 #[cfg(feature = "NSColor")]
696 #[unsafe(method(setBackgroundColor:))]
698 #[unsafe(method_family = none)]
699 pub fn setBackgroundColor(&self, background_color: &NSColor);
700
701 #[cfg(feature = "NSEvent")]
702 #[unsafe(method(editItemAtIndexPath:withEvent:select:))]
703 #[unsafe(method_family = none)]
704 pub fn editItemAtIndexPath_withEvent_select(
705 &self,
706 index_path: &NSIndexPath,
707 event: Option<&NSEvent>,
708 select: bool,
709 );
710 );
711}
712
713#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
715impl NSBrowser {
716 extern_methods!(
717 #[unsafe(method(initWithFrame:))]
718 #[unsafe(method_family = init)]
719 pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
720
721 #[unsafe(method(initWithCoder:))]
725 #[unsafe(method_family = init)]
726 pub unsafe fn initWithCoder(
727 this: Allocated<Self>,
728 coder: &NSCoder,
729 ) -> Option<Retained<Self>>;
730 );
731}
732
733#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
735impl NSBrowser {
736 extern_methods!(
737 #[unsafe(method(init))]
738 #[unsafe(method_family = init)]
739 pub fn init(this: Allocated<Self>) -> Retained<Self>;
740 );
741}
742
743#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
745impl NSBrowser {
746 extern_methods!(
747 #[unsafe(method(new))]
748 #[unsafe(method_family = new)]
749 pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
750 );
751}
752
753extern "C" {
754 pub static NSBrowserColumnConfigurationDidChangeNotification: &'static NSNotificationName;
756}
757
758extern_protocol!(
759 pub unsafe trait NSBrowserDelegate: NSObjectProtocol + MainThreadOnly {
761 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
762 #[optional]
763 #[unsafe(method(browser:numberOfRowsInColumn:))]
764 #[unsafe(method_family = none)]
765 fn browser_numberOfRowsInColumn(&self, sender: &NSBrowser, column: NSInteger) -> NSInteger;
766
767 #[cfg(all(
768 feature = "NSControl",
769 feature = "NSMatrix",
770 feature = "NSResponder",
771 feature = "NSView"
772 ))]
773 #[optional]
774 #[unsafe(method(browser:createRowsForColumn:inMatrix:))]
775 #[unsafe(method_family = none)]
776 fn browser_createRowsForColumn_inMatrix(
777 &self,
778 sender: &NSBrowser,
779 column: NSInteger,
780 matrix: &NSMatrix,
781 );
782
783 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
784 #[optional]
788 #[unsafe(method(browser:numberOfChildrenOfItem:))]
789 #[unsafe(method_family = none)]
790 unsafe fn browser_numberOfChildrenOfItem(
791 &self,
792 browser: &NSBrowser,
793 item: Option<&AnyObject>,
794 ) -> NSInteger;
795
796 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
797 #[optional]
801 #[unsafe(method(browser:child:ofItem:))]
802 #[unsafe(method_family = none)]
803 unsafe fn browser_child_ofItem(
804 &self,
805 browser: &NSBrowser,
806 index: NSInteger,
807 item: Option<&AnyObject>,
808 ) -> Retained<AnyObject>;
809
810 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
811 #[optional]
815 #[unsafe(method(browser:isLeafItem:))]
816 #[unsafe(method_family = none)]
817 unsafe fn browser_isLeafItem(&self, browser: &NSBrowser, item: Option<&AnyObject>) -> bool;
818
819 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
820 #[optional]
824 #[unsafe(method(browser:objectValueForItem:))]
825 #[unsafe(method_family = none)]
826 unsafe fn browser_objectValueForItem(
827 &self,
828 browser: &NSBrowser,
829 item: Option<&AnyObject>,
830 ) -> Option<Retained<AnyObject>>;
831
832 #[cfg(all(
833 feature = "NSControl",
834 feature = "NSResponder",
835 feature = "NSView",
836 feature = "objc2-core-foundation"
837 ))]
838 #[optional]
839 #[unsafe(method(browser:heightOfRow:inColumn:))]
840 #[unsafe(method_family = none)]
841 fn browser_heightOfRow_inColumn(
842 &self,
843 browser: &NSBrowser,
844 row: NSInteger,
845 column_index: NSInteger,
846 ) -> CGFloat;
847
848 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
849 #[optional]
850 #[unsafe(method(rootItemForBrowser:))]
851 #[unsafe(method_family = none)]
852 fn rootItemForBrowser(&self, browser: &NSBrowser) -> Option<Retained<AnyObject>>;
853
854 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
855 #[optional]
860 #[unsafe(method(browser:setObjectValue:forItem:))]
861 #[unsafe(method_family = none)]
862 unsafe fn browser_setObjectValue_forItem(
863 &self,
864 browser: &NSBrowser,
865 object: Option<&AnyObject>,
866 item: Option<&AnyObject>,
867 );
868
869 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
870 #[optional]
874 #[unsafe(method(browser:shouldEditItem:))]
875 #[unsafe(method_family = none)]
876 unsafe fn browser_shouldEditItem(
877 &self,
878 browser: &NSBrowser,
879 item: Option<&AnyObject>,
880 ) -> bool;
881
882 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
883 #[optional]
887 #[unsafe(method(browser:willDisplayCell:atRow:column:))]
888 #[unsafe(method_family = none)]
889 unsafe fn browser_willDisplayCell_atRow_column(
890 &self,
891 sender: &NSBrowser,
892 cell: &AnyObject,
893 row: NSInteger,
894 column: NSInteger,
895 );
896
897 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
898 #[optional]
899 #[unsafe(method(browser:titleOfColumn:))]
900 #[unsafe(method_family = none)]
901 fn browser_titleOfColumn(
902 &self,
903 sender: &NSBrowser,
904 column: NSInteger,
905 ) -> Option<Retained<NSString>>;
906
907 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
908 #[optional]
909 #[unsafe(method(browser:selectCellWithString:inColumn:))]
910 #[unsafe(method_family = none)]
911 fn browser_selectCellWithString_inColumn(
912 &self,
913 sender: &NSBrowser,
914 title: &NSString,
915 column: NSInteger,
916 ) -> bool;
917
918 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
919 #[optional]
920 #[unsafe(method(browser:selectRow:inColumn:))]
921 #[unsafe(method_family = none)]
922 fn browser_selectRow_inColumn(
923 &self,
924 sender: &NSBrowser,
925 row: NSInteger,
926 column: NSInteger,
927 ) -> bool;
928
929 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
930 #[optional]
931 #[unsafe(method(browser:isColumnValid:))]
932 #[unsafe(method_family = none)]
933 fn browser_isColumnValid(&self, sender: &NSBrowser, column: NSInteger) -> bool;
934
935 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
936 #[optional]
937 #[unsafe(method(browserWillScroll:))]
938 #[unsafe(method_family = none)]
939 fn browserWillScroll(&self, sender: &NSBrowser);
940
941 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
942 #[optional]
943 #[unsafe(method(browserDidScroll:))]
944 #[unsafe(method_family = none)]
945 fn browserDidScroll(&self, sender: &NSBrowser);
946
947 #[cfg(all(
948 feature = "NSControl",
949 feature = "NSResponder",
950 feature = "NSView",
951 feature = "objc2-core-foundation"
952 ))]
953 #[optional]
954 #[unsafe(method(browser:shouldSizeColumn:forUserResize:toWidth:))]
955 #[unsafe(method_family = none)]
956 fn browser_shouldSizeColumn_forUserResize_toWidth(
957 &self,
958 browser: &NSBrowser,
959 column_index: NSInteger,
960 for_user_resize: bool,
961 suggested_width: CGFloat,
962 ) -> CGFloat;
963
964 #[cfg(all(
965 feature = "NSControl",
966 feature = "NSResponder",
967 feature = "NSView",
968 feature = "objc2-core-foundation"
969 ))]
970 #[optional]
971 #[unsafe(method(browser:sizeToFitWidthOfColumn:))]
972 #[unsafe(method_family = none)]
973 fn browser_sizeToFitWidthOfColumn(
974 &self,
975 browser: &NSBrowser,
976 column_index: NSInteger,
977 ) -> CGFloat;
978
979 #[optional]
980 #[unsafe(method(browserColumnConfigurationDidChange:))]
981 #[unsafe(method_family = none)]
982 fn browserColumnConfigurationDidChange(&self, notification: &NSNotification);
983
984 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
985 #[optional]
986 #[unsafe(method(browser:shouldShowCellExpansionForRow:column:))]
987 #[unsafe(method_family = none)]
988 fn browser_shouldShowCellExpansionForRow_column(
989 &self,
990 browser: &NSBrowser,
991 row: NSInteger,
992 column: NSInteger,
993 ) -> bool;
994
995 #[cfg(all(
996 feature = "NSControl",
997 feature = "NSPasteboard",
998 feature = "NSResponder",
999 feature = "NSView"
1000 ))]
1001 #[optional]
1002 #[unsafe(method(browser:writeRowsWithIndexes:inColumn:toPasteboard:))]
1003 #[unsafe(method_family = none)]
1004 fn browser_writeRowsWithIndexes_inColumn_toPasteboard(
1005 &self,
1006 browser: &NSBrowser,
1007 row_indexes: &NSIndexSet,
1008 column: NSInteger,
1009 pasteboard: &NSPasteboard,
1010 ) -> bool;
1011
1012 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1013 #[deprecated = "Use NSFilePromiseReceiver objects instead"]
1014 #[optional]
1015 #[unsafe(method(browser:namesOfPromisedFilesDroppedAtDestination:forDraggedRowsWithIndexes:inColumn:))]
1016 #[unsafe(method_family = none)]
1017 fn browser_namesOfPromisedFilesDroppedAtDestination_forDraggedRowsWithIndexes_inColumn(
1018 &self,
1019 browser: &NSBrowser,
1020 drop_destination: &NSURL,
1021 row_indexes: &NSIndexSet,
1022 column: NSInteger,
1023 ) -> Retained<NSArray<NSString>>;
1024
1025 #[cfg(all(
1026 feature = "NSControl",
1027 feature = "NSEvent",
1028 feature = "NSResponder",
1029 feature = "NSView"
1030 ))]
1031 #[optional]
1032 #[unsafe(method(browser:canDragRowsWithIndexes:inColumn:withEvent:))]
1033 #[unsafe(method_family = none)]
1034 fn browser_canDragRowsWithIndexes_inColumn_withEvent(
1035 &self,
1036 browser: &NSBrowser,
1037 row_indexes: &NSIndexSet,
1038 column: NSInteger,
1039 event: &NSEvent,
1040 ) -> bool;
1041
1042 #[cfg(all(
1043 feature = "NSControl",
1044 feature = "NSEvent",
1045 feature = "NSImage",
1046 feature = "NSResponder",
1047 feature = "NSView"
1048 ))]
1049 #[optional]
1053 #[unsafe(method(browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:))]
1054 #[unsafe(method_family = none)]
1055 unsafe fn browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset(
1056 &self,
1057 browser: &NSBrowser,
1058 row_indexes: &NSIndexSet,
1059 column: NSInteger,
1060 event: &NSEvent,
1061 drag_image_offset: NSPointPointer,
1062 ) -> Option<Retained<NSImage>>;
1063
1064 #[cfg(all(
1065 feature = "NSControl",
1066 feature = "NSDragging",
1067 feature = "NSResponder",
1068 feature = "NSView"
1069 ))]
1070 #[optional]
1076 #[unsafe(method(browser:validateDrop:proposedRow:column:dropOperation:))]
1077 #[unsafe(method_family = none)]
1078 unsafe fn browser_validateDrop_proposedRow_column_dropOperation(
1079 &self,
1080 browser: &NSBrowser,
1081 info: &ProtocolObject<dyn NSDraggingInfo>,
1082 row: NonNull<NSInteger>,
1083 column: NonNull<NSInteger>,
1084 drop_operation: NonNull<NSBrowserDropOperation>,
1085 ) -> NSDragOperation;
1086
1087 #[cfg(all(
1088 feature = "NSControl",
1089 feature = "NSDragging",
1090 feature = "NSResponder",
1091 feature = "NSView"
1092 ))]
1093 #[optional]
1094 #[unsafe(method(browser:acceptDrop:atRow:column:dropOperation:))]
1095 #[unsafe(method_family = none)]
1096 fn browser_acceptDrop_atRow_column_dropOperation(
1097 &self,
1098 browser: &NSBrowser,
1099 info: &ProtocolObject<dyn NSDraggingInfo>,
1100 row: NSInteger,
1101 column: NSInteger,
1102 drop_operation: NSBrowserDropOperation,
1103 ) -> bool;
1104
1105 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1106 #[optional]
1107 #[unsafe(method(browser:typeSelectStringForRow:inColumn:))]
1108 #[unsafe(method_family = none)]
1109 fn browser_typeSelectStringForRow_inColumn(
1110 &self,
1111 browser: &NSBrowser,
1112 row: NSInteger,
1113 column: NSInteger,
1114 ) -> Option<Retained<NSString>>;
1115
1116 #[cfg(all(
1117 feature = "NSControl",
1118 feature = "NSEvent",
1119 feature = "NSResponder",
1120 feature = "NSView"
1121 ))]
1122 #[optional]
1123 #[unsafe(method(browser:shouldTypeSelectForEvent:withCurrentSearchString:))]
1124 #[unsafe(method_family = none)]
1125 fn browser_shouldTypeSelectForEvent_withCurrentSearchString(
1126 &self,
1127 browser: &NSBrowser,
1128 event: &NSEvent,
1129 search_string: Option<&NSString>,
1130 ) -> bool;
1131
1132 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1133 #[optional]
1134 #[unsafe(method(browser:nextTypeSelectMatchFromRow:toRow:inColumn:forString:))]
1135 #[unsafe(method_family = none)]
1136 fn browser_nextTypeSelectMatchFromRow_toRow_inColumn_forString(
1137 &self,
1138 browser: &NSBrowser,
1139 start_row: NSInteger,
1140 end_row: NSInteger,
1141 column: NSInteger,
1142 search_string: Option<&NSString>,
1143 ) -> NSInteger;
1144
1145 #[cfg(all(
1146 feature = "NSControl",
1147 feature = "NSResponder",
1148 feature = "NSView",
1149 feature = "NSViewController"
1150 ))]
1151 #[optional]
1155 #[unsafe(method(browser:previewViewControllerForLeafItem:))]
1156 #[unsafe(method_family = none)]
1157 unsafe fn browser_previewViewControllerForLeafItem(
1158 &self,
1159 browser: &NSBrowser,
1160 item: &AnyObject,
1161 ) -> Option<Retained<NSViewController>>;
1162
1163 #[cfg(all(
1164 feature = "NSControl",
1165 feature = "NSResponder",
1166 feature = "NSView",
1167 feature = "NSViewController"
1168 ))]
1169 #[optional]
1173 #[unsafe(method(browser:headerViewControllerForItem:))]
1174 #[unsafe(method_family = none)]
1175 unsafe fn browser_headerViewControllerForItem(
1176 &self,
1177 browser: &NSBrowser,
1178 item: Option<&AnyObject>,
1179 ) -> Option<Retained<NSViewController>>;
1180
1181 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1182 #[optional]
1183 #[unsafe(method(browser:didChangeLastColumn:toColumn:))]
1184 #[unsafe(method_family = none)]
1185 fn browser_didChangeLastColumn_toColumn(
1186 &self,
1187 browser: &NSBrowser,
1188 old_last_column: NSInteger,
1189 column: NSInteger,
1190 );
1191
1192 #[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1193 #[optional]
1194 #[unsafe(method(browser:selectionIndexesForProposedSelection:inColumn:))]
1195 #[unsafe(method_family = none)]
1196 fn browser_selectionIndexesForProposedSelection_inColumn(
1197 &self,
1198 browser: &NSBrowser,
1199 proposed_selection_indexes: &NSIndexSet,
1200 column: NSInteger,
1201 ) -> Retained<NSIndexSet>;
1202 }
1203);
1204
1205#[cfg(all(feature = "NSControl", feature = "NSResponder", feature = "NSView"))]
1207impl NSBrowser {
1208 extern_methods!(
1209 #[deprecated]
1210 #[unsafe(method(setAcceptsArrowKeys:))]
1211 #[unsafe(method_family = none)]
1212 pub fn setAcceptsArrowKeys(&self, flag: bool);
1213
1214 #[deprecated]
1215 #[unsafe(method(acceptsArrowKeys))]
1216 #[unsafe(method_family = none)]
1217 pub fn acceptsArrowKeys(&self) -> bool;
1218
1219 #[deprecated]
1220 #[unsafe(method(displayColumn:))]
1221 #[unsafe(method_family = none)]
1222 pub fn displayColumn(&self, column: NSInteger);
1223
1224 #[deprecated]
1225 #[unsafe(method(displayAllColumns))]
1226 #[unsafe(method_family = none)]
1227 pub fn displayAllColumns(&self);
1228
1229 #[cfg(feature = "NSScroller")]
1230 #[deprecated]
1234 #[unsafe(method(scrollViaScroller:))]
1235 #[unsafe(method_family = none)]
1236 pub unsafe fn scrollViaScroller(&self, sender: Option<&NSScroller>);
1237
1238 #[deprecated]
1239 #[unsafe(method(updateScroller))]
1240 #[unsafe(method_family = none)]
1241 pub fn updateScroller(&self);
1242
1243 #[deprecated = "Use the item based NSBrowser instead"]
1247 #[unsafe(method(setMatrixClass:))]
1248 #[unsafe(method_family = none)]
1249 pub unsafe fn setMatrixClass(&self, factory_id: &AnyClass);
1250
1251 #[deprecated = "Use the item based NSBrowser instead"]
1252 #[unsafe(method(matrixClass))]
1253 #[unsafe(method_family = none)]
1254 pub fn matrixClass(&self) -> &'static AnyClass;
1255
1256 #[cfg(feature = "NSMatrix")]
1257 #[deprecated = "Use the item based NSBrowser instead"]
1258 #[unsafe(method(columnOfMatrix:))]
1259 #[unsafe(method_family = none)]
1260 pub fn columnOfMatrix(&self, matrix: &NSMatrix) -> NSInteger;
1261
1262 #[cfg(feature = "NSMatrix")]
1263 #[deprecated = "Use the item based NSBrowser instead"]
1264 #[unsafe(method(matrixInColumn:))]
1265 #[unsafe(method_family = none)]
1266 pub fn matrixInColumn(&self, column: NSInteger) -> Option<Retained<NSMatrix>>;
1267 );
1268}