objc2_app_kit/generated/
NSArrayController.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/nsarraycontroller?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 NSArrayController;
17);
18
19#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
20extern_conformance!(
21    unsafe impl NSCoding for NSArrayController {}
22);
23
24#[cfg(all(
25    feature = "NSController",
26    feature = "NSKeyValueBinding",
27    feature = "NSObjectController"
28))]
29extern_conformance!(
30    unsafe impl NSEditor for NSArrayController {}
31);
32
33#[cfg(all(
34    feature = "NSController",
35    feature = "NSKeyValueBinding",
36    feature = "NSObjectController"
37))]
38extern_conformance!(
39    unsafe impl NSEditorRegistration for NSArrayController {}
40);
41
42#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
43extern_conformance!(
44    unsafe impl NSObjectProtocol for NSArrayController {}
45);
46
47#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
48impl NSArrayController {
49    extern_methods!(
50        #[unsafe(method(rearrangeObjects))]
51        #[unsafe(method_family = none)]
52        pub unsafe fn rearrangeObjects(&self);
53
54        #[unsafe(method(automaticallyRearrangesObjects))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn automaticallyRearrangesObjects(&self) -> bool;
57
58        /// Setter for [`automaticallyRearrangesObjects`][Self::automaticallyRearrangesObjects].
59        #[unsafe(method(setAutomaticallyRearrangesObjects:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setAutomaticallyRearrangesObjects(
62            &self,
63            automatically_rearranges_objects: bool,
64        );
65
66        #[unsafe(method(automaticRearrangementKeyPaths))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn automaticRearrangementKeyPaths(&self) -> Option<Retained<NSArray<NSString>>>;
69
70        #[unsafe(method(didChangeArrangementCriteria))]
71        #[unsafe(method_family = none)]
72        pub unsafe fn didChangeArrangementCriteria(&self);
73
74        #[unsafe(method(sortDescriptors))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn sortDescriptors(&self) -> Retained<NSArray<NSSortDescriptor>>;
77
78        /// Setter for [`sortDescriptors`][Self::sortDescriptors].
79        #[unsafe(method(setSortDescriptors:))]
80        #[unsafe(method_family = none)]
81        pub unsafe fn setSortDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
82
83        #[unsafe(method(filterPredicate))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn filterPredicate(&self) -> Option<Retained<NSPredicate>>;
86
87        /// Setter for [`filterPredicate`][Self::filterPredicate].
88        #[unsafe(method(setFilterPredicate:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setFilterPredicate(&self, filter_predicate: Option<&NSPredicate>);
91
92        #[unsafe(method(clearsFilterPredicateOnInsertion))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn clearsFilterPredicateOnInsertion(&self) -> bool;
95
96        /// Setter for [`clearsFilterPredicateOnInsertion`][Self::clearsFilterPredicateOnInsertion].
97        #[unsafe(method(setClearsFilterPredicateOnInsertion:))]
98        #[unsafe(method_family = none)]
99        pub unsafe fn setClearsFilterPredicateOnInsertion(
100            &self,
101            clears_filter_predicate_on_insertion: bool,
102        );
103
104        #[unsafe(method(arrangeObjects:))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn arrangeObjects(&self, objects: &NSArray) -> Retained<NSArray>;
107
108        #[unsafe(method(arrangedObjects))]
109        #[unsafe(method_family = none)]
110        pub unsafe fn arrangedObjects(&self) -> Retained<AnyObject>;
111
112        #[unsafe(method(avoidsEmptySelection))]
113        #[unsafe(method_family = none)]
114        pub unsafe fn avoidsEmptySelection(&self) -> bool;
115
116        /// Setter for [`avoidsEmptySelection`][Self::avoidsEmptySelection].
117        #[unsafe(method(setAvoidsEmptySelection:))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn setAvoidsEmptySelection(&self, avoids_empty_selection: bool);
120
121        #[unsafe(method(preservesSelection))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn preservesSelection(&self) -> bool;
124
125        /// Setter for [`preservesSelection`][Self::preservesSelection].
126        #[unsafe(method(setPreservesSelection:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn setPreservesSelection(&self, preserves_selection: bool);
129
130        #[unsafe(method(selectsInsertedObjects))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn selectsInsertedObjects(&self) -> bool;
133
134        /// Setter for [`selectsInsertedObjects`][Self::selectsInsertedObjects].
135        #[unsafe(method(setSelectsInsertedObjects:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setSelectsInsertedObjects(&self, selects_inserted_objects: bool);
138
139        #[unsafe(method(alwaysUsesMultipleValuesMarker))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn alwaysUsesMultipleValuesMarker(&self) -> bool;
142
143        /// Setter for [`alwaysUsesMultipleValuesMarker`][Self::alwaysUsesMultipleValuesMarker].
144        #[unsafe(method(setAlwaysUsesMultipleValuesMarker:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn setAlwaysUsesMultipleValuesMarker(
147            &self,
148            always_uses_multiple_values_marker: bool,
149        );
150
151        #[unsafe(method(setSelectionIndexes:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
154
155        #[unsafe(method(selectionIndexes))]
156        #[unsafe(method_family = none)]
157        pub unsafe fn selectionIndexes(&self) -> Retained<NSIndexSet>;
158
159        #[unsafe(method(setSelectionIndex:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn setSelectionIndex(&self, index: NSUInteger) -> bool;
162
163        #[unsafe(method(selectionIndex))]
164        #[unsafe(method_family = none)]
165        pub unsafe fn selectionIndex(&self) -> NSUInteger;
166
167        #[unsafe(method(addSelectionIndexes:))]
168        #[unsafe(method_family = none)]
169        pub unsafe fn addSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
170
171        #[unsafe(method(removeSelectionIndexes:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn removeSelectionIndexes(&self, indexes: &NSIndexSet) -> bool;
174
175        #[unsafe(method(setSelectedObjects:))]
176        #[unsafe(method_family = none)]
177        pub unsafe fn setSelectedObjects(&self, objects: &NSArray) -> bool;
178
179        #[unsafe(method(selectedObjects))]
180        #[unsafe(method_family = none)]
181        pub unsafe fn selectedObjects(&self) -> Retained<NSArray>;
182
183        #[unsafe(method(addSelectedObjects:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn addSelectedObjects(&self, objects: &NSArray) -> bool;
186
187        #[unsafe(method(removeSelectedObjects:))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn removeSelectedObjects(&self, objects: &NSArray) -> bool;
190
191        #[unsafe(method(add:))]
192        #[unsafe(method_family = none)]
193        pub unsafe fn add(&self, sender: Option<&AnyObject>);
194
195        #[unsafe(method(remove:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn remove(&self, sender: Option<&AnyObject>);
198
199        #[unsafe(method(insert:))]
200        #[unsafe(method_family = none)]
201        pub unsafe fn insert(&self, sender: Option<&AnyObject>);
202
203        #[unsafe(method(canInsert))]
204        #[unsafe(method_family = none)]
205        pub unsafe fn canInsert(&self) -> bool;
206
207        #[unsafe(method(selectNext:))]
208        #[unsafe(method_family = none)]
209        pub unsafe fn selectNext(&self, sender: Option<&AnyObject>);
210
211        #[unsafe(method(selectPrevious:))]
212        #[unsafe(method_family = none)]
213        pub unsafe fn selectPrevious(&self, sender: Option<&AnyObject>);
214
215        #[unsafe(method(canSelectNext))]
216        #[unsafe(method_family = none)]
217        pub unsafe fn canSelectNext(&self) -> bool;
218
219        #[unsafe(method(canSelectPrevious))]
220        #[unsafe(method_family = none)]
221        pub unsafe fn canSelectPrevious(&self) -> bool;
222
223        #[unsafe(method(addObject:))]
224        #[unsafe(method_family = none)]
225        pub unsafe fn addObject(&self, object: &AnyObject);
226
227        #[unsafe(method(addObjects:))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn addObjects(&self, objects: &NSArray);
230
231        #[unsafe(method(insertObject:atArrangedObjectIndex:))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn insertObject_atArrangedObjectIndex(
234            &self,
235            object: &AnyObject,
236            index: NSUInteger,
237        );
238
239        #[unsafe(method(insertObjects:atArrangedObjectIndexes:))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn insertObjects_atArrangedObjectIndexes(
242            &self,
243            objects: &NSArray,
244            indexes: &NSIndexSet,
245        );
246
247        #[unsafe(method(removeObjectAtArrangedObjectIndex:))]
248        #[unsafe(method_family = none)]
249        pub unsafe fn removeObjectAtArrangedObjectIndex(&self, index: NSUInteger);
250
251        #[unsafe(method(removeObjectsAtArrangedObjectIndexes:))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn removeObjectsAtArrangedObjectIndexes(&self, indexes: &NSIndexSet);
254
255        #[unsafe(method(removeObject:))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn removeObject(&self, object: &AnyObject);
258
259        #[unsafe(method(removeObjects:))]
260        #[unsafe(method_family = none)]
261        pub unsafe fn removeObjects(&self, objects: &NSArray);
262    );
263}
264
265/// Methods declared on superclass `NSObjectController`.
266#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
267impl NSArrayController {
268    extern_methods!(
269        #[unsafe(method(initWithContent:))]
270        #[unsafe(method_family = init)]
271        pub unsafe fn initWithContent(
272            this: Allocated<Self>,
273            content: Option<&AnyObject>,
274        ) -> Retained<Self>;
275
276        #[unsafe(method(initWithCoder:))]
277        #[unsafe(method_family = init)]
278        pub unsafe fn initWithCoder(
279            this: Allocated<Self>,
280            coder: &NSCoder,
281        ) -> Option<Retained<Self>>;
282    );
283}
284
285/// Methods declared on superclass `NSController`.
286#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
287impl NSArrayController {
288    extern_methods!(
289        #[unsafe(method(init))]
290        #[unsafe(method_family = init)]
291        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
292    );
293}
294
295/// Methods declared on superclass `NSObject`.
296#[cfg(all(feature = "NSController", feature = "NSObjectController"))]
297impl NSArrayController {
298    extern_methods!(
299        #[unsafe(method(new))]
300        #[unsafe(method_family = new)]
301        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
302    );
303}