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