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