objc2_app_kit/generated/
NSTreeNode.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11 #[unsafe(super(NSObject))]
13 #[derive(Debug, PartialEq, Eq, Hash)]
14 pub struct NSTreeNode;
15);
16
17extern_conformance!(
18 unsafe impl NSObjectProtocol for NSTreeNode {}
19);
20
21impl NSTreeNode {
22 extern_methods!(
23 #[unsafe(method(treeNodeWithRepresentedObject:))]
27 #[unsafe(method_family = none)]
28 pub unsafe fn treeNodeWithRepresentedObject(
29 model_object: Option<&AnyObject>,
30 ) -> Retained<Self>;
31
32 #[unsafe(method(initWithRepresentedObject:))]
36 #[unsafe(method_family = init)]
37 pub unsafe fn initWithRepresentedObject(
38 this: Allocated<Self>,
39 model_object: Option<&AnyObject>,
40 ) -> Retained<Self>;
41
42 #[unsafe(method(representedObject))]
43 #[unsafe(method_family = none)]
44 pub fn representedObject(&self) -> Option<Retained<AnyObject>>;
45
46 #[unsafe(method(indexPath))]
47 #[unsafe(method_family = none)]
48 pub fn indexPath(&self) -> Retained<NSIndexPath>;
49
50 #[unsafe(method(isLeaf))]
51 #[unsafe(method_family = none)]
52 pub fn isLeaf(&self) -> bool;
53
54 #[unsafe(method(childNodes))]
55 #[unsafe(method_family = none)]
56 pub fn childNodes(&self) -> Option<Retained<NSArray<NSTreeNode>>>;
57
58 #[unsafe(method(mutableChildNodes))]
59 #[unsafe(method_family = none)]
60 pub fn mutableChildNodes(&self) -> Retained<NSMutableArray<NSTreeNode>>;
61
62 #[unsafe(method(descendantNodeAtIndexPath:))]
63 #[unsafe(method_family = none)]
64 pub fn descendantNodeAtIndexPath(
65 &self,
66 index_path: &NSIndexPath,
67 ) -> Option<Retained<NSTreeNode>>;
68
69 #[unsafe(method(parentNode))]
70 #[unsafe(method_family = none)]
71 pub fn parentNode(&self) -> Option<Retained<NSTreeNode>>;
72
73 #[unsafe(method(sortWithSortDescriptors:recursively:))]
74 #[unsafe(method_family = none)]
75 pub fn sortWithSortDescriptors_recursively(
76 &self,
77 sort_descriptors: &NSArray<NSSortDescriptor>,
78 recursively: bool,
79 );
80 );
81}
82
83impl NSTreeNode {
85 extern_methods!(
86 #[unsafe(method(init))]
87 #[unsafe(method_family = init)]
88 pub fn init(this: Allocated<Self>) -> Retained<Self>;
89
90 #[unsafe(method(new))]
91 #[unsafe(method_family = new)]
92 pub fn new() -> Retained<Self>;
93 );
94}
95
96impl DefaultRetained for NSTreeNode {
97 #[inline]
98 fn default_retained() -> Retained<Self> {
99 Self::new()
100 }
101}