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