1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    pub struct NSTreeController;

    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl ClassType for NSTreeController {
        #[inherits(NSController, NSObject)]
        type Super = NSObjectController;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSCoding for NSTreeController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditor for NSTreeController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditorRegistration for NSTreeController {}

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSObjectProtocol for NSTreeController {}

extern_methods!(
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSTreeController {
        #[method(rearrangeObjects)]
        pub unsafe fn rearrangeObjects(&self);

        #[cfg(feature = "NSTreeNode")]
        #[method_id(@__retain_semantics Other arrangedObjects)]
        pub unsafe fn arrangedObjects(&self) -> Id<NSTreeNode>;

        #[method_id(@__retain_semantics Other childrenKeyPath)]
        pub unsafe fn childrenKeyPath(&self) -> Option<Id<NSString>>;

        #[method(setChildrenKeyPath:)]
        pub unsafe fn setChildrenKeyPath(&self, children_key_path: Option<&NSString>);

        #[method_id(@__retain_semantics Other countKeyPath)]
        pub unsafe fn countKeyPath(&self) -> Option<Id<NSString>>;

        #[method(setCountKeyPath:)]
        pub unsafe fn setCountKeyPath(&self, count_key_path: Option<&NSString>);

        #[method_id(@__retain_semantics Other leafKeyPath)]
        pub unsafe fn leafKeyPath(&self) -> Option<Id<NSString>>;

        #[method(setLeafKeyPath:)]
        pub unsafe fn setLeafKeyPath(&self, leaf_key_path: Option<&NSString>);

        #[method_id(@__retain_semantics Other sortDescriptors)]
        pub unsafe fn sortDescriptors(&self) -> Id<NSArray<NSSortDescriptor>>;

        #[method(setSortDescriptors:)]
        pub unsafe fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);

        #[method_id(@__retain_semantics Other content)]
        pub unsafe fn content(&self) -> Option<Id<AnyObject>>;

        #[method(setContent:)]
        pub unsafe fn setContent(&self, content: Option<&AnyObject>);

        #[method(add:)]
        pub unsafe fn add(&self, sender: Option<&AnyObject>);

        #[method(remove:)]
        pub unsafe fn remove(&self, sender: Option<&AnyObject>);

        #[method(addChild:)]
        pub unsafe fn addChild(&self, sender: Option<&AnyObject>);

        #[method(insert:)]
        pub unsafe fn insert(&self, sender: Option<&AnyObject>);

        #[method(insertChild:)]
        pub unsafe fn insertChild(&self, sender: Option<&AnyObject>);

        #[method(canInsert)]
        pub unsafe fn canInsert(&self) -> bool;

        #[method(canInsertChild)]
        pub unsafe fn canInsertChild(&self) -> bool;

        #[method(canAddChild)]
        pub unsafe fn canAddChild(&self) -> bool;

        #[method(insertObject:atArrangedObjectIndexPath:)]
        pub unsafe fn insertObject_atArrangedObjectIndexPath(
            &self,
            object: Option<&AnyObject>,
            index_path: &NSIndexPath,
        );

        #[method(insertObjects:atArrangedObjectIndexPaths:)]
        pub unsafe fn insertObjects_atArrangedObjectIndexPaths(
            &self,
            objects: &NSArray,
            index_paths: &NSArray<NSIndexPath>,
        );

        #[method(removeObjectAtArrangedObjectIndexPath:)]
        pub unsafe fn removeObjectAtArrangedObjectIndexPath(&self, index_path: &NSIndexPath);

        #[method(removeObjectsAtArrangedObjectIndexPaths:)]
        pub unsafe fn removeObjectsAtArrangedObjectIndexPaths(
            &self,
            index_paths: &NSArray<NSIndexPath>,
        );

        #[method(avoidsEmptySelection)]
        pub unsafe fn avoidsEmptySelection(&self) -> bool;

        #[method(setAvoidsEmptySelection:)]
        pub unsafe fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);

        #[method(preservesSelection)]
        pub unsafe fn preservesSelection(&self) -> bool;

        #[method(setPreservesSelection:)]
        pub unsafe fn setPreservesSelection(&self, preserves_selection: bool);

        #[method(selectsInsertedObjects)]
        pub unsafe fn selectsInsertedObjects(&self) -> bool;

        #[method(setSelectsInsertedObjects:)]
        pub unsafe fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);

        #[method(alwaysUsesMultipleValuesMarker)]
        pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool;

        #[method(setAlwaysUsesMultipleValuesMarker:)]
        pub unsafe fn setAlwaysUsesMultipleValuesMarker(
            &self,
            always_uses_multiple_values_marker: bool,
        );

        #[method_id(@__retain_semantics Other selectedObjects)]
        pub unsafe fn selectedObjects(&self) -> Id<NSArray>;

        #[method(setSelectionIndexPaths:)]
        pub unsafe fn setSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;

        #[method_id(@__retain_semantics Other selectionIndexPaths)]
        pub unsafe fn selectionIndexPaths(&self) -> Id<NSArray<NSIndexPath>>;

        #[method(setSelectionIndexPath:)]
        pub unsafe fn setSelectionIndexPath(&self, index_path: Option<&NSIndexPath>) -> bool;

        #[method_id(@__retain_semantics Other selectionIndexPath)]
        pub unsafe fn selectionIndexPath(&self) -> Option<Id<NSIndexPath>>;

        #[method(addSelectionIndexPaths:)]
        pub unsafe fn addSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;

        #[method(removeSelectionIndexPaths:)]
        pub unsafe fn removeSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;

        #[cfg(feature = "NSTreeNode")]
        #[method_id(@__retain_semantics Other selectedNodes)]
        pub unsafe fn selectedNodes(&self) -> Id<NSArray<NSTreeNode>>;

        #[cfg(feature = "NSTreeNode")]
        #[method(moveNode:toIndexPath:)]
        pub unsafe fn moveNode_toIndexPath(&self, node: &NSTreeNode, index_path: &NSIndexPath);

        #[cfg(feature = "NSTreeNode")]
        #[method(moveNodes:toIndexPath:)]
        pub unsafe fn moveNodes_toIndexPath(
            &self,
            nodes: &NSArray<NSTreeNode>,
            starting_index_path: &NSIndexPath,
        );

        #[cfg(feature = "NSTreeNode")]
        #[method_id(@__retain_semantics Other childrenKeyPathForNode:)]
        pub unsafe fn childrenKeyPathForNode(&self, node: &NSTreeNode) -> Option<Id<NSString>>;

        #[cfg(feature = "NSTreeNode")]
        #[method_id(@__retain_semantics Other countKeyPathForNode:)]
        pub unsafe fn countKeyPathForNode(&self, node: &NSTreeNode) -> Option<Id<NSString>>;

        #[cfg(feature = "NSTreeNode")]
        #[method_id(@__retain_semantics Other leafKeyPathForNode:)]
        pub unsafe fn leafKeyPathForNode(&self, node: &NSTreeNode) -> Option<Id<NSString>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObjectController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSTreeController {
        #[method_id(@__retain_semantics Init initWithContent:)]
        pub unsafe fn initWithContent(
            this: Allocated<Self>,
            content: Option<&AnyObject>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSTreeController {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSTreeController {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);