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
12pub const NSOutlineViewDropOnItemIndex: c_int = -1;
14
15extern_class!(
16 #[unsafe(super(NSTableView, NSControl, NSView, NSResponder, NSObject))]
18 #[derive(Debug, PartialEq, Eq, Hash)]
19 #[cfg(all(
20 feature = "NSControl",
21 feature = "NSResponder",
22 feature = "NSTableView",
23 feature = "NSView"
24 ))]
25 pub struct NSOutlineView;
26);
27
28#[cfg(all(
29 feature = "NSAccessibilityProtocols",
30 feature = "NSControl",
31 feature = "NSResponder",
32 feature = "NSTableView",
33 feature = "NSView"
34))]
35unsafe impl NSAccessibility for NSOutlineView {}
36
37#[cfg(all(
38 feature = "NSAccessibilityProtocols",
39 feature = "NSControl",
40 feature = "NSResponder",
41 feature = "NSTableView",
42 feature = "NSView"
43))]
44unsafe impl NSAccessibilityElementProtocol for NSOutlineView {}
45
46#[cfg(all(
47 feature = "NSAccessibilityProtocols",
48 feature = "NSControl",
49 feature = "NSResponder",
50 feature = "NSTableView",
51 feature = "NSView"
52))]
53unsafe impl NSAccessibilityGroup for NSOutlineView {}
54
55#[cfg(all(
56 feature = "NSAccessibilityProtocols",
57 feature = "NSControl",
58 feature = "NSResponder",
59 feature = "NSTableView",
60 feature = "NSView"
61))]
62unsafe impl NSAccessibilityOutline for NSOutlineView {}
63
64#[cfg(all(
65 feature = "NSAccessibilityProtocols",
66 feature = "NSControl",
67 feature = "NSResponder",
68 feature = "NSTableView",
69 feature = "NSView"
70))]
71unsafe impl NSAccessibilityTable for NSOutlineView {}
72
73#[cfg(all(
74 feature = "NSAnimation",
75 feature = "NSControl",
76 feature = "NSResponder",
77 feature = "NSTableView",
78 feature = "NSView"
79))]
80unsafe impl NSAnimatablePropertyContainer for NSOutlineView {}
81
82#[cfg(all(
83 feature = "NSAppearance",
84 feature = "NSControl",
85 feature = "NSResponder",
86 feature = "NSTableView",
87 feature = "NSView"
88))]
89unsafe impl NSAppearanceCustomization for NSOutlineView {}
90
91#[cfg(all(
92 feature = "NSControl",
93 feature = "NSResponder",
94 feature = "NSTableView",
95 feature = "NSView"
96))]
97unsafe impl NSCoding for NSOutlineView {}
98
99#[cfg(all(
100 feature = "NSControl",
101 feature = "NSDragging",
102 feature = "NSResponder",
103 feature = "NSTableView",
104 feature = "NSView"
105))]
106unsafe impl NSDraggingDestination for NSOutlineView {}
107
108#[cfg(all(
109 feature = "NSControl",
110 feature = "NSDragging",
111 feature = "NSResponder",
112 feature = "NSTableView",
113 feature = "NSView"
114))]
115unsafe impl NSDraggingSource for NSOutlineView {}
116
117#[cfg(all(
118 feature = "NSControl",
119 feature = "NSResponder",
120 feature = "NSTableView",
121 feature = "NSView"
122))]
123unsafe impl NSObjectProtocol for NSOutlineView {}
124
125#[cfg(all(
126 feature = "NSControl",
127 feature = "NSResponder",
128 feature = "NSTableView",
129 feature = "NSText",
130 feature = "NSView"
131))]
132unsafe impl NSTextDelegate for NSOutlineView {}
133
134#[cfg(all(
135 feature = "NSControl",
136 feature = "NSResponder",
137 feature = "NSTableView",
138 feature = "NSText",
139 feature = "NSTextView",
140 feature = "NSView"
141))]
142unsafe impl NSTextViewDelegate for NSOutlineView {}
143
144#[cfg(all(
145 feature = "NSControl",
146 feature = "NSResponder",
147 feature = "NSTableView",
148 feature = "NSUserInterfaceItemIdentification",
149 feature = "NSView"
150))]
151unsafe impl NSUserInterfaceItemIdentification for NSOutlineView {}
152
153#[cfg(all(
154 feature = "NSControl",
155 feature = "NSResponder",
156 feature = "NSTableView",
157 feature = "NSUserInterfaceValidation",
158 feature = "NSView"
159))]
160unsafe impl NSUserInterfaceValidations for NSOutlineView {}
161
162#[cfg(all(
163 feature = "NSControl",
164 feature = "NSResponder",
165 feature = "NSTableView",
166 feature = "NSView"
167))]
168impl NSOutlineView {
169 extern_methods!(
170 #[unsafe(method(delegate))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn delegate(
173 &self,
174 ) -> Option<Retained<ProtocolObject<dyn NSOutlineViewDelegate>>>;
175
176 #[unsafe(method(setDelegate:))]
179 #[unsafe(method_family = none)]
180 pub unsafe fn setDelegate(
181 &self,
182 delegate: Option<&ProtocolObject<dyn NSOutlineViewDelegate>>,
183 );
184
185 #[unsafe(method(dataSource))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn dataSource(
188 &self,
189 ) -> Option<Retained<ProtocolObject<dyn NSOutlineViewDataSource>>>;
190
191 #[unsafe(method(setDataSource:))]
194 #[unsafe(method_family = none)]
195 pub unsafe fn setDataSource(
196 &self,
197 data_source: Option<&ProtocolObject<dyn NSOutlineViewDataSource>>,
198 );
199
200 #[cfg(feature = "NSTableColumn")]
201 #[unsafe(method(outlineTableColumn))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn outlineTableColumn(&self) -> Option<Retained<NSTableColumn>>;
204
205 #[cfg(feature = "NSTableColumn")]
206 #[unsafe(method(setOutlineTableColumn:))]
208 #[unsafe(method_family = none)]
209 pub unsafe fn setOutlineTableColumn(&self, outline_table_column: Option<&NSTableColumn>);
210
211 #[unsafe(method(isExpandable:))]
212 #[unsafe(method_family = none)]
213 pub unsafe fn isExpandable(&self, item: Option<&AnyObject>) -> bool;
214
215 #[unsafe(method(numberOfChildrenOfItem:))]
216 #[unsafe(method_family = none)]
217 pub unsafe fn numberOfChildrenOfItem(&self, item: Option<&AnyObject>) -> NSInteger;
218
219 #[unsafe(method(child:ofItem:))]
220 #[unsafe(method_family = none)]
221 pub unsafe fn child_ofItem(
222 &self,
223 index: NSInteger,
224 item: Option<&AnyObject>,
225 ) -> Option<Retained<AnyObject>>;
226
227 #[unsafe(method(expandItem:expandChildren:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn expandItem_expandChildren(
230 &self,
231 item: Option<&AnyObject>,
232 expand_children: bool,
233 );
234
235 #[unsafe(method(expandItem:))]
236 #[unsafe(method_family = none)]
237 pub unsafe fn expandItem(&self, item: Option<&AnyObject>);
238
239 #[unsafe(method(collapseItem:collapseChildren:))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn collapseItem_collapseChildren(
242 &self,
243 item: Option<&AnyObject>,
244 collapse_children: bool,
245 );
246
247 #[unsafe(method(collapseItem:))]
248 #[unsafe(method_family = none)]
249 pub unsafe fn collapseItem(&self, item: Option<&AnyObject>);
250
251 #[unsafe(method(reloadItem:reloadChildren:))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn reloadItem_reloadChildren(
254 &self,
255 item: Option<&AnyObject>,
256 reload_children: bool,
257 );
258
259 #[unsafe(method(reloadItem:))]
260 #[unsafe(method_family = none)]
261 pub unsafe fn reloadItem(&self, item: Option<&AnyObject>);
262
263 #[unsafe(method(parentForItem:))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn parentForItem(&self, item: Option<&AnyObject>)
266 -> Option<Retained<AnyObject>>;
267
268 #[unsafe(method(childIndexForItem:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn childIndexForItem(&self, item: &AnyObject) -> NSInteger;
271
272 #[unsafe(method(itemAtRow:))]
273 #[unsafe(method_family = none)]
274 pub unsafe fn itemAtRow(&self, row: NSInteger) -> Option<Retained<AnyObject>>;
275
276 #[unsafe(method(rowForItem:))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn rowForItem(&self, item: Option<&AnyObject>) -> NSInteger;
279
280 #[unsafe(method(levelForItem:))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn levelForItem(&self, item: Option<&AnyObject>) -> NSInteger;
283
284 #[unsafe(method(levelForRow:))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn levelForRow(&self, row: NSInteger) -> NSInteger;
287
288 #[unsafe(method(isItemExpanded:))]
289 #[unsafe(method_family = none)]
290 pub unsafe fn isItemExpanded(&self, item: Option<&AnyObject>) -> bool;
291
292 #[cfg(feature = "objc2-core-foundation")]
293 #[unsafe(method(indentationPerLevel))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn indentationPerLevel(&self) -> CGFloat;
296
297 #[cfg(feature = "objc2-core-foundation")]
298 #[unsafe(method(setIndentationPerLevel:))]
300 #[unsafe(method_family = none)]
301 pub unsafe fn setIndentationPerLevel(&self, indentation_per_level: CGFloat);
302
303 #[unsafe(method(indentationMarkerFollowsCell))]
304 #[unsafe(method_family = none)]
305 pub unsafe fn indentationMarkerFollowsCell(&self) -> bool;
306
307 #[unsafe(method(setIndentationMarkerFollowsCell:))]
309 #[unsafe(method_family = none)]
310 pub unsafe fn setIndentationMarkerFollowsCell(&self, indentation_marker_follows_cell: bool);
311
312 #[unsafe(method(autoresizesOutlineColumn))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn autoresizesOutlineColumn(&self) -> bool;
315
316 #[unsafe(method(setAutoresizesOutlineColumn:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setAutoresizesOutlineColumn(&self, autoresizes_outline_column: bool);
320
321 #[unsafe(method(frameOfOutlineCellAtRow:))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn frameOfOutlineCellAtRow(&self, row: NSInteger) -> NSRect;
324
325 #[unsafe(method(setDropItem:dropChildIndex:))]
326 #[unsafe(method_family = none)]
327 pub unsafe fn setDropItem_dropChildIndex(&self, item: Option<&AnyObject>, index: NSInteger);
328
329 #[unsafe(method(shouldCollapseAutoExpandedItemsForDeposited:))]
330 #[unsafe(method_family = none)]
331 pub unsafe fn shouldCollapseAutoExpandedItemsForDeposited(&self, deposited: bool) -> bool;
332
333 #[unsafe(method(autosaveExpandedItems))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn autosaveExpandedItems(&self) -> bool;
336
337 #[unsafe(method(setAutosaveExpandedItems:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn setAutosaveExpandedItems(&self, autosave_expanded_items: bool);
341
342 #[unsafe(method(insertItemsAtIndexes:inParent:withAnimation:))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn insertItemsAtIndexes_inParent_withAnimation(
345 &self,
346 indexes: &NSIndexSet,
347 parent: Option<&AnyObject>,
348 animation_options: NSTableViewAnimationOptions,
349 );
350
351 #[unsafe(method(removeItemsAtIndexes:inParent:withAnimation:))]
352 #[unsafe(method_family = none)]
353 pub unsafe fn removeItemsAtIndexes_inParent_withAnimation(
354 &self,
355 indexes: &NSIndexSet,
356 parent: Option<&AnyObject>,
357 animation_options: NSTableViewAnimationOptions,
358 );
359
360 #[unsafe(method(moveItemAtIndex:inParent:toIndex:inParent:))]
361 #[unsafe(method_family = none)]
362 pub unsafe fn moveItemAtIndex_inParent_toIndex_inParent(
363 &self,
364 from_index: NSInteger,
365 old_parent: Option<&AnyObject>,
366 to_index: NSInteger,
367 new_parent: Option<&AnyObject>,
368 );
369
370 #[unsafe(method(insertRowsAtIndexes:withAnimation:))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn insertRowsAtIndexes_withAnimation(
373 &self,
374 indexes: &NSIndexSet,
375 animation_options: NSTableViewAnimationOptions,
376 );
377
378 #[unsafe(method(removeRowsAtIndexes:withAnimation:))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn removeRowsAtIndexes_withAnimation(
381 &self,
382 indexes: &NSIndexSet,
383 animation_options: NSTableViewAnimationOptions,
384 );
385
386 #[unsafe(method(moveRowAtIndex:toIndex:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn moveRowAtIndex_toIndex(&self, old_index: NSInteger, new_index: NSInteger);
389
390 #[cfg(feature = "NSUserInterfaceLayout")]
391 #[unsafe(method(userInterfaceLayoutDirection))]
392 #[unsafe(method_family = none)]
393 pub unsafe fn userInterfaceLayoutDirection(&self) -> NSUserInterfaceLayoutDirection;
394
395 #[cfg(feature = "NSUserInterfaceLayout")]
396 #[unsafe(method(setUserInterfaceLayoutDirection:))]
398 #[unsafe(method_family = none)]
399 pub unsafe fn setUserInterfaceLayoutDirection(
400 &self,
401 user_interface_layout_direction: NSUserInterfaceLayoutDirection,
402 );
403
404 #[unsafe(method(stronglyReferencesItems))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn stronglyReferencesItems(&self) -> bool;
407
408 #[unsafe(method(setStronglyReferencesItems:))]
410 #[unsafe(method_family = none)]
411 pub unsafe fn setStronglyReferencesItems(&self, strongly_references_items: bool);
412 );
413}
414
415#[cfg(all(
417 feature = "NSControl",
418 feature = "NSResponder",
419 feature = "NSTableView",
420 feature = "NSView"
421))]
422impl NSOutlineView {
423 extern_methods!(
424 #[unsafe(method(initWithFrame:))]
425 #[unsafe(method_family = init)]
426 pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
427
428 #[unsafe(method(initWithCoder:))]
429 #[unsafe(method_family = init)]
430 pub unsafe fn initWithCoder(
431 this: Allocated<Self>,
432 coder: &NSCoder,
433 ) -> Option<Retained<Self>>;
434 );
435}
436
437#[cfg(all(
439 feature = "NSControl",
440 feature = "NSResponder",
441 feature = "NSTableView",
442 feature = "NSView"
443))]
444impl NSOutlineView {
445 extern_methods!(
446 #[unsafe(method(init))]
447 #[unsafe(method_family = init)]
448 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
449 );
450}
451
452#[cfg(all(
454 feature = "NSControl",
455 feature = "NSResponder",
456 feature = "NSTableView",
457 feature = "NSView"
458))]
459impl NSOutlineView {
460 extern_methods!(
461 #[unsafe(method(new))]
462 #[unsafe(method_family = new)]
463 pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
464 );
465}
466
467extern_protocol!(
468 pub unsafe trait NSOutlineViewDataSource: NSObjectProtocol {
470 #[cfg(all(
471 feature = "NSControl",
472 feature = "NSResponder",
473 feature = "NSTableView",
474 feature = "NSView"
475 ))]
476 #[optional]
477 #[unsafe(method(outlineView:numberOfChildrenOfItem:))]
478 #[unsafe(method_family = none)]
479 unsafe fn outlineView_numberOfChildrenOfItem(
480 &self,
481 outline_view: &NSOutlineView,
482 item: Option<&AnyObject>,
483 ) -> NSInteger;
484
485 #[cfg(all(
486 feature = "NSControl",
487 feature = "NSResponder",
488 feature = "NSTableView",
489 feature = "NSView"
490 ))]
491 #[optional]
492 #[unsafe(method(outlineView:child:ofItem:))]
493 #[unsafe(method_family = none)]
494 unsafe fn outlineView_child_ofItem(
495 &self,
496 outline_view: &NSOutlineView,
497 index: NSInteger,
498 item: Option<&AnyObject>,
499 ) -> Retained<AnyObject>;
500
501 #[cfg(all(
502 feature = "NSControl",
503 feature = "NSResponder",
504 feature = "NSTableView",
505 feature = "NSView"
506 ))]
507 #[optional]
508 #[unsafe(method(outlineView:isItemExpandable:))]
509 #[unsafe(method_family = none)]
510 unsafe fn outlineView_isItemExpandable(
511 &self,
512 outline_view: &NSOutlineView,
513 item: &AnyObject,
514 ) -> bool;
515
516 #[cfg(all(
517 feature = "NSControl",
518 feature = "NSResponder",
519 feature = "NSTableColumn",
520 feature = "NSTableView",
521 feature = "NSView"
522 ))]
523 #[optional]
524 #[unsafe(method(outlineView:objectValueForTableColumn:byItem:))]
525 #[unsafe(method_family = none)]
526 unsafe fn outlineView_objectValueForTableColumn_byItem(
527 &self,
528 outline_view: &NSOutlineView,
529 table_column: Option<&NSTableColumn>,
530 item: Option<&AnyObject>,
531 ) -> Option<Retained<AnyObject>>;
532
533 #[cfg(all(
534 feature = "NSControl",
535 feature = "NSResponder",
536 feature = "NSTableColumn",
537 feature = "NSTableView",
538 feature = "NSView"
539 ))]
540 #[optional]
541 #[unsafe(method(outlineView:setObjectValue:forTableColumn:byItem:))]
542 #[unsafe(method_family = none)]
543 unsafe fn outlineView_setObjectValue_forTableColumn_byItem(
544 &self,
545 outline_view: &NSOutlineView,
546 object: Option<&AnyObject>,
547 table_column: Option<&NSTableColumn>,
548 item: Option<&AnyObject>,
549 );
550
551 #[cfg(all(
552 feature = "NSControl",
553 feature = "NSResponder",
554 feature = "NSTableView",
555 feature = "NSView"
556 ))]
557 #[optional]
558 #[unsafe(method(outlineView:itemForPersistentObject:))]
559 #[unsafe(method_family = none)]
560 unsafe fn outlineView_itemForPersistentObject(
561 &self,
562 outline_view: &NSOutlineView,
563 object: &AnyObject,
564 ) -> Option<Retained<AnyObject>>;
565
566 #[cfg(all(
567 feature = "NSControl",
568 feature = "NSResponder",
569 feature = "NSTableView",
570 feature = "NSView"
571 ))]
572 #[optional]
573 #[unsafe(method(outlineView:persistentObjectForItem:))]
574 #[unsafe(method_family = none)]
575 unsafe fn outlineView_persistentObjectForItem(
576 &self,
577 outline_view: &NSOutlineView,
578 item: Option<&AnyObject>,
579 ) -> Option<Retained<AnyObject>>;
580
581 #[cfg(all(
582 feature = "NSControl",
583 feature = "NSResponder",
584 feature = "NSTableView",
585 feature = "NSView"
586 ))]
587 #[optional]
588 #[unsafe(method(outlineView:sortDescriptorsDidChange:))]
589 #[unsafe(method_family = none)]
590 unsafe fn outlineView_sortDescriptorsDidChange(
591 &self,
592 outline_view: &NSOutlineView,
593 old_descriptors: &NSArray<NSSortDescriptor>,
594 );
595
596 #[cfg(all(
597 feature = "NSControl",
598 feature = "NSPasteboard",
599 feature = "NSResponder",
600 feature = "NSTableView",
601 feature = "NSView"
602 ))]
603 #[optional]
604 #[unsafe(method(outlineView:pasteboardWriterForItem:))]
605 #[unsafe(method_family = none)]
606 unsafe fn outlineView_pasteboardWriterForItem(
607 &self,
608 outline_view: &NSOutlineView,
609 item: &AnyObject,
610 ) -> Option<Retained<ProtocolObject<dyn NSPasteboardWriting>>>;
611
612 #[cfg(all(
613 feature = "NSControl",
614 feature = "NSDraggingSession",
615 feature = "NSResponder",
616 feature = "NSTableView",
617 feature = "NSView"
618 ))]
619 #[optional]
620 #[unsafe(method(outlineView:draggingSession:willBeginAtPoint:forItems:))]
621 #[unsafe(method_family = none)]
622 unsafe fn outlineView_draggingSession_willBeginAtPoint_forItems(
623 &self,
624 outline_view: &NSOutlineView,
625 session: &NSDraggingSession,
626 screen_point: NSPoint,
627 dragged_items: &NSArray,
628 );
629
630 #[cfg(all(
631 feature = "NSControl",
632 feature = "NSDragging",
633 feature = "NSDraggingSession",
634 feature = "NSResponder",
635 feature = "NSTableView",
636 feature = "NSView"
637 ))]
638 #[optional]
639 #[unsafe(method(outlineView:draggingSession:endedAtPoint:operation:))]
640 #[unsafe(method_family = none)]
641 unsafe fn outlineView_draggingSession_endedAtPoint_operation(
642 &self,
643 outline_view: &NSOutlineView,
644 session: &NSDraggingSession,
645 screen_point: NSPoint,
646 operation: NSDragOperation,
647 );
648
649 #[cfg(all(
650 feature = "NSControl",
651 feature = "NSPasteboard",
652 feature = "NSResponder",
653 feature = "NSTableView",
654 feature = "NSView"
655 ))]
656 #[deprecated = "Use -outlineView:pasteboardWriterForItem: instead"]
657 #[optional]
658 #[unsafe(method(outlineView:writeItems:toPasteboard:))]
659 #[unsafe(method_family = none)]
660 unsafe fn outlineView_writeItems_toPasteboard(
661 &self,
662 outline_view: &NSOutlineView,
663 items: &NSArray,
664 pasteboard: &NSPasteboard,
665 ) -> bool;
666
667 #[cfg(all(
668 feature = "NSControl",
669 feature = "NSDragging",
670 feature = "NSResponder",
671 feature = "NSTableView",
672 feature = "NSView"
673 ))]
674 #[optional]
675 #[unsafe(method(outlineView:updateDraggingItemsForDrag:))]
676 #[unsafe(method_family = none)]
677 unsafe fn outlineView_updateDraggingItemsForDrag(
678 &self,
679 outline_view: &NSOutlineView,
680 dragging_info: &ProtocolObject<dyn NSDraggingInfo>,
681 );
682
683 #[cfg(all(
684 feature = "NSControl",
685 feature = "NSDragging",
686 feature = "NSResponder",
687 feature = "NSTableView",
688 feature = "NSView"
689 ))]
690 #[optional]
691 #[unsafe(method(outlineView:validateDrop:proposedItem:proposedChildIndex:))]
692 #[unsafe(method_family = none)]
693 unsafe fn outlineView_validateDrop_proposedItem_proposedChildIndex(
694 &self,
695 outline_view: &NSOutlineView,
696 info: &ProtocolObject<dyn NSDraggingInfo>,
697 item: Option<&AnyObject>,
698 index: NSInteger,
699 ) -> NSDragOperation;
700
701 #[cfg(all(
702 feature = "NSControl",
703 feature = "NSDragging",
704 feature = "NSResponder",
705 feature = "NSTableView",
706 feature = "NSView"
707 ))]
708 #[optional]
709 #[unsafe(method(outlineView:acceptDrop:item:childIndex:))]
710 #[unsafe(method_family = none)]
711 unsafe fn outlineView_acceptDrop_item_childIndex(
712 &self,
713 outline_view: &NSOutlineView,
714 info: &ProtocolObject<dyn NSDraggingInfo>,
715 item: Option<&AnyObject>,
716 index: NSInteger,
717 ) -> bool;
718
719 #[cfg(all(
720 feature = "NSControl",
721 feature = "NSResponder",
722 feature = "NSTableView",
723 feature = "NSView"
724 ))]
725 #[deprecated = "Use NSFilePromiseReceiver objects instead"]
726 #[optional]
727 #[unsafe(method(outlineView:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:))]
728 #[unsafe(method_family = none)]
729 unsafe fn outlineView_namesOfPromisedFilesDroppedAtDestination_forDraggedItems(
730 &self,
731 outline_view: &NSOutlineView,
732 drop_destination: &NSURL,
733 items: &NSArray,
734 ) -> Retained<NSArray<NSString>>;
735 }
736);
737
738extern_protocol!(
739 #[cfg(feature = "NSControl")]
741 pub unsafe trait NSOutlineViewDelegate:
742 NSControlTextEditingDelegate + MainThreadOnly
743 {
744 #[cfg(all(
745 feature = "NSResponder",
746 feature = "NSTableColumn",
747 feature = "NSTableView",
748 feature = "NSView"
749 ))]
750 #[optional]
751 #[unsafe(method(outlineView:viewForTableColumn:item:))]
752 #[unsafe(method_family = none)]
753 unsafe fn outlineView_viewForTableColumn_item(
754 &self,
755 outline_view: &NSOutlineView,
756 table_column: Option<&NSTableColumn>,
757 item: &AnyObject,
758 ) -> Option<Retained<NSView>>;
759
760 #[cfg(all(
761 feature = "NSResponder",
762 feature = "NSTableRowView",
763 feature = "NSTableView",
764 feature = "NSView"
765 ))]
766 #[optional]
767 #[unsafe(method(outlineView:rowViewForItem:))]
768 #[unsafe(method_family = none)]
769 unsafe fn outlineView_rowViewForItem(
770 &self,
771 outline_view: &NSOutlineView,
772 item: &AnyObject,
773 ) -> Option<Retained<NSTableRowView>>;
774
775 #[cfg(all(
776 feature = "NSResponder",
777 feature = "NSTableRowView",
778 feature = "NSTableView",
779 feature = "NSView"
780 ))]
781 #[optional]
782 #[unsafe(method(outlineView:didAddRowView:forRow:))]
783 #[unsafe(method_family = none)]
784 unsafe fn outlineView_didAddRowView_forRow(
785 &self,
786 outline_view: &NSOutlineView,
787 row_view: &NSTableRowView,
788 row: NSInteger,
789 );
790
791 #[cfg(all(
792 feature = "NSResponder",
793 feature = "NSTableRowView",
794 feature = "NSTableView",
795 feature = "NSView"
796 ))]
797 #[optional]
798 #[unsafe(method(outlineView:didRemoveRowView:forRow:))]
799 #[unsafe(method_family = none)]
800 unsafe fn outlineView_didRemoveRowView_forRow(
801 &self,
802 outline_view: &NSOutlineView,
803 row_view: &NSTableRowView,
804 row: NSInteger,
805 );
806
807 #[cfg(all(
808 feature = "NSResponder",
809 feature = "NSTableColumn",
810 feature = "NSTableView",
811 feature = "NSView"
812 ))]
813 #[optional]
814 #[unsafe(method(outlineView:willDisplayCell:forTableColumn:item:))]
815 #[unsafe(method_family = none)]
816 unsafe fn outlineView_willDisplayCell_forTableColumn_item(
817 &self,
818 outline_view: &NSOutlineView,
819 cell: &AnyObject,
820 table_column: Option<&NSTableColumn>,
821 item: &AnyObject,
822 );
823
824 #[cfg(all(
825 feature = "NSResponder",
826 feature = "NSTableColumn",
827 feature = "NSTableView",
828 feature = "NSView"
829 ))]
830 #[optional]
831 #[unsafe(method(outlineView:shouldEditTableColumn:item:))]
832 #[unsafe(method_family = none)]
833 unsafe fn outlineView_shouldEditTableColumn_item(
834 &self,
835 outline_view: &NSOutlineView,
836 table_column: Option<&NSTableColumn>,
837 item: &AnyObject,
838 ) -> bool;
839
840 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
841 #[optional]
842 #[unsafe(method(selectionShouldChangeInOutlineView:))]
843 #[unsafe(method_family = none)]
844 unsafe fn selectionShouldChangeInOutlineView(&self, outline_view: &NSOutlineView) -> bool;
845
846 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
847 #[optional]
848 #[unsafe(method(outlineView:shouldSelectItem:))]
849 #[unsafe(method_family = none)]
850 unsafe fn outlineView_shouldSelectItem(
851 &self,
852 outline_view: &NSOutlineView,
853 item: &AnyObject,
854 ) -> bool;
855
856 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
857 #[optional]
858 #[unsafe(method(outlineView:selectionIndexesForProposedSelection:))]
859 #[unsafe(method_family = none)]
860 unsafe fn outlineView_selectionIndexesForProposedSelection(
861 &self,
862 outline_view: &NSOutlineView,
863 proposed_selection_indexes: &NSIndexSet,
864 ) -> Retained<NSIndexSet>;
865
866 #[cfg(all(
867 feature = "NSResponder",
868 feature = "NSTableColumn",
869 feature = "NSTableView",
870 feature = "NSView"
871 ))]
872 #[optional]
873 #[unsafe(method(outlineView:shouldSelectTableColumn:))]
874 #[unsafe(method_family = none)]
875 unsafe fn outlineView_shouldSelectTableColumn(
876 &self,
877 outline_view: &NSOutlineView,
878 table_column: Option<&NSTableColumn>,
879 ) -> bool;
880
881 #[cfg(all(
882 feature = "NSResponder",
883 feature = "NSTableColumn",
884 feature = "NSTableView",
885 feature = "NSView"
886 ))]
887 #[optional]
888 #[unsafe(method(outlineView:mouseDownInHeaderOfTableColumn:))]
889 #[unsafe(method_family = none)]
890 unsafe fn outlineView_mouseDownInHeaderOfTableColumn(
891 &self,
892 outline_view: &NSOutlineView,
893 table_column: &NSTableColumn,
894 );
895
896 #[cfg(all(
897 feature = "NSResponder",
898 feature = "NSTableColumn",
899 feature = "NSTableView",
900 feature = "NSView"
901 ))]
902 #[optional]
903 #[unsafe(method(outlineView:didClickTableColumn:))]
904 #[unsafe(method_family = none)]
905 unsafe fn outlineView_didClickTableColumn(
906 &self,
907 outline_view: &NSOutlineView,
908 table_column: &NSTableColumn,
909 );
910
911 #[cfg(all(
912 feature = "NSResponder",
913 feature = "NSTableColumn",
914 feature = "NSTableView",
915 feature = "NSView"
916 ))]
917 #[optional]
918 #[unsafe(method(outlineView:didDragTableColumn:))]
919 #[unsafe(method_family = none)]
920 unsafe fn outlineView_didDragTableColumn(
921 &self,
922 outline_view: &NSOutlineView,
923 table_column: &NSTableColumn,
924 );
925
926 #[cfg(all(
927 feature = "NSCell",
928 feature = "NSResponder",
929 feature = "NSTableColumn",
930 feature = "NSTableView",
931 feature = "NSView"
932 ))]
933 #[optional]
934 #[unsafe(method(outlineView:toolTipForCell:rect:tableColumn:item:mouseLocation:))]
935 #[unsafe(method_family = none)]
936 unsafe fn outlineView_toolTipForCell_rect_tableColumn_item_mouseLocation(
937 &self,
938 outline_view: &NSOutlineView,
939 cell: &NSCell,
940 rect: NSRectPointer,
941 table_column: Option<&NSTableColumn>,
942 item: &AnyObject,
943 mouse_location: NSPoint,
944 ) -> Retained<NSString>;
945
946 #[cfg(all(
947 feature = "NSResponder",
948 feature = "NSTableView",
949 feature = "NSView",
950 feature = "objc2-core-foundation"
951 ))]
952 #[optional]
953 #[unsafe(method(outlineView:heightOfRowByItem:))]
954 #[unsafe(method_family = none)]
955 unsafe fn outlineView_heightOfRowByItem(
956 &self,
957 outline_view: &NSOutlineView,
958 item: &AnyObject,
959 ) -> CGFloat;
960
961 #[cfg(all(
962 feature = "NSResponder",
963 feature = "NSTableView",
964 feature = "NSTintConfiguration",
965 feature = "NSView"
966 ))]
967 #[optional]
968 #[unsafe(method(outlineView:tintConfigurationForItem:))]
969 #[unsafe(method_family = none)]
970 unsafe fn outlineView_tintConfigurationForItem(
971 &self,
972 outline_view: &NSOutlineView,
973 item: &AnyObject,
974 ) -> Option<Retained<NSTintConfiguration>>;
975
976 #[cfg(all(
977 feature = "NSResponder",
978 feature = "NSTableColumn",
979 feature = "NSTableView",
980 feature = "NSView"
981 ))]
982 #[optional]
983 #[unsafe(method(outlineView:typeSelectStringForTableColumn:item:))]
984 #[unsafe(method_family = none)]
985 unsafe fn outlineView_typeSelectStringForTableColumn_item(
986 &self,
987 outline_view: &NSOutlineView,
988 table_column: Option<&NSTableColumn>,
989 item: &AnyObject,
990 ) -> Option<Retained<NSString>>;
991
992 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
993 #[optional]
994 #[unsafe(method(outlineView:nextTypeSelectMatchFromItem:toItem:forString:))]
995 #[unsafe(method_family = none)]
996 unsafe fn outlineView_nextTypeSelectMatchFromItem_toItem_forString(
997 &self,
998 outline_view: &NSOutlineView,
999 start_item: &AnyObject,
1000 end_item: &AnyObject,
1001 search_string: &NSString,
1002 ) -> Option<Retained<AnyObject>>;
1003
1004 #[cfg(all(
1005 feature = "NSEvent",
1006 feature = "NSResponder",
1007 feature = "NSTableView",
1008 feature = "NSView"
1009 ))]
1010 #[optional]
1011 #[unsafe(method(outlineView:shouldTypeSelectForEvent:withCurrentSearchString:))]
1012 #[unsafe(method_family = none)]
1013 unsafe fn outlineView_shouldTypeSelectForEvent_withCurrentSearchString(
1014 &self,
1015 outline_view: &NSOutlineView,
1016 event: &NSEvent,
1017 search_string: Option<&NSString>,
1018 ) -> bool;
1019
1020 #[cfg(all(
1021 feature = "NSResponder",
1022 feature = "NSTableColumn",
1023 feature = "NSTableView",
1024 feature = "NSView"
1025 ))]
1026 #[optional]
1027 #[unsafe(method(outlineView:shouldShowCellExpansionForTableColumn:item:))]
1028 #[unsafe(method_family = none)]
1029 unsafe fn outlineView_shouldShowCellExpansionForTableColumn_item(
1030 &self,
1031 outline_view: &NSOutlineView,
1032 table_column: Option<&NSTableColumn>,
1033 item: &AnyObject,
1034 ) -> bool;
1035
1036 #[cfg(all(
1037 feature = "NSCell",
1038 feature = "NSResponder",
1039 feature = "NSTableColumn",
1040 feature = "NSTableView",
1041 feature = "NSView"
1042 ))]
1043 #[optional]
1044 #[unsafe(method(outlineView:shouldTrackCell:forTableColumn:item:))]
1045 #[unsafe(method_family = none)]
1046 unsafe fn outlineView_shouldTrackCell_forTableColumn_item(
1047 &self,
1048 outline_view: &NSOutlineView,
1049 cell: &NSCell,
1050 table_column: Option<&NSTableColumn>,
1051 item: &AnyObject,
1052 ) -> bool;
1053
1054 #[cfg(all(
1055 feature = "NSCell",
1056 feature = "NSResponder",
1057 feature = "NSTableColumn",
1058 feature = "NSTableView",
1059 feature = "NSView"
1060 ))]
1061 #[optional]
1062 #[unsafe(method(outlineView:dataCellForTableColumn:item:))]
1063 #[unsafe(method_family = none)]
1064 unsafe fn outlineView_dataCellForTableColumn_item(
1065 &self,
1066 outline_view: &NSOutlineView,
1067 table_column: Option<&NSTableColumn>,
1068 item: &AnyObject,
1069 ) -> Option<Retained<NSCell>>;
1070
1071 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
1072 #[optional]
1073 #[unsafe(method(outlineView:isGroupItem:))]
1074 #[unsafe(method_family = none)]
1075 unsafe fn outlineView_isGroupItem(
1076 &self,
1077 outline_view: &NSOutlineView,
1078 item: &AnyObject,
1079 ) -> bool;
1080
1081 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
1082 #[optional]
1083 #[unsafe(method(outlineView:shouldExpandItem:))]
1084 #[unsafe(method_family = none)]
1085 unsafe fn outlineView_shouldExpandItem(
1086 &self,
1087 outline_view: &NSOutlineView,
1088 item: &AnyObject,
1089 ) -> bool;
1090
1091 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
1092 #[optional]
1093 #[unsafe(method(outlineView:shouldCollapseItem:))]
1094 #[unsafe(method_family = none)]
1095 unsafe fn outlineView_shouldCollapseItem(
1096 &self,
1097 outline_view: &NSOutlineView,
1098 item: &AnyObject,
1099 ) -> bool;
1100
1101 #[cfg(all(
1102 feature = "NSResponder",
1103 feature = "NSTableColumn",
1104 feature = "NSTableView",
1105 feature = "NSView"
1106 ))]
1107 #[optional]
1108 #[unsafe(method(outlineView:willDisplayOutlineCell:forTableColumn:item:))]
1109 #[unsafe(method_family = none)]
1110 unsafe fn outlineView_willDisplayOutlineCell_forTableColumn_item(
1111 &self,
1112 outline_view: &NSOutlineView,
1113 cell: &AnyObject,
1114 table_column: Option<&NSTableColumn>,
1115 item: &AnyObject,
1116 );
1117
1118 #[cfg(all(
1119 feature = "NSResponder",
1120 feature = "NSTableView",
1121 feature = "NSView",
1122 feature = "objc2-core-foundation"
1123 ))]
1124 #[optional]
1125 #[unsafe(method(outlineView:sizeToFitWidthOfColumn:))]
1126 #[unsafe(method_family = none)]
1127 unsafe fn outlineView_sizeToFitWidthOfColumn(
1128 &self,
1129 outline_view: &NSOutlineView,
1130 column: NSInteger,
1131 ) -> CGFloat;
1132
1133 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
1134 #[optional]
1135 #[unsafe(method(outlineView:shouldReorderColumn:toColumn:))]
1136 #[unsafe(method_family = none)]
1137 unsafe fn outlineView_shouldReorderColumn_toColumn(
1138 &self,
1139 outline_view: &NSOutlineView,
1140 column_index: NSInteger,
1141 new_column_index: NSInteger,
1142 ) -> bool;
1143
1144 #[cfg(all(feature = "NSResponder", feature = "NSTableView", feature = "NSView"))]
1145 #[optional]
1146 #[unsafe(method(outlineView:shouldShowOutlineCellForItem:))]
1147 #[unsafe(method_family = none)]
1148 unsafe fn outlineView_shouldShowOutlineCellForItem(
1149 &self,
1150 outline_view: &NSOutlineView,
1151 item: &AnyObject,
1152 ) -> bool;
1153
1154 #[cfg(all(
1155 feature = "NSResponder",
1156 feature = "NSTableColumn",
1157 feature = "NSTableView",
1158 feature = "NSView"
1159 ))]
1160 #[optional]
1161 #[unsafe(method(outlineView:userCanChangeVisibilityOfTableColumn:))]
1162 #[unsafe(method_family = none)]
1163 unsafe fn outlineView_userCanChangeVisibilityOfTableColumn(
1164 &self,
1165 outline_view: &NSOutlineView,
1166 column: &NSTableColumn,
1167 ) -> bool;
1168
1169 #[cfg(all(
1170 feature = "NSResponder",
1171 feature = "NSTableColumn",
1172 feature = "NSTableView",
1173 feature = "NSView"
1174 ))]
1175 #[optional]
1176 #[unsafe(method(outlineView:userDidChangeVisibilityOfTableColumns:))]
1177 #[unsafe(method_family = none)]
1178 unsafe fn outlineView_userDidChangeVisibilityOfTableColumns(
1179 &self,
1180 outline_view: &NSOutlineView,
1181 columns: &NSArray<NSTableColumn>,
1182 );
1183
1184 #[optional]
1185 #[unsafe(method(outlineViewSelectionDidChange:))]
1186 #[unsafe(method_family = none)]
1187 unsafe fn outlineViewSelectionDidChange(&self, notification: &NSNotification);
1188
1189 #[optional]
1190 #[unsafe(method(outlineViewColumnDidMove:))]
1191 #[unsafe(method_family = none)]
1192 unsafe fn outlineViewColumnDidMove(&self, notification: &NSNotification);
1193
1194 #[optional]
1195 #[unsafe(method(outlineViewColumnDidResize:))]
1196 #[unsafe(method_family = none)]
1197 unsafe fn outlineViewColumnDidResize(&self, notification: &NSNotification);
1198
1199 #[optional]
1200 #[unsafe(method(outlineViewSelectionIsChanging:))]
1201 #[unsafe(method_family = none)]
1202 unsafe fn outlineViewSelectionIsChanging(&self, notification: &NSNotification);
1203
1204 #[optional]
1205 #[unsafe(method(outlineViewItemWillExpand:))]
1206 #[unsafe(method_family = none)]
1207 unsafe fn outlineViewItemWillExpand(&self, notification: &NSNotification);
1208
1209 #[optional]
1210 #[unsafe(method(outlineViewItemDidExpand:))]
1211 #[unsafe(method_family = none)]
1212 unsafe fn outlineViewItemDidExpand(&self, notification: &NSNotification);
1213
1214 #[optional]
1215 #[unsafe(method(outlineViewItemWillCollapse:))]
1216 #[unsafe(method_family = none)]
1217 unsafe fn outlineViewItemWillCollapse(&self, notification: &NSNotification);
1218
1219 #[optional]
1220 #[unsafe(method(outlineViewItemDidCollapse:))]
1221 #[unsafe(method_family = none)]
1222 unsafe fn outlineViewItemDidCollapse(&self, notification: &NSNotification);
1223 }
1224);
1225
1226extern "C" {
1227 #[cfg(feature = "NSUserInterfaceItemIdentification")]
1229 pub static NSOutlineViewDisclosureButtonKey: &'static NSUserInterfaceItemIdentifier;
1230}
1231
1232extern "C" {
1233 #[cfg(feature = "NSUserInterfaceItemIdentification")]
1235 pub static NSOutlineViewShowHideButtonKey: &'static NSUserInterfaceItemIdentifier;
1236}
1237
1238extern "C" {
1239 pub static NSOutlineViewSelectionDidChangeNotification: &'static NSNotificationName;
1241}
1242
1243extern "C" {
1244 pub static NSOutlineViewColumnDidMoveNotification: &'static NSNotificationName;
1246}
1247
1248extern "C" {
1249 pub static NSOutlineViewColumnDidResizeNotification: &'static NSNotificationName;
1251}
1252
1253extern "C" {
1254 pub static NSOutlineViewSelectionIsChangingNotification: &'static NSNotificationName;
1256}
1257
1258extern "C" {
1259 pub static NSOutlineViewItemWillExpandNotification: &'static NSNotificationName;
1261}
1262
1263extern "C" {
1264 pub static NSOutlineViewItemDidExpandNotification: &'static NSNotificationName;
1266}
1267
1268extern "C" {
1269 pub static NSOutlineViewItemWillCollapseNotification: &'static NSNotificationName;
1271}
1272
1273extern "C" {
1274 pub static NSOutlineViewItemDidCollapseNotification: &'static NSNotificationName;
1276}