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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    pub struct NSArrayController;

    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl ClassType for NSArrayController {
        #[inherits(NSController, NSObject)]
        type Super = NSObjectController;
        type Mutability = MainThreadOnly;
    }
);

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSCoding for NSArrayController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditor for NSArrayController {}

#[cfg(all(
    feature = "NSController",
    feature = "NSKeyValueBinding",
    feature = "NSObjectController"
))]
unsafe impl NSEditorRegistration for NSArrayController {}

#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
unsafe impl NSObjectProtocol for NSArrayController {}

extern_methods!(
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method(rearrangeObjects)]
        pub unsafe fn rearrangeObjects(&self);

        #[method(automaticallyRearrangesObjects)]
        pub unsafe fn automaticallyRearrangesObjects(&self) -> bool;

        #[method(setAutomaticallyRearrangesObjects:)]
        pub unsafe fn setAutomaticallyRearrangesObjects(
            &self,
            automatically_rearranges_objects: bool,
        );

        #[method_id(@__retain_semantics Other automaticRearrangementKeyPaths)]
        pub unsafe fn automaticRearrangementKeyPaths(&self) -> Option<Id<NSArray<NSString>>>;

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

        #[method_id(@__retain_semantics Other sortDescriptors)]
        pub unsafe fn sortDescriptors(&self) -> Id<NSArray<NSSortDescriptor>>;

        #[method(setSortDescriptors:)]
        pub unsafe fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);

        #[method_id(@__retain_semantics Other filterPredicate)]
        pub unsafe fn filterPredicate(&self) -> Option<Id<NSPredicate>>;

        #[method(setFilterPredicate:)]
        pub unsafe fn setFilterPredicate(&self, filter_predicate: Option<&NSPredicate>);

        #[method(clearsFilterPredicateOnInsertion)]
        pub unsafe fn clearsFilterPredicateOnInsertion(&self) -> bool;

        #[method(setClearsFilterPredicateOnInsertion:)]
        pub unsafe fn setClearsFilterPredicateOnInsertion(
            &self,
            clears_filter_predicate_on_insertion: bool,
        );

        #[method_id(@__retain_semantics Other arrangeObjects:)]
        pub unsafe fn arrangeObjects(&self, objects: &NSArray) -> Id<NSArray>;

        #[method_id(@__retain_semantics Other arrangedObjects)]
        pub unsafe fn arrangedObjects(&self) -> Id<AnyObject>;

        #[method(avoidsEmptySelection)]
        pub unsafe fn avoidsEmptySelection(&self) -> bool;

        #[method(setAvoidsEmptySelection:)]
        pub unsafe fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);

        #[method(preservesSelection)]
        pub unsafe fn preservesSelection(&self) -> bool;

        #[method(setPreservesSelection:)]
        pub unsafe fn setPreservesSelection(&self, preserves_selection: bool);

        #[method(selectsInsertedObjects)]
        pub unsafe fn selectsInsertedObjects(&self) -> bool;

        #[method(setSelectsInsertedObjects:)]
        pub unsafe fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);

        #[method(alwaysUsesMultipleValuesMarker)]
        pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool;

        #[method(setAlwaysUsesMultipleValuesMarker:)]
        pub unsafe fn setAlwaysUsesMultipleValuesMarker(
            &self,
            always_uses_multiple_values_marker: bool,
        );

        #[method(setSelectionIndexes:)]
        pub unsafe fn setSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method_id(@__retain_semantics Other selectionIndexes)]
        pub unsafe fn selectionIndexes(&self) -> Id<NSIndexSet>;

        #[method(setSelectionIndex:)]
        pub unsafe fn setSelectionIndex(&self, index: NSUInteger) -> bool;

        #[method(selectionIndex)]
        pub unsafe fn selectionIndex(&self) -> NSUInteger;

        #[method(addSelectionIndexes:)]
        pub unsafe fn addSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method(removeSelectionIndexes:)]
        pub unsafe fn removeSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;

        #[method(setSelectedObjects:)]
        pub unsafe fn setSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method_id(@__retain_semantics Other selectedObjects)]
        pub unsafe fn selectedObjects(&self) -> Id<NSArray>;

        #[method(addSelectedObjects:)]
        pub unsafe fn addSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method(removeSelectedObjects:)]
        pub unsafe fn removeSelectedObjects(&self, objects: &NSArray) -> bool;

        #[method(add:)]
        pub unsafe fn add(&self, sender: Option<&AnyObject>);

        #[method(remove:)]
        pub unsafe fn remove(&self, sender: Option<&AnyObject>);

        #[method(insert:)]
        pub unsafe fn insert(&self, sender: Option<&AnyObject>);

        #[method(canInsert)]
        pub unsafe fn canInsert(&self) -> bool;

        #[method(selectNext:)]
        pub unsafe fn selectNext(&self, sender: Option<&AnyObject>);

        #[method(selectPrevious:)]
        pub unsafe fn selectPrevious(&self, sender: Option<&AnyObject>);

        #[method(canSelectNext)]
        pub unsafe fn canSelectNext(&self) -> bool;

        #[method(canSelectPrevious)]
        pub unsafe fn canSelectPrevious(&self) -> bool;

        #[method(addObject:)]
        pub unsafe fn addObject(&self, object: &AnyObject);

        #[method(addObjects:)]
        pub unsafe fn addObjects(&self, objects: &NSArray);

        #[method(insertObject:atArrangedObjectIndex:)]
        pub unsafe fn insertObject_atArrangedObjectIndex(
            &self,
            object: &AnyObject,
            index: NSUInteger,
        );

        #[method(insertObjects:atArrangedObjectIndexes:)]
        pub unsafe fn insertObjects_atArrangedObjectIndexes(
            &self,
            objects: &NSArray,
            indexes: &NSIndexSet,
        );

        #[method(removeObjectAtArrangedObjectIndex:)]
        pub unsafe fn removeObjectAtArrangedObjectIndex(&self, index: NSUInteger);

        #[method(removeObjectsAtArrangedObjectIndexes:)]
        pub unsafe fn removeObjectsAtArrangedObjectIndexes(&self, indexes: &NSIndexSet);

        #[method(removeObject:)]
        pub unsafe fn removeObject(&self, object: &AnyObject);

        #[method(removeObjects:)]
        pub unsafe fn removeObjects(&self, objects: &NSArray);
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObjectController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics Init initWithContent:)]
        pub unsafe fn initWithContent(
            this: Allocated<Self>,
            content: Option<&AnyObject>,
        ) -> Id<Self>;

        #[method_id(@__retain_semantics Init initWithCoder:)]
        pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Option<Id<Self>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSController`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    #[cfg(all(feature = "NSController", feature = "NSObjectController"))]
    unsafe impl NSArrayController {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Id<Self>;
    }
);