objc2_app_kit/generated/
NSTreeNode.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/nstreenode?language=objc)
12    #[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:))]
24        #[unsafe(method_family = none)]
25        pub unsafe fn treeNodeWithRepresentedObject(
26            model_object: Option<&AnyObject>,
27        ) -> Retained<Self>;
28
29        #[unsafe(method(initWithRepresentedObject:))]
30        #[unsafe(method_family = init)]
31        pub unsafe fn initWithRepresentedObject(
32            this: Allocated<Self>,
33            model_object: Option<&AnyObject>,
34        ) -> Retained<Self>;
35
36        #[unsafe(method(representedObject))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn representedObject(&self) -> Option<Retained<AnyObject>>;
39
40        #[unsafe(method(indexPath))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn indexPath(&self) -> Retained<NSIndexPath>;
43
44        #[unsafe(method(isLeaf))]
45        #[unsafe(method_family = none)]
46        pub unsafe fn isLeaf(&self) -> bool;
47
48        #[unsafe(method(childNodes))]
49        #[unsafe(method_family = none)]
50        pub unsafe fn childNodes(&self) -> Option<Retained<NSArray<NSTreeNode>>>;
51
52        #[unsafe(method(mutableChildNodes))]
53        #[unsafe(method_family = none)]
54        pub unsafe fn mutableChildNodes(&self) -> Retained<NSMutableArray<NSTreeNode>>;
55
56        #[unsafe(method(descendantNodeAtIndexPath:))]
57        #[unsafe(method_family = none)]
58        pub unsafe fn descendantNodeAtIndexPath(
59            &self,
60            index_path: &NSIndexPath,
61        ) -> Option<Retained<NSTreeNode>>;
62
63        #[unsafe(method(parentNode))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn parentNode(&self) -> Option<Retained<NSTreeNode>>;
66
67        #[unsafe(method(sortWithSortDescriptors:recursively:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn sortWithSortDescriptors_recursively(
70            &self,
71            sort_descriptors: &NSArray<NSSortDescriptor>,
72            recursively: bool,
73        );
74    );
75}
76
77/// Methods declared on superclass `NSObject`.
78impl NSTreeNode {
79    extern_methods!(
80        #[unsafe(method(init))]
81        #[unsafe(method_family = init)]
82        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
83
84        #[unsafe(method(new))]
85        #[unsafe(method_family = new)]
86        pub unsafe fn new() -> Retained<Self>;
87    );
88}