objc2_foundation/generated/
NSOrderedSet.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::*;
6
7use crate::*;
8
9extern_class!(
10    /// **************       Immutable Ordered Set   ***************
11    ///
12    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsorderedset?language=objc)
13    #[unsafe(super(NSObject))]
14    #[derive(Debug, PartialEq, Eq, Hash)]
15    pub struct NSOrderedSet<ObjectType: ?Sized = AnyObject>;
16);
17
18#[cfg(feature = "NSObject")]
19extern_conformance!(
20    unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for NSOrderedSet<ObjectType> {}
21);
22
23#[cfg(feature = "NSObject")]
24extern_conformance!(
25    unsafe impl<ObjectType: ?Sized> NSCopying for NSOrderedSet<ObjectType> {}
26);
27
28#[cfg(feature = "NSObject")]
29unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for NSOrderedSet<ObjectType> {
30    type Result = Self;
31}
32
33#[cfg(feature = "NSEnumerator")]
34extern_conformance!(
35    unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSOrderedSet<ObjectType> {}
36);
37
38#[cfg(feature = "NSObject")]
39extern_conformance!(
40    unsafe impl<ObjectType: ?Sized> NSMutableCopying for NSOrderedSet<ObjectType> {}
41);
42
43#[cfg(feature = "NSObject")]
44unsafe impl<ObjectType: ?Sized + Message> MutableCopyingHelper for NSOrderedSet<ObjectType> {
45    type Result = NSMutableOrderedSet<ObjectType>;
46}
47
48extern_conformance!(
49    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSOrderedSet<ObjectType> {}
50);
51
52#[cfg(feature = "NSObject")]
53extern_conformance!(
54    unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding for NSOrderedSet<ObjectType> {}
55);
56
57impl<ObjectType: Message> NSOrderedSet<ObjectType> {
58    extern_methods!(
59        #[unsafe(method(count))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn count(&self) -> NSUInteger;
62
63        #[unsafe(method(objectAtIndex:))]
64        #[unsafe(method_family = none)]
65        pub unsafe fn objectAtIndex(&self, idx: NSUInteger) -> Retained<ObjectType>;
66
67        #[unsafe(method(indexOfObject:))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn indexOfObject(&self, object: &ObjectType) -> NSUInteger;
70
71        #[unsafe(method(init))]
72        #[unsafe(method_family = init)]
73        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
74
75        #[unsafe(method(initWithObjects:count:))]
76        #[unsafe(method_family = init)]
77        pub unsafe fn initWithObjects_count(
78            this: Allocated<Self>,
79            objects: *mut NonNull<ObjectType>,
80            cnt: NSUInteger,
81        ) -> Retained<Self>;
82
83        #[cfg(feature = "NSCoder")]
84        #[unsafe(method(initWithCoder:))]
85        #[unsafe(method_family = init)]
86        pub unsafe fn initWithCoder(
87            this: Allocated<Self>,
88            coder: &NSCoder,
89        ) -> Option<Retained<Self>>;
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl<ObjectType: Message> NSOrderedSet<ObjectType> {
95    extern_methods!(
96        #[unsafe(method(new))]
97        #[unsafe(method_family = new)]
98        pub unsafe fn new() -> Retained<Self>;
99    );
100}
101
102/// NSExtendedOrderedSet.
103impl<ObjectType: Message> NSOrderedSet<ObjectType> {
104    extern_methods!(
105        #[cfg(feature = "NSRange")]
106        #[unsafe(method(getObjects:range:))]
107        #[unsafe(method_family = none)]
108        pub unsafe fn getObjects_range(&self, objects: *mut NonNull<ObjectType>, range: NSRange);
109
110        #[cfg(all(feature = "NSArray", feature = "NSIndexSet"))]
111        #[unsafe(method(objectsAtIndexes:))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn objectsAtIndexes(
114            &self,
115            indexes: &NSIndexSet,
116        ) -> Retained<NSArray<ObjectType>>;
117
118        #[unsafe(method(firstObject))]
119        #[unsafe(method_family = none)]
120        pub unsafe fn firstObject(&self) -> Option<Retained<ObjectType>>;
121
122        #[unsafe(method(lastObject))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn lastObject(&self) -> Option<Retained<ObjectType>>;
125
126        #[unsafe(method(isEqualToOrderedSet:))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn isEqualToOrderedSet(&self, other: &NSOrderedSet<ObjectType>) -> bool;
129
130        #[unsafe(method(containsObject:))]
131        #[unsafe(method_family = none)]
132        pub unsafe fn containsObject(&self, object: &ObjectType) -> bool;
133
134        #[unsafe(method(intersectsOrderedSet:))]
135        #[unsafe(method_family = none)]
136        pub unsafe fn intersectsOrderedSet(&self, other: &NSOrderedSet<ObjectType>) -> bool;
137
138        #[cfg(feature = "NSSet")]
139        #[unsafe(method(intersectsSet:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn intersectsSet(&self, set: &NSSet<ObjectType>) -> bool;
142
143        #[unsafe(method(isSubsetOfOrderedSet:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn isSubsetOfOrderedSet(&self, other: &NSOrderedSet<ObjectType>) -> bool;
146
147        #[cfg(feature = "NSSet")]
148        #[unsafe(method(isSubsetOfSet:))]
149        #[unsafe(method_family = none)]
150        pub unsafe fn isSubsetOfSet(&self, set: &NSSet<ObjectType>) -> bool;
151
152        #[unsafe(method(objectAtIndexedSubscript:))]
153        #[unsafe(method_family = none)]
154        pub unsafe fn objectAtIndexedSubscript(&self, idx: NSUInteger) -> Retained<ObjectType>;
155
156        #[cfg(feature = "NSEnumerator")]
157        #[unsafe(method(objectEnumerator))]
158        #[unsafe(method_family = none)]
159        pub unsafe fn objectEnumerator(&self) -> Retained<NSEnumerator<ObjectType>>;
160
161        #[cfg(feature = "NSEnumerator")]
162        #[unsafe(method(reverseObjectEnumerator))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn reverseObjectEnumerator(&self) -> Retained<NSEnumerator<ObjectType>>;
165
166        #[unsafe(method(reversedOrderedSet))]
167        #[unsafe(method_family = none)]
168        pub unsafe fn reversedOrderedSet(&self) -> Retained<NSOrderedSet<ObjectType>>;
169
170        #[cfg(feature = "NSArray")]
171        #[unsafe(method(array))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn array(&self) -> Retained<NSArray<ObjectType>>;
174
175        #[cfg(feature = "NSSet")]
176        #[unsafe(method(set))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn set(&self) -> Retained<NSSet<ObjectType>>;
179
180        #[cfg(feature = "block2")]
181        #[unsafe(method(enumerateObjectsUsingBlock:))]
182        #[unsafe(method_family = none)]
183        pub unsafe fn enumerateObjectsUsingBlock(
184            &self,
185            block: &block2::DynBlock<dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) + '_>,
186        );
187
188        #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))]
189        #[unsafe(method(enumerateObjectsWithOptions:usingBlock:))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn enumerateObjectsWithOptions_usingBlock(
192            &self,
193            opts: NSEnumerationOptions,
194            block: &block2::DynBlock<dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) + '_>,
195        );
196
197        #[cfg(all(feature = "NSIndexSet", feature = "NSObjCRuntime", feature = "block2"))]
198        #[unsafe(method(enumerateObjectsAtIndexes:options:usingBlock:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn enumerateObjectsAtIndexes_options_usingBlock(
201            &self,
202            s: &NSIndexSet,
203            opts: NSEnumerationOptions,
204            block: &block2::DynBlock<dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) + '_>,
205        );
206
207        #[cfg(feature = "block2")]
208        #[unsafe(method(indexOfObjectPassingTest:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn indexOfObjectPassingTest(
211            &self,
212            predicate: &block2::DynBlock<
213                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
214            >,
215        ) -> NSUInteger;
216
217        #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))]
218        #[unsafe(method(indexOfObjectWithOptions:passingTest:))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn indexOfObjectWithOptions_passingTest(
221            &self,
222            opts: NSEnumerationOptions,
223            predicate: &block2::DynBlock<
224                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
225            >,
226        ) -> NSUInteger;
227
228        #[cfg(all(feature = "NSIndexSet", feature = "NSObjCRuntime", feature = "block2"))]
229        #[unsafe(method(indexOfObjectAtIndexes:options:passingTest:))]
230        #[unsafe(method_family = none)]
231        pub unsafe fn indexOfObjectAtIndexes_options_passingTest(
232            &self,
233            s: &NSIndexSet,
234            opts: NSEnumerationOptions,
235            predicate: &block2::DynBlock<
236                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
237            >,
238        ) -> NSUInteger;
239
240        #[cfg(all(feature = "NSIndexSet", feature = "block2"))]
241        #[unsafe(method(indexesOfObjectsPassingTest:))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn indexesOfObjectsPassingTest(
244            &self,
245            predicate: &block2::DynBlock<
246                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
247            >,
248        ) -> Retained<NSIndexSet>;
249
250        #[cfg(all(feature = "NSIndexSet", feature = "NSObjCRuntime", feature = "block2"))]
251        #[unsafe(method(indexesOfObjectsWithOptions:passingTest:))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn indexesOfObjectsWithOptions_passingTest(
254            &self,
255            opts: NSEnumerationOptions,
256            predicate: &block2::DynBlock<
257                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
258            >,
259        ) -> Retained<NSIndexSet>;
260
261        #[cfg(all(feature = "NSIndexSet", feature = "NSObjCRuntime", feature = "block2"))]
262        #[unsafe(method(indexesOfObjectsAtIndexes:options:passingTest:))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn indexesOfObjectsAtIndexes_options_passingTest(
265            &self,
266            s: &NSIndexSet,
267            opts: NSEnumerationOptions,
268            predicate: &block2::DynBlock<
269                dyn Fn(NonNull<ObjectType>, NSUInteger, NonNull<Bool>) -> Bool + '_,
270            >,
271        ) -> Retained<NSIndexSet>;
272
273        #[cfg(all(
274            feature = "NSArray",
275            feature = "NSObjCRuntime",
276            feature = "NSRange",
277            feature = "block2"
278        ))]
279        #[unsafe(method(indexOfObject:inSortedRange:options:usingComparator:))]
280        #[unsafe(method_family = none)]
281        pub unsafe fn indexOfObject_inSortedRange_options_usingComparator(
282            &self,
283            object: &ObjectType,
284            range: NSRange,
285            opts: NSBinarySearchingOptions,
286            cmp: NSComparator,
287        ) -> NSUInteger;
288
289        #[cfg(all(feature = "NSArray", feature = "NSObjCRuntime", feature = "block2"))]
290        #[unsafe(method(sortedArrayUsingComparator:))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn sortedArrayUsingComparator(
293            &self,
294            cmptr: NSComparator,
295        ) -> Retained<NSArray<ObjectType>>;
296
297        #[cfg(all(feature = "NSArray", feature = "NSObjCRuntime", feature = "block2"))]
298        #[unsafe(method(sortedArrayWithOptions:usingComparator:))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn sortedArrayWithOptions_usingComparator(
301            &self,
302            opts: NSSortOptions,
303            cmptr: NSComparator,
304        ) -> Retained<NSArray<ObjectType>>;
305
306        #[cfg(feature = "NSString")]
307        #[unsafe(method(description))]
308        #[unsafe(method_family = none)]
309        pub unsafe fn description(&self) -> Retained<NSString>;
310
311        #[cfg(feature = "NSString")]
312        #[unsafe(method(descriptionWithLocale:))]
313        #[unsafe(method_family = none)]
314        pub unsafe fn descriptionWithLocale(
315            &self,
316            locale: Option<&AnyObject>,
317        ) -> Retained<NSString>;
318
319        #[cfg(feature = "NSString")]
320        #[unsafe(method(descriptionWithLocale:indent:))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn descriptionWithLocale_indent(
323            &self,
324            locale: Option<&AnyObject>,
325            level: NSUInteger,
326        ) -> Retained<NSString>;
327    );
328}
329
330/// NSOrderedSetCreation.
331impl<ObjectType: Message> NSOrderedSet<ObjectType> {
332    extern_methods!(
333        #[unsafe(method(orderedSet))]
334        #[unsafe(method_family = none)]
335        pub unsafe fn orderedSet() -> Retained<Self>;
336
337        #[unsafe(method(orderedSetWithObject:))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn orderedSetWithObject(object: &ObjectType) -> Retained<Self>;
340
341        #[unsafe(method(orderedSetWithObjects:count:))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn orderedSetWithObjects_count(
344            objects: NonNull<NonNull<ObjectType>>,
345            cnt: NSUInteger,
346        ) -> Retained<Self>;
347
348        #[unsafe(method(orderedSetWithOrderedSet:))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn orderedSetWithOrderedSet(set: &NSOrderedSet<ObjectType>) -> Retained<Self>;
351
352        #[cfg(feature = "NSRange")]
353        #[unsafe(method(orderedSetWithOrderedSet:range:copyItems:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn orderedSetWithOrderedSet_range_copyItems(
356            set: &NSOrderedSet<ObjectType>,
357            range: NSRange,
358            flag: bool,
359        ) -> Retained<Self>;
360
361        #[cfg(feature = "NSArray")]
362        #[unsafe(method(orderedSetWithArray:))]
363        #[unsafe(method_family = none)]
364        pub unsafe fn orderedSetWithArray(array: &NSArray<ObjectType>) -> Retained<Self>;
365
366        #[cfg(all(feature = "NSArray", feature = "NSRange"))]
367        #[unsafe(method(orderedSetWithArray:range:copyItems:))]
368        #[unsafe(method_family = none)]
369        pub unsafe fn orderedSetWithArray_range_copyItems(
370            array: &NSArray<ObjectType>,
371            range: NSRange,
372            flag: bool,
373        ) -> Retained<Self>;
374
375        #[cfg(feature = "NSSet")]
376        #[unsafe(method(orderedSetWithSet:))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn orderedSetWithSet(set: &NSSet<ObjectType>) -> Retained<Self>;
379
380        #[cfg(feature = "NSSet")]
381        #[unsafe(method(orderedSetWithSet:copyItems:))]
382        #[unsafe(method_family = none)]
383        pub unsafe fn orderedSetWithSet_copyItems(
384            set: &NSSet<ObjectType>,
385            flag: bool,
386        ) -> Retained<Self>;
387
388        #[unsafe(method(initWithObject:))]
389        #[unsafe(method_family = init)]
390        pub unsafe fn initWithObject(this: Allocated<Self>, object: &ObjectType) -> Retained<Self>;
391
392        #[unsafe(method(initWithOrderedSet:))]
393        #[unsafe(method_family = init)]
394        pub unsafe fn initWithOrderedSet(
395            this: Allocated<Self>,
396            set: &NSOrderedSet<ObjectType>,
397        ) -> Retained<Self>;
398
399        #[unsafe(method(initWithOrderedSet:copyItems:))]
400        #[unsafe(method_family = init)]
401        pub unsafe fn initWithOrderedSet_copyItems(
402            this: Allocated<Self>,
403            set: &NSOrderedSet<ObjectType>,
404            flag: bool,
405        ) -> Retained<Self>;
406
407        #[cfg(feature = "NSRange")]
408        #[unsafe(method(initWithOrderedSet:range:copyItems:))]
409        #[unsafe(method_family = init)]
410        pub unsafe fn initWithOrderedSet_range_copyItems(
411            this: Allocated<Self>,
412            set: &NSOrderedSet<ObjectType>,
413            range: NSRange,
414            flag: bool,
415        ) -> Retained<Self>;
416
417        #[cfg(feature = "NSArray")]
418        #[unsafe(method(initWithArray:))]
419        #[unsafe(method_family = init)]
420        pub unsafe fn initWithArray(
421            this: Allocated<Self>,
422            array: &NSArray<ObjectType>,
423        ) -> Retained<Self>;
424
425        #[cfg(feature = "NSArray")]
426        #[unsafe(method(initWithArray:copyItems:))]
427        #[unsafe(method_family = init)]
428        pub unsafe fn initWithArray_copyItems(
429            this: Allocated<Self>,
430            set: &NSArray<ObjectType>,
431            flag: bool,
432        ) -> Retained<Self>;
433
434        #[cfg(all(feature = "NSArray", feature = "NSRange"))]
435        #[unsafe(method(initWithArray:range:copyItems:))]
436        #[unsafe(method_family = init)]
437        pub unsafe fn initWithArray_range_copyItems(
438            this: Allocated<Self>,
439            set: &NSArray<ObjectType>,
440            range: NSRange,
441            flag: bool,
442        ) -> Retained<Self>;
443
444        #[cfg(feature = "NSSet")]
445        #[unsafe(method(initWithSet:))]
446        #[unsafe(method_family = init)]
447        pub unsafe fn initWithSet(this: Allocated<Self>, set: &NSSet<ObjectType>)
448            -> Retained<Self>;
449
450        #[cfg(feature = "NSSet")]
451        #[unsafe(method(initWithSet:copyItems:))]
452        #[unsafe(method_family = init)]
453        pub unsafe fn initWithSet_copyItems(
454            this: Allocated<Self>,
455            set: &NSSet<ObjectType>,
456            flag: bool,
457        ) -> Retained<Self>;
458    );
459}
460
461/// Methods declared on superclass `NSOrderedSet`.
462///
463/// NSOrderedSetCreation.
464impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
465    extern_methods!(
466        #[unsafe(method(orderedSet))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn orderedSet() -> Retained<Self>;
469
470        #[unsafe(method(orderedSetWithObject:))]
471        #[unsafe(method_family = none)]
472        pub unsafe fn orderedSetWithObject(object: &ObjectType) -> Retained<Self>;
473
474        #[unsafe(method(orderedSetWithObjects:count:))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn orderedSetWithObjects_count(
477            objects: NonNull<NonNull<ObjectType>>,
478            cnt: NSUInteger,
479        ) -> Retained<Self>;
480
481        #[unsafe(method(orderedSetWithOrderedSet:))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn orderedSetWithOrderedSet(set: &NSOrderedSet<ObjectType>) -> Retained<Self>;
484
485        #[cfg(feature = "NSRange")]
486        #[unsafe(method(orderedSetWithOrderedSet:range:copyItems:))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn orderedSetWithOrderedSet_range_copyItems(
489            set: &NSOrderedSet<ObjectType>,
490            range: NSRange,
491            flag: bool,
492        ) -> Retained<Self>;
493
494        #[cfg(feature = "NSArray")]
495        #[unsafe(method(orderedSetWithArray:))]
496        #[unsafe(method_family = none)]
497        pub unsafe fn orderedSetWithArray(array: &NSArray<ObjectType>) -> Retained<Self>;
498
499        #[cfg(all(feature = "NSArray", feature = "NSRange"))]
500        #[unsafe(method(orderedSetWithArray:range:copyItems:))]
501        #[unsafe(method_family = none)]
502        pub unsafe fn orderedSetWithArray_range_copyItems(
503            array: &NSArray<ObjectType>,
504            range: NSRange,
505            flag: bool,
506        ) -> Retained<Self>;
507
508        #[cfg(feature = "NSSet")]
509        #[unsafe(method(orderedSetWithSet:))]
510        #[unsafe(method_family = none)]
511        pub unsafe fn orderedSetWithSet(set: &NSSet<ObjectType>) -> Retained<Self>;
512
513        #[cfg(feature = "NSSet")]
514        #[unsafe(method(orderedSetWithSet:copyItems:))]
515        #[unsafe(method_family = none)]
516        pub unsafe fn orderedSetWithSet_copyItems(
517            set: &NSSet<ObjectType>,
518            flag: bool,
519        ) -> Retained<Self>;
520
521        #[unsafe(method(initWithObject:))]
522        #[unsafe(method_family = init)]
523        pub unsafe fn initWithObject(this: Allocated<Self>, object: &ObjectType) -> Retained<Self>;
524
525        #[unsafe(method(initWithOrderedSet:))]
526        #[unsafe(method_family = init)]
527        pub unsafe fn initWithOrderedSet(
528            this: Allocated<Self>,
529            set: &NSOrderedSet<ObjectType>,
530        ) -> Retained<Self>;
531
532        #[unsafe(method(initWithOrderedSet:copyItems:))]
533        #[unsafe(method_family = init)]
534        pub unsafe fn initWithOrderedSet_copyItems(
535            this: Allocated<Self>,
536            set: &NSOrderedSet<ObjectType>,
537            flag: bool,
538        ) -> Retained<Self>;
539
540        #[cfg(feature = "NSRange")]
541        #[unsafe(method(initWithOrderedSet:range:copyItems:))]
542        #[unsafe(method_family = init)]
543        pub unsafe fn initWithOrderedSet_range_copyItems(
544            this: Allocated<Self>,
545            set: &NSOrderedSet<ObjectType>,
546            range: NSRange,
547            flag: bool,
548        ) -> Retained<Self>;
549
550        #[cfg(feature = "NSArray")]
551        #[unsafe(method(initWithArray:))]
552        #[unsafe(method_family = init)]
553        pub unsafe fn initWithArray(
554            this: Allocated<Self>,
555            array: &NSArray<ObjectType>,
556        ) -> Retained<Self>;
557
558        #[cfg(feature = "NSArray")]
559        #[unsafe(method(initWithArray:copyItems:))]
560        #[unsafe(method_family = init)]
561        pub unsafe fn initWithArray_copyItems(
562            this: Allocated<Self>,
563            set: &NSArray<ObjectType>,
564            flag: bool,
565        ) -> Retained<Self>;
566
567        #[cfg(all(feature = "NSArray", feature = "NSRange"))]
568        #[unsafe(method(initWithArray:range:copyItems:))]
569        #[unsafe(method_family = init)]
570        pub unsafe fn initWithArray_range_copyItems(
571            this: Allocated<Self>,
572            set: &NSArray<ObjectType>,
573            range: NSRange,
574            flag: bool,
575        ) -> Retained<Self>;
576
577        #[cfg(feature = "NSSet")]
578        #[unsafe(method(initWithSet:))]
579        #[unsafe(method_family = init)]
580        pub unsafe fn initWithSet(this: Allocated<Self>, set: &NSSet<ObjectType>)
581            -> Retained<Self>;
582
583        #[cfg(feature = "NSSet")]
584        #[unsafe(method(initWithSet:copyItems:))]
585        #[unsafe(method_family = init)]
586        pub unsafe fn initWithSet_copyItems(
587            this: Allocated<Self>,
588            set: &NSSet<ObjectType>,
589            flag: bool,
590        ) -> Retained<Self>;
591    );
592}
593
594/// NSOrderedSetDiffing.
595impl<ObjectType: Message> NSOrderedSet<ObjectType> {
596    extern_methods!(
597        #[cfg(all(feature = "NSOrderedCollectionDifference", feature = "block2"))]
598        #[unsafe(method(differenceFromOrderedSet:withOptions:usingEquivalenceTest:))]
599        #[unsafe(method_family = none)]
600        pub unsafe fn differenceFromOrderedSet_withOptions_usingEquivalenceTest(
601            &self,
602            other: &NSOrderedSet<ObjectType>,
603            options: NSOrderedCollectionDifferenceCalculationOptions,
604            block: &block2::DynBlock<dyn Fn(NonNull<ObjectType>, NonNull<ObjectType>) -> Bool + '_>,
605        ) -> Retained<NSOrderedCollectionDifference<ObjectType>>;
606
607        #[cfg(feature = "NSOrderedCollectionDifference")]
608        #[unsafe(method(differenceFromOrderedSet:withOptions:))]
609        #[unsafe(method_family = none)]
610        pub unsafe fn differenceFromOrderedSet_withOptions(
611            &self,
612            other: &NSOrderedSet<ObjectType>,
613            options: NSOrderedCollectionDifferenceCalculationOptions,
614        ) -> Retained<NSOrderedCollectionDifference<ObjectType>>;
615
616        #[cfg(feature = "NSOrderedCollectionDifference")]
617        #[unsafe(method(differenceFromOrderedSet:))]
618        #[unsafe(method_family = none)]
619        pub unsafe fn differenceFromOrderedSet(
620            &self,
621            other: &NSOrderedSet<ObjectType>,
622        ) -> Retained<NSOrderedCollectionDifference<ObjectType>>;
623
624        #[cfg(feature = "NSOrderedCollectionDifference")]
625        #[unsafe(method(orderedSetByApplyingDifference:))]
626        #[unsafe(method_family = none)]
627        pub unsafe fn orderedSetByApplyingDifference(
628            &self,
629            difference: &NSOrderedCollectionDifference<ObjectType>,
630        ) -> Option<Retained<NSOrderedSet<ObjectType>>>;
631    );
632}
633
634extern_class!(
635    /// **************       Mutable Ordered Set     ***************
636    ///
637    /// See also [Apple's documentation](https://developer.apple.com/documentation/foundation/nsmutableorderedset?language=objc)
638    #[unsafe(super(NSOrderedSet<ObjectType>, NSObject))]
639    #[derive(Debug, PartialEq, Eq, Hash)]
640    pub struct NSMutableOrderedSet<ObjectType: ?Sized = AnyObject>;
641);
642
643#[cfg(feature = "NSObject")]
644extern_conformance!(
645    unsafe impl<ObjectType: ?Sized + NSCoding> NSCoding for NSMutableOrderedSet<ObjectType> {}
646);
647
648#[cfg(feature = "NSObject")]
649extern_conformance!(
650    unsafe impl<ObjectType: ?Sized> NSCopying for NSMutableOrderedSet<ObjectType> {}
651);
652
653#[cfg(feature = "NSObject")]
654unsafe impl<ObjectType: ?Sized + Message> CopyingHelper for NSMutableOrderedSet<ObjectType> {
655    type Result = NSOrderedSet<ObjectType>;
656}
657
658#[cfg(feature = "NSEnumerator")]
659extern_conformance!(
660    unsafe impl<ObjectType: ?Sized> NSFastEnumeration for NSMutableOrderedSet<ObjectType> {}
661);
662
663#[cfg(feature = "NSObject")]
664extern_conformance!(
665    unsafe impl<ObjectType: ?Sized> NSMutableCopying for NSMutableOrderedSet<ObjectType> {}
666);
667
668#[cfg(feature = "NSObject")]
669unsafe impl<ObjectType: ?Sized + Message> MutableCopyingHelper for NSMutableOrderedSet<ObjectType> {
670    type Result = Self;
671}
672
673extern_conformance!(
674    unsafe impl<ObjectType: ?Sized> NSObjectProtocol for NSMutableOrderedSet<ObjectType> {}
675);
676
677#[cfg(feature = "NSObject")]
678extern_conformance!(
679    unsafe impl<ObjectType: ?Sized + NSSecureCoding> NSSecureCoding
680        for NSMutableOrderedSet<ObjectType>
681    {
682    }
683);
684
685impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
686    extern_methods!(
687        #[unsafe(method(insertObject:atIndex:))]
688        #[unsafe(method_family = none)]
689        pub unsafe fn insertObject_atIndex(&self, object: &ObjectType, idx: NSUInteger);
690
691        #[unsafe(method(removeObjectAtIndex:))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn removeObjectAtIndex(&self, idx: NSUInteger);
694
695        #[unsafe(method(replaceObjectAtIndex:withObject:))]
696        #[unsafe(method_family = none)]
697        pub unsafe fn replaceObjectAtIndex_withObject(&self, idx: NSUInteger, object: &ObjectType);
698
699        #[cfg(feature = "NSCoder")]
700        #[unsafe(method(initWithCoder:))]
701        #[unsafe(method_family = init)]
702        pub unsafe fn initWithCoder(
703            this: Allocated<Self>,
704            coder: &NSCoder,
705        ) -> Option<Retained<Self>>;
706
707        #[unsafe(method(init))]
708        #[unsafe(method_family = init)]
709        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
710
711        #[unsafe(method(initWithCapacity:))]
712        #[unsafe(method_family = init)]
713        pub unsafe fn initWithCapacity(
714            this: Allocated<Self>,
715            num_items: NSUInteger,
716        ) -> Retained<Self>;
717    );
718}
719
720/// Methods declared on superclass `NSOrderedSet`.
721impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
722    extern_methods!(
723        #[unsafe(method(initWithObjects:count:))]
724        #[unsafe(method_family = init)]
725        pub unsafe fn initWithObjects_count(
726            this: Allocated<Self>,
727            objects: *mut NonNull<ObjectType>,
728            cnt: NSUInteger,
729        ) -> Retained<Self>;
730    );
731}
732
733/// Methods declared on superclass `NSObject`.
734impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
735    extern_methods!(
736        #[unsafe(method(new))]
737        #[unsafe(method_family = new)]
738        pub unsafe fn new() -> Retained<Self>;
739    );
740}
741
742/// NSExtendedMutableOrderedSet.
743impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
744    extern_methods!(
745        #[unsafe(method(addObject:))]
746        #[unsafe(method_family = none)]
747        pub unsafe fn addObject(&self, object: &ObjectType);
748
749        #[unsafe(method(addObjects:count:))]
750        #[unsafe(method_family = none)]
751        pub unsafe fn addObjects_count(&self, objects: *mut NonNull<ObjectType>, count: NSUInteger);
752
753        #[cfg(feature = "NSArray")]
754        #[unsafe(method(addObjectsFromArray:))]
755        #[unsafe(method_family = none)]
756        pub unsafe fn addObjectsFromArray(&self, array: &NSArray<ObjectType>);
757
758        #[unsafe(method(exchangeObjectAtIndex:withObjectAtIndex:))]
759        #[unsafe(method_family = none)]
760        pub unsafe fn exchangeObjectAtIndex_withObjectAtIndex(
761            &self,
762            idx1: NSUInteger,
763            idx2: NSUInteger,
764        );
765
766        #[cfg(feature = "NSIndexSet")]
767        #[unsafe(method(moveObjectsAtIndexes:toIndex:))]
768        #[unsafe(method_family = none)]
769        pub unsafe fn moveObjectsAtIndexes_toIndex(&self, indexes: &NSIndexSet, idx: NSUInteger);
770
771        #[cfg(all(feature = "NSArray", feature = "NSIndexSet"))]
772        #[unsafe(method(insertObjects:atIndexes:))]
773        #[unsafe(method_family = none)]
774        pub unsafe fn insertObjects_atIndexes(
775            &self,
776            objects: &NSArray<ObjectType>,
777            indexes: &NSIndexSet,
778        );
779
780        #[unsafe(method(setObject:atIndex:))]
781        #[unsafe(method_family = none)]
782        pub unsafe fn setObject_atIndex(&self, obj: &ObjectType, idx: NSUInteger);
783
784        #[unsafe(method(setObject:atIndexedSubscript:))]
785        #[unsafe(method_family = none)]
786        pub unsafe fn setObject_atIndexedSubscript(&self, obj: &ObjectType, idx: NSUInteger);
787
788        #[cfg(feature = "NSRange")]
789        #[unsafe(method(replaceObjectsInRange:withObjects:count:))]
790        #[unsafe(method_family = none)]
791        pub unsafe fn replaceObjectsInRange_withObjects_count(
792            &self,
793            range: NSRange,
794            objects: *mut NonNull<ObjectType>,
795            count: NSUInteger,
796        );
797
798        #[cfg(all(feature = "NSArray", feature = "NSIndexSet"))]
799        #[unsafe(method(replaceObjectsAtIndexes:withObjects:))]
800        #[unsafe(method_family = none)]
801        pub unsafe fn replaceObjectsAtIndexes_withObjects(
802            &self,
803            indexes: &NSIndexSet,
804            objects: &NSArray<ObjectType>,
805        );
806
807        #[cfg(feature = "NSRange")]
808        #[unsafe(method(removeObjectsInRange:))]
809        #[unsafe(method_family = none)]
810        pub unsafe fn removeObjectsInRange(&self, range: NSRange);
811
812        #[cfg(feature = "NSIndexSet")]
813        #[unsafe(method(removeObjectsAtIndexes:))]
814        #[unsafe(method_family = none)]
815        pub unsafe fn removeObjectsAtIndexes(&self, indexes: &NSIndexSet);
816
817        #[unsafe(method(removeAllObjects))]
818        #[unsafe(method_family = none)]
819        pub unsafe fn removeAllObjects(&self);
820
821        #[unsafe(method(removeObject:))]
822        #[unsafe(method_family = none)]
823        pub unsafe fn removeObject(&self, object: &ObjectType);
824
825        #[cfg(feature = "NSArray")]
826        #[unsafe(method(removeObjectsInArray:))]
827        #[unsafe(method_family = none)]
828        pub unsafe fn removeObjectsInArray(&self, array: &NSArray<ObjectType>);
829
830        #[unsafe(method(intersectOrderedSet:))]
831        #[unsafe(method_family = none)]
832        pub unsafe fn intersectOrderedSet(&self, other: &NSOrderedSet<ObjectType>);
833
834        #[unsafe(method(minusOrderedSet:))]
835        #[unsafe(method_family = none)]
836        pub unsafe fn minusOrderedSet(&self, other: &NSOrderedSet<ObjectType>);
837
838        #[unsafe(method(unionOrderedSet:))]
839        #[unsafe(method_family = none)]
840        pub unsafe fn unionOrderedSet(&self, other: &NSOrderedSet<ObjectType>);
841
842        #[cfg(feature = "NSSet")]
843        #[unsafe(method(intersectSet:))]
844        #[unsafe(method_family = none)]
845        pub unsafe fn intersectSet(&self, other: &NSSet<ObjectType>);
846
847        #[cfg(feature = "NSSet")]
848        #[unsafe(method(minusSet:))]
849        #[unsafe(method_family = none)]
850        pub unsafe fn minusSet(&self, other: &NSSet<ObjectType>);
851
852        #[cfg(feature = "NSSet")]
853        #[unsafe(method(unionSet:))]
854        #[unsafe(method_family = none)]
855        pub unsafe fn unionSet(&self, other: &NSSet<ObjectType>);
856
857        #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))]
858        #[unsafe(method(sortUsingComparator:))]
859        #[unsafe(method_family = none)]
860        pub unsafe fn sortUsingComparator(&self, cmptr: NSComparator);
861
862        #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))]
863        #[unsafe(method(sortWithOptions:usingComparator:))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn sortWithOptions_usingComparator(
866            &self,
867            opts: NSSortOptions,
868            cmptr: NSComparator,
869        );
870
871        #[cfg(all(feature = "NSObjCRuntime", feature = "NSRange", feature = "block2"))]
872        #[unsafe(method(sortRange:options:usingComparator:))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn sortRange_options_usingComparator(
875            &self,
876            range: NSRange,
877            opts: NSSortOptions,
878            cmptr: NSComparator,
879        );
880    );
881}
882
883/// NSMutableOrderedSetCreation.
884impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
885    extern_methods!(
886        #[unsafe(method(orderedSetWithCapacity:))]
887        #[unsafe(method_family = none)]
888        pub unsafe fn orderedSetWithCapacity(num_items: NSUInteger) -> Retained<Self>;
889    );
890}
891
892/// NSMutableOrderedSetDiffing.
893impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
894    extern_methods!(
895        #[cfg(feature = "NSOrderedCollectionDifference")]
896        #[unsafe(method(applyDifference:))]
897        #[unsafe(method_family = none)]
898        pub unsafe fn applyDifference(
899            &self,
900            difference: &NSOrderedCollectionDifference<ObjectType>,
901        );
902    );
903}