objc2_app_kit/generated/
NSOutlineView.rs

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