1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

__inner_extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct NSDiffableDataSourceSectionSnapshot<ItemIdentifierType: ?Sized = AnyObject> {
        __superclass: NSObject,
        _inner0: PhantomData<*mut ItemIdentifierType>,
        notunwindsafe: PhantomData<&'static mut ()>,
    }

    unsafe impl<ItemIdentifierType: ?Sized + Message> ClassType
        for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
    {
        type Super = NSObject;
        type Mutability = InteriorMutable;

        fn as_super(&self) -> &Self::Super {
            &self.__superclass
        }

        fn as_super_mut(&mut self) -> &mut Self::Super {
            &mut self.__superclass
        }
    }
);

unsafe impl<ItemIdentifierType: ?Sized + IsIdCloneable> NSCopying
    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}

unsafe impl<ItemIdentifierType: ?Sized> NSObjectProtocol
    for NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>
{
}

extern_methods!(
    unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method(appendItems:)]
        pub unsafe fn appendItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(appendItems:intoParentItem:)]
        pub unsafe fn appendItems_intoParentItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            parent_item: Option<&ItemIdentifierType>,
        );

        #[method(insertItems:beforeItem:)]
        pub unsafe fn insertItems_beforeItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            before_identifier: &ItemIdentifierType,
        );

        #[method(insertItems:afterItem:)]
        pub unsafe fn insertItems_afterItem(
            &self,
            items: &NSArray<ItemIdentifierType>,
            after_identifier: &ItemIdentifierType,
        );

        #[method(deleteItems:)]
        pub unsafe fn deleteItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(deleteAllItems)]
        pub unsafe fn deleteAllItems(&self);

        #[method(expandItems:)]
        pub unsafe fn expandItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(collapseItems:)]
        pub unsafe fn collapseItems(&self, items: &NSArray<ItemIdentifierType>);

        #[method(replaceChildrenOfParentItem:withSnapshot:)]
        pub unsafe fn replaceChildrenOfParentItem_withSnapshot(
            &self,
            parent_item: &ItemIdentifierType,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
        );

        #[method(insertSnapshot:beforeItem:)]
        pub unsafe fn insertSnapshot_beforeItem(
            &self,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
            item: &ItemIdentifierType,
        );

        #[method_id(@__retain_semantics Other insertSnapshot:afterItem:)]
        pub unsafe fn insertSnapshot_afterItem(
            &self,
            snapshot: &NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>,
            item: &ItemIdentifierType,
        ) -> Retained<ItemIdentifierType>;

        #[method(isExpanded:)]
        pub unsafe fn isExpanded(&self, item: &ItemIdentifierType) -> bool;

        #[method(isVisible:)]
        pub unsafe fn isVisible(&self, item: &ItemIdentifierType) -> bool;

        #[method(containsItem:)]
        pub unsafe fn containsItem(&self, item: &ItemIdentifierType) -> bool;

        #[method(levelOfItem:)]
        pub unsafe fn levelOfItem(&self, item: &ItemIdentifierType) -> NSInteger;

        #[method(indexOfItem:)]
        pub unsafe fn indexOfItem(&self, item: &ItemIdentifierType) -> NSInteger;

        #[method_id(@__retain_semantics Other expandedItems)]
        pub unsafe fn expandedItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other parentOfChildItem:)]
        pub unsafe fn parentOfChildItem(
            &self,
            child_item: &ItemIdentifierType,
        ) -> Option<Retained<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other snapshotOfParentItem:)]
        pub unsafe fn snapshotOfParentItem(
            &self,
            parent_item: &ItemIdentifierType,
        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other snapshotOfParentItem:includingParentItem:)]
        pub unsafe fn snapshotOfParentItem_includingParentItem(
            &self,
            parent_item: &ItemIdentifierType,
            including_parent_item: bool,
        ) -> Retained<NSDiffableDataSourceSectionSnapshot<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other rootItems)]
        pub unsafe fn rootItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other visibleItems)]
        pub unsafe fn visibleItems(&self) -> Retained<NSArray<ItemIdentifierType>>;

        #[method_id(@__retain_semantics Other visualDescription)]
        pub unsafe fn visualDescription(&self) -> Retained<NSString>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl<ItemIdentifierType: Message> NSDiffableDataSourceSectionSnapshot<ItemIdentifierType> {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);