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