objc2_app_kit/generated/
NSTreeController.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstreecontroller?language=objc)
12    #[unsafe(super(NSObjectController, NSController, NSObject))]
13    #[thread_kind = MainThreadOnly]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
16    pub struct NSTreeController;
17);
18
19#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
20unsafe impl NSCoding for NSTreeController {}
21
22#[cfg(all(
23    feature = "NSController",
24    feature = "NSKeyValueBinding",
25    feature = "NSObjectController"
26))]
27unsafe impl NSEditor for NSTreeController {}
28
29#[cfg(all(
30    feature = "NSController",
31    feature = "NSKeyValueBinding",
32    feature = "NSObjectController"
33))]
34unsafe impl NSEditorRegistration for NSTreeController {}
35
36#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
37unsafe impl NSObjectProtocol for NSTreeController {}
38
39#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
40impl NSTreeController {
41    extern_methods!(
42        #[unsafe(method(rearrangeObjects))]
43        #[unsafe(method_family = none)]
44        pub unsafe fn rearrangeObjects(&self);
45
46        #[cfg(feature = "NSTreeNode")]
47        #[unsafe(method(arrangedObjects))]
48        #[unsafe(method_family = none)]
49        pub unsafe fn arrangedObjects(&self) -> Retained<NSTreeNode>;
50
51        #[unsafe(method(childrenKeyPath))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn childrenKeyPath(&self) -> Option<Retained<NSString>>;
54
55        /// Setter for [`childrenKeyPath`][Self::childrenKeyPath].
56        #[unsafe(method(setChildrenKeyPath:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn setChildrenKeyPath(&self, children_key_path: Option<&NSString>);
59
60        #[unsafe(method(countKeyPath))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn countKeyPath(&self) -> Option<Retained<NSString>>;
63
64        /// Setter for [`countKeyPath`][Self::countKeyPath].
65        #[unsafe(method(setCountKeyPath:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setCountKeyPath(&self, count_key_path: Option<&NSString>);
68
69        #[unsafe(method(leafKeyPath))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn leafKeyPath(&self) -> Option<Retained<NSString>>;
72
73        /// Setter for [`leafKeyPath`][Self::leafKeyPath].
74        #[unsafe(method(setLeafKeyPath:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setLeafKeyPath(&self, leaf_key_path: Option<&NSString>);
77
78        #[unsafe(method(sortDescriptors))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn sortDescriptors(&self) -> Retained<NSArray<NSSortDescriptor>>;
81
82        /// Setter for [`sortDescriptors`][Self::sortDescriptors].
83        #[unsafe(method(setSortDescriptors:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
86
87        #[unsafe(method(content))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn content(&self) -> Option<Retained<AnyObject>>;
90
91        /// Setter for [`content`][Self::content].
92        #[unsafe(method(setContent:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setContent(&self, content: Option<&AnyObject>);
95
96        #[unsafe(method(add:))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn add(&self, sender: Option<&AnyObject>);
99
100        #[unsafe(method(remove:))]
101        #[unsafe(method_family = none)]
102        pub unsafe fn remove(&self, sender: Option<&AnyObject>);
103
104        #[unsafe(method(addChild:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn addChild(&self, sender: Option<&AnyObject>);
107
108        #[unsafe(method(insert:))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn insert(&self, sender: Option<&AnyObject>);
111
112        #[unsafe(method(insertChild:))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn insertChild(&self, sender: Option<&AnyObject>);
115
116        #[unsafe(method(canInsert))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn canInsert(&self) -> bool;
119
120        #[unsafe(method(canInsertChild))]
121        #[unsafe(method_family = none)]
122        pub unsafe fn canInsertChild(&self) -> bool;
123
124        #[unsafe(method(canAddChild))]
125        #[unsafe(method_family = none)]
126        pub unsafe fn canAddChild(&self) -> bool;
127
128        #[unsafe(method(insertObject:atArrangedObjectIndexPath:))]
129        #[unsafe(method_family = none)]
130        pub unsafe fn insertObject_atArrangedObjectIndexPath(
131            &self,
132            object: Option<&AnyObject>,
133            index_path: &NSIndexPath,
134        );
135
136        #[unsafe(method(insertObjects:atArrangedObjectIndexPaths:))]
137        #[unsafe(method_family = none)]
138        pub unsafe fn insertObjects_atArrangedObjectIndexPaths(
139            &self,
140            objects: &NSArray,
141            index_paths: &NSArray<NSIndexPath>,
142        );
143
144        #[unsafe(method(removeObjectAtArrangedObjectIndexPath:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn removeObjectAtArrangedObjectIndexPath(&self, index_path: &NSIndexPath);
147
148        #[unsafe(method(removeObjectsAtArrangedObjectIndexPaths:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn removeObjectsAtArrangedObjectIndexPaths(
151            &self,
152            index_paths: &NSArray<NSIndexPath>,
153        );
154
155        #[unsafe(method(avoidsEmptySelection))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn avoidsEmptySelection(&self) -> bool;
158
159        /// Setter for [`avoidsEmptySelection`][Self::avoidsEmptySelection].
160        #[unsafe(method(setAvoidsEmptySelection:))]
161        #[unsafe(method_family = none)]
162        pub unsafe fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);
163
164        #[unsafe(method(preservesSelection))]
165        #[unsafe(method_family = none)]
166        pub unsafe fn preservesSelection(&self) -> bool;
167
168        /// Setter for [`preservesSelection`][Self::preservesSelection].
169        #[unsafe(method(setPreservesSelection:))]
170        #[unsafe(method_family = none)]
171        pub unsafe fn setPreservesSelection(&self, preserves_selection: bool);
172
173        #[unsafe(method(selectsInsertedObjects))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn selectsInsertedObjects(&self) -> bool;
176
177        /// Setter for [`selectsInsertedObjects`][Self::selectsInsertedObjects].
178        #[unsafe(method(setSelectsInsertedObjects:))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);
181
182        #[unsafe(method(alwaysUsesMultipleValuesMarker))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool;
185
186        /// Setter for [`alwaysUsesMultipleValuesMarker`][Self::alwaysUsesMultipleValuesMarker].
187        #[unsafe(method(setAlwaysUsesMultipleValuesMarker:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn setAlwaysUsesMultipleValuesMarker(
190            &self,
191            always_uses_multiple_values_marker: bool,
192        );
193
194        #[unsafe(method(selectedObjects))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn selectedObjects(&self) -> Retained<NSArray>;
197
198        #[unsafe(method(setSelectionIndexPaths:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn setSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
201
202        #[unsafe(method(selectionIndexPaths))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn selectionIndexPaths(&self) -> Retained<NSArray<NSIndexPath>>;
205
206        #[unsafe(method(setSelectionIndexPath:))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn setSelectionIndexPath(&self, index_path: Option<&NSIndexPath>) -> bool;
209
210        #[unsafe(method(selectionIndexPath))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn selectionIndexPath(&self) -> Option<Retained<NSIndexPath>>;
213
214        #[unsafe(method(addSelectionIndexPaths:))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn addSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
217
218        #[unsafe(method(removeSelectionIndexPaths:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn removeSelectionIndexPaths(&self, index_paths: &NSArray<NSIndexPath>) -> bool;
221
222        #[cfg(feature = "NSTreeNode")]
223        #[unsafe(method(selectedNodes))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn selectedNodes(&self) -> Retained<NSArray<NSTreeNode>>;
226
227        #[cfg(feature = "NSTreeNode")]
228        #[unsafe(method(moveNode:toIndexPath:))]
229        #[unsafe(method_family = none)]
230        pub unsafe fn moveNode_toIndexPath(&self, node: &NSTreeNode, index_path: &NSIndexPath);
231
232        #[cfg(feature = "NSTreeNode")]
233        #[unsafe(method(moveNodes:toIndexPath:))]
234        #[unsafe(method_family = none)]
235        pub unsafe fn moveNodes_toIndexPath(
236            &self,
237            nodes: &NSArray<NSTreeNode>,
238            starting_index_path: &NSIndexPath,
239        );
240
241        #[cfg(feature = "NSTreeNode")]
242        #[unsafe(method(childrenKeyPathForNode:))]
243        #[unsafe(method_family = none)]
244        pub unsafe fn childrenKeyPathForNode(
245            &self,
246            node: &NSTreeNode,
247        ) -> Option<Retained<NSString>>;
248
249        #[cfg(feature = "NSTreeNode")]
250        #[unsafe(method(countKeyPathForNode:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn countKeyPathForNode(&self, node: &NSTreeNode) -> Option<Retained<NSString>>;
253
254        #[cfg(feature = "NSTreeNode")]
255        #[unsafe(method(leafKeyPathForNode:))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn leafKeyPathForNode(&self, node: &NSTreeNode) -> Option<Retained<NSString>>;
258    );
259}
260
261/// Methods declared on superclass `NSObjectController`.
262#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
263impl NSTreeController {
264    extern_methods!(
265        #[unsafe(method(initWithContent:))]
266        #[unsafe(method_family = init)]
267        pub unsafe fn initWithContent(
268            this: Allocated<Self>,
269            content: Option<&AnyObject>,
270        ) -> Retained<Self>;
271
272        #[unsafe(method(initWithCoder:))]
273        #[unsafe(method_family = init)]
274        pub unsafe fn initWithCoder(
275            this: Allocated<Self>,
276            coder: &NSCoder,
277        ) -> Option<Retained<Self>>;
278    );
279}
280
281/// Methods declared on superclass `NSController`.
282#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
283impl NSTreeController {
284    extern_methods!(
285        #[unsafe(method(init))]
286        #[unsafe(method_family = init)]
287        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
288    );
289}
290
291/// Methods declared on superclass `NSObject`.
292#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
293impl NSTreeController {
294    extern_methods!(
295        #[unsafe(method(new))]
296        #[unsafe(method_family = new)]
297        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
298    );
299}