objc2_foundation/generated/
NSSortDescriptor.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10 #[unsafe(super(NSObject))]
12 #[derive(Debug, PartialEq, Eq, Hash)]
13 pub struct NSSortDescriptor;
14);
15
16#[cfg(feature = "NSObject")]
17extern_conformance!(
18 unsafe impl NSCoding for NSSortDescriptor {}
19);
20
21#[cfg(feature = "NSObject")]
22extern_conformance!(
23 unsafe impl NSCopying for NSSortDescriptor {}
24);
25
26#[cfg(feature = "NSObject")]
27unsafe impl CopyingHelper for NSSortDescriptor {
28 type Result = Self;
29}
30
31extern_conformance!(
32 unsafe impl NSObjectProtocol for NSSortDescriptor {}
33);
34
35#[cfg(feature = "NSObject")]
36extern_conformance!(
37 unsafe impl NSSecureCoding for NSSortDescriptor {}
38);
39
40impl NSSortDescriptor {
41 extern_methods!(
42 #[cfg(feature = "NSString")]
43 #[unsafe(method(sortDescriptorWithKey:ascending:))]
44 #[unsafe(method_family = none)]
45 pub fn sortDescriptorWithKey_ascending(
46 key: Option<&NSString>,
47 ascending: bool,
48 ) -> Retained<Self>;
49
50 #[cfg(feature = "NSString")]
51 #[unsafe(method(sortDescriptorWithKey:ascending:selector:))]
55 #[unsafe(method_family = none)]
56 pub unsafe fn sortDescriptorWithKey_ascending_selector(
57 key: Option<&NSString>,
58 ascending: bool,
59 selector: Option<Sel>,
60 ) -> Retained<Self>;
61
62 #[cfg(feature = "NSString")]
63 #[unsafe(method(initWithKey:ascending:))]
64 #[unsafe(method_family = init)]
65 pub fn initWithKey_ascending(
66 this: Allocated<Self>,
67 key: Option<&NSString>,
68 ascending: bool,
69 ) -> Retained<Self>;
70
71 #[cfg(feature = "NSString")]
72 #[unsafe(method(initWithKey:ascending:selector:))]
76 #[unsafe(method_family = init)]
77 pub unsafe fn initWithKey_ascending_selector(
78 this: Allocated<Self>,
79 key: Option<&NSString>,
80 ascending: bool,
81 selector: Option<Sel>,
82 ) -> Retained<Self>;
83
84 #[cfg(feature = "NSCoder")]
85 #[unsafe(method(initWithCoder:))]
89 #[unsafe(method_family = init)]
90 pub unsafe fn initWithCoder(
91 this: Allocated<Self>,
92 coder: &NSCoder,
93 ) -> Option<Retained<Self>>;
94
95 #[cfg(feature = "NSString")]
96 #[unsafe(method(key))]
97 #[unsafe(method_family = none)]
98 pub fn key(&self) -> Option<Retained<NSString>>;
99
100 #[unsafe(method(ascending))]
101 #[unsafe(method_family = none)]
102 pub fn ascending(&self) -> bool;
103
104 #[unsafe(method(selector))]
105 #[unsafe(method_family = none)]
106 pub fn selector(&self) -> Option<Sel>;
107
108 #[unsafe(method(allowEvaluation))]
109 #[unsafe(method_family = none)]
110 pub fn allowEvaluation(&self);
111
112 #[cfg(all(feature = "NSObjCRuntime", feature = "NSString", feature = "block2"))]
113 #[unsafe(method(sortDescriptorWithKey:ascending:comparator:))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn sortDescriptorWithKey_ascending_comparator(
119 key: Option<&NSString>,
120 ascending: bool,
121 cmptr: NSComparator,
122 ) -> Retained<Self>;
123
124 #[cfg(all(feature = "NSObjCRuntime", feature = "NSString", feature = "block2"))]
125 #[unsafe(method(initWithKey:ascending:comparator:))]
129 #[unsafe(method_family = init)]
130 pub unsafe fn initWithKey_ascending_comparator(
131 this: Allocated<Self>,
132 key: Option<&NSString>,
133 ascending: bool,
134 cmptr: NSComparator,
135 ) -> Retained<Self>;
136
137 #[cfg(all(feature = "NSObjCRuntime", feature = "block2"))]
138 #[unsafe(method(comparator))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn comparator(&self) -> NSComparator;
145
146 #[cfg(feature = "NSObjCRuntime")]
147 #[unsafe(method(compareObject:toObject:))]
152 #[unsafe(method_family = none)]
153 pub unsafe fn compareObject_toObject(
154 &self,
155 object1: &AnyObject,
156 object2: &AnyObject,
157 ) -> NSComparisonResult;
158
159 #[unsafe(method(reversedSortDescriptor))]
160 #[unsafe(method_family = none)]
161 pub fn reversedSortDescriptor(&self) -> Retained<AnyObject>;
162 );
163}
164
165impl NSSortDescriptor {
167 extern_methods!(
168 #[unsafe(method(init))]
169 #[unsafe(method_family = init)]
170 pub fn init(this: Allocated<Self>) -> Retained<Self>;
171
172 #[unsafe(method(new))]
173 #[unsafe(method_family = new)]
174 pub fn new() -> Retained<Self>;
175 );
176}
177
178impl DefaultRetained for NSSortDescriptor {
179 #[inline]
180 fn default_retained() -> Retained<Self> {
181 Self::new()
182 }
183}
184
185#[cfg(feature = "NSSet")]
187impl<ObjectType: Message> NSSet<ObjectType> {
188 extern_methods!(
189 #[cfg(feature = "NSArray")]
190 #[unsafe(method(sortedArrayUsingDescriptors:))]
191 #[unsafe(method_family = none)]
192 pub fn sortedArrayUsingDescriptors(
193 &self,
194 sort_descriptors: &NSArray<NSSortDescriptor>,
195 ) -> Retained<NSArray<ObjectType>>;
196 );
197}
198
199#[cfg(feature = "NSArray")]
201impl<ObjectType: Message> NSArray<ObjectType> {
202 extern_methods!(
203 #[unsafe(method(sortedArrayUsingDescriptors:))]
204 #[unsafe(method_family = none)]
205 pub fn sortedArrayUsingDescriptors(
206 &self,
207 sort_descriptors: &NSArray<NSSortDescriptor>,
208 ) -> Retained<NSArray<ObjectType>>;
209 );
210}
211
212#[cfg(feature = "NSArray")]
214impl<ObjectType: Message> NSMutableArray<ObjectType> {
215 extern_methods!(
216 #[unsafe(method(sortUsingDescriptors:))]
217 #[unsafe(method_family = none)]
218 pub fn sortUsingDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
219 );
220}
221
222#[cfg(feature = "NSOrderedSet")]
224impl<ObjectType: Message> NSOrderedSet<ObjectType> {
225 extern_methods!(
226 #[cfg(feature = "NSArray")]
227 #[unsafe(method(sortedArrayUsingDescriptors:))]
228 #[unsafe(method_family = none)]
229 pub fn sortedArrayUsingDescriptors(
230 &self,
231 sort_descriptors: &NSArray<NSSortDescriptor>,
232 ) -> Retained<NSArray<ObjectType>>;
233 );
234}
235
236#[cfg(feature = "NSOrderedSet")]
238impl<ObjectType: Message> NSMutableOrderedSet<ObjectType> {
239 extern_methods!(
240 #[cfg(feature = "NSArray")]
241 #[unsafe(method(sortUsingDescriptors:))]
242 #[unsafe(method_family = none)]
243 pub fn sortUsingDescriptors(&self, sort_descriptors: &NSArray<NSSortDescriptor>);
244 );
245}