objc2_foundation/generated/
NSScriptWhoseTests.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5
6use crate::*;
7
8#[repr(transparent)]
11#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
12pub struct NSTestComparisonOperation(pub NSUInteger);
13impl NSTestComparisonOperation {
14 #[doc(alias = "NSEqualToComparison")]
15 pub const EqualToComparison: Self = Self(0);
16 #[doc(alias = "NSLessThanOrEqualToComparison")]
17 pub const LessThanOrEqualToComparison: Self = Self(1);
18 #[doc(alias = "NSLessThanComparison")]
19 pub const LessThanComparison: Self = Self(2);
20 #[doc(alias = "NSGreaterThanOrEqualToComparison")]
21 pub const GreaterThanOrEqualToComparison: Self = Self(3);
22 #[doc(alias = "NSGreaterThanComparison")]
23 pub const GreaterThanComparison: Self = Self(4);
24 #[doc(alias = "NSBeginsWithComparison")]
25 pub const BeginsWithComparison: Self = Self(5);
26 #[doc(alias = "NSEndsWithComparison")]
27 pub const EndsWithComparison: Self = Self(6);
28 #[doc(alias = "NSContainsComparison")]
29 pub const ContainsComparison: Self = Self(7);
30}
31
32unsafe impl Encode for NSTestComparisonOperation {
33 const ENCODING: Encoding = NSUInteger::ENCODING;
34}
35
36unsafe impl RefEncode for NSTestComparisonOperation {
37 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
38}
39
40extern_class!(
41 #[unsafe(super(NSObject))]
43 #[derive(Debug, PartialEq, Eq, Hash)]
44 pub struct NSScriptWhoseTest;
45);
46
47#[cfg(feature = "NSObject")]
48extern_conformance!(
49 unsafe impl NSCoding for NSScriptWhoseTest {}
50);
51
52extern_conformance!(
53 unsafe impl NSObjectProtocol for NSScriptWhoseTest {}
54);
55
56impl NSScriptWhoseTest {
57 extern_methods!(
58 #[unsafe(method(isTrue))]
59 #[unsafe(method_family = none)]
60 pub fn isTrue(&self) -> bool;
61
62 #[unsafe(method(init))]
63 #[unsafe(method_family = init)]
64 pub fn init(this: Allocated<Self>) -> Retained<Self>;
65
66 #[cfg(feature = "NSCoder")]
67 #[unsafe(method(initWithCoder:))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn initWithCoder(
73 this: Allocated<Self>,
74 in_coder: &NSCoder,
75 ) -> Option<Retained<Self>>;
76 );
77}
78
79impl NSScriptWhoseTest {
81 extern_methods!(
82 #[unsafe(method(new))]
83 #[unsafe(method_family = new)]
84 pub fn new() -> Retained<Self>;
85 );
86}
87
88impl DefaultRetained for NSScriptWhoseTest {
89 #[inline]
90 fn default_retained() -> Retained<Self> {
91 Self::new()
92 }
93}
94
95extern_class!(
96 #[unsafe(super(NSScriptWhoseTest, NSObject))]
98 #[derive(Debug, PartialEq, Eq, Hash)]
99 pub struct NSLogicalTest;
100);
101
102#[cfg(feature = "NSObject")]
103extern_conformance!(
104 unsafe impl NSCoding for NSLogicalTest {}
105);
106
107extern_conformance!(
108 unsafe impl NSObjectProtocol for NSLogicalTest {}
109);
110
111impl NSLogicalTest {
112 extern_methods!(
113 #[cfg(feature = "NSArray")]
114 #[unsafe(method(initAndTestWithTests:))]
115 #[unsafe(method_family = init)]
116 pub fn initAndTestWithTests(
117 this: Allocated<Self>,
118 sub_tests: &NSArray<NSSpecifierTest>,
119 ) -> Retained<Self>;
120
121 #[cfg(feature = "NSArray")]
122 #[unsafe(method(initOrTestWithTests:))]
123 #[unsafe(method_family = init)]
124 pub fn initOrTestWithTests(
125 this: Allocated<Self>,
126 sub_tests: &NSArray<NSSpecifierTest>,
127 ) -> Retained<Self>;
128
129 #[unsafe(method(initNotTestWithTest:))]
130 #[unsafe(method_family = init)]
131 pub fn initNotTestWithTest(
132 this: Allocated<Self>,
133 sub_test: &NSScriptWhoseTest,
134 ) -> Retained<Self>;
135 );
136}
137
138impl NSLogicalTest {
140 extern_methods!(
141 #[unsafe(method(init))]
142 #[unsafe(method_family = init)]
143 pub fn init(this: Allocated<Self>) -> Retained<Self>;
144
145 #[cfg(feature = "NSCoder")]
146 #[unsafe(method(initWithCoder:))]
150 #[unsafe(method_family = init)]
151 pub unsafe fn initWithCoder(
152 this: Allocated<Self>,
153 in_coder: &NSCoder,
154 ) -> Option<Retained<Self>>;
155 );
156}
157
158impl NSLogicalTest {
160 extern_methods!(
161 #[unsafe(method(new))]
162 #[unsafe(method_family = new)]
163 pub fn new() -> Retained<Self>;
164 );
165}
166
167impl DefaultRetained for NSLogicalTest {
168 #[inline]
169 fn default_retained() -> Retained<Self> {
170 Self::new()
171 }
172}
173
174extern_class!(
175 #[unsafe(super(NSScriptWhoseTest, NSObject))]
177 #[derive(Debug, PartialEq, Eq, Hash)]
178 pub struct NSSpecifierTest;
179);
180
181#[cfg(feature = "NSObject")]
182extern_conformance!(
183 unsafe impl NSCoding for NSSpecifierTest {}
184);
185
186extern_conformance!(
187 unsafe impl NSObjectProtocol for NSSpecifierTest {}
188);
189
190impl NSSpecifierTest {
191 extern_methods!(
192 #[unsafe(method(init))]
193 #[unsafe(method_family = init)]
194 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
195
196 #[cfg(feature = "NSCoder")]
197 #[unsafe(method(initWithCoder:))]
201 #[unsafe(method_family = init)]
202 pub unsafe fn initWithCoder(
203 this: Allocated<Self>,
204 in_coder: &NSCoder,
205 ) -> Option<Retained<Self>>;
206
207 #[cfg(feature = "NSScriptObjectSpecifiers")]
208 #[unsafe(method(initWithObjectSpecifier:comparisonOperator:testObject:))]
212 #[unsafe(method_family = init)]
213 pub unsafe fn initWithObjectSpecifier_comparisonOperator_testObject(
214 this: Allocated<Self>,
215 obj1: Option<&NSScriptObjectSpecifier>,
216 comp_op: NSTestComparisonOperation,
217 obj2: Option<&AnyObject>,
218 ) -> Retained<Self>;
219 );
220}
221
222impl NSSpecifierTest {
224 extern_methods!(
225 #[unsafe(method(new))]
226 #[unsafe(method_family = new)]
227 pub unsafe fn new() -> Retained<Self>;
228 );
229}
230
231mod private_NSObjectNSComparisonMethods {
232 pub trait Sealed {}
233}
234
235#[doc(alias = "NSComparisonMethods")]
237pub unsafe trait NSObjectNSComparisonMethods:
238 ClassType + Sized + private_NSObjectNSComparisonMethods::Sealed
239{
240 extern_methods!(
241 #[unsafe(method(isEqualTo:))]
245 #[unsafe(method_family = none)]
246 unsafe fn isEqualTo(&self, object: Option<&AnyObject>) -> bool;
247
248 #[unsafe(method(isLessThanOrEqualTo:))]
252 #[unsafe(method_family = none)]
253 unsafe fn isLessThanOrEqualTo(&self, object: Option<&AnyObject>) -> bool;
254
255 #[unsafe(method(isLessThan:))]
259 #[unsafe(method_family = none)]
260 unsafe fn isLessThan(&self, object: Option<&AnyObject>) -> bool;
261
262 #[unsafe(method(isGreaterThanOrEqualTo:))]
266 #[unsafe(method_family = none)]
267 unsafe fn isGreaterThanOrEqualTo(&self, object: Option<&AnyObject>) -> bool;
268
269 #[unsafe(method(isGreaterThan:))]
273 #[unsafe(method_family = none)]
274 unsafe fn isGreaterThan(&self, object: Option<&AnyObject>) -> bool;
275
276 #[unsafe(method(isNotEqualTo:))]
280 #[unsafe(method_family = none)]
281 unsafe fn isNotEqualTo(&self, object: Option<&AnyObject>) -> bool;
282
283 #[unsafe(method(doesContain:))]
287 #[unsafe(method_family = none)]
288 unsafe fn doesContain(&self, object: &AnyObject) -> bool;
289
290 #[cfg(feature = "NSString")]
291 #[unsafe(method(isLike:))]
292 #[unsafe(method_family = none)]
293 fn isLike(&self, object: &NSString) -> bool;
294
295 #[cfg(feature = "NSString")]
296 #[unsafe(method(isCaseInsensitiveLike:))]
297 #[unsafe(method_family = none)]
298 fn isCaseInsensitiveLike(&self, object: &NSString) -> bool;
299 );
300}
301
302impl private_NSObjectNSComparisonMethods::Sealed for NSObject {}
303unsafe impl NSObjectNSComparisonMethods for NSObject {}
304
305mod private_NSObjectNSScriptingComparisonMethods {
306 pub trait Sealed {}
307}
308
309#[doc(alias = "NSScriptingComparisonMethods")]
311pub unsafe trait NSObjectNSScriptingComparisonMethods:
312 ClassType + Sized + private_NSObjectNSScriptingComparisonMethods::Sealed
313{
314 extern_methods!(
315 #[unsafe(method(scriptingIsEqualTo:))]
319 #[unsafe(method_family = none)]
320 unsafe fn scriptingIsEqualTo(&self, object: &AnyObject) -> bool;
321
322 #[unsafe(method(scriptingIsLessThanOrEqualTo:))]
326 #[unsafe(method_family = none)]
327 unsafe fn scriptingIsLessThanOrEqualTo(&self, object: &AnyObject) -> bool;
328
329 #[unsafe(method(scriptingIsLessThan:))]
333 #[unsafe(method_family = none)]
334 unsafe fn scriptingIsLessThan(&self, object: &AnyObject) -> bool;
335
336 #[unsafe(method(scriptingIsGreaterThanOrEqualTo:))]
340 #[unsafe(method_family = none)]
341 unsafe fn scriptingIsGreaterThanOrEqualTo(&self, object: &AnyObject) -> bool;
342
343 #[unsafe(method(scriptingIsGreaterThan:))]
347 #[unsafe(method_family = none)]
348 unsafe fn scriptingIsGreaterThan(&self, object: &AnyObject) -> bool;
349
350 #[unsafe(method(scriptingBeginsWith:))]
354 #[unsafe(method_family = none)]
355 unsafe fn scriptingBeginsWith(&self, object: &AnyObject) -> bool;
356
357 #[unsafe(method(scriptingEndsWith:))]
361 #[unsafe(method_family = none)]
362 unsafe fn scriptingEndsWith(&self, object: &AnyObject) -> bool;
363
364 #[unsafe(method(scriptingContains:))]
368 #[unsafe(method_family = none)]
369 unsafe fn scriptingContains(&self, object: &AnyObject) -> bool;
370 );
371}
372
373impl private_NSObjectNSScriptingComparisonMethods::Sealed for NSObject {}
374unsafe impl NSObjectNSScriptingComparisonMethods for NSObject {}