icrate/generated/Foundation/
NSTextCheckingResult.rs1use crate::common::*;
4use crate::Foundation::*;
5
6ns_options!(
7 #[underlying(u64)]
8 pub enum NSTextCheckingType {
9 NSTextCheckingTypeOrthography = 1 << 0,
10 NSTextCheckingTypeSpelling = 1 << 1,
11 NSTextCheckingTypeGrammar = 1 << 2,
12 NSTextCheckingTypeDate = 1 << 3,
13 NSTextCheckingTypeAddress = 1 << 4,
14 NSTextCheckingTypeLink = 1 << 5,
15 NSTextCheckingTypeQuote = 1 << 6,
16 NSTextCheckingTypeDash = 1 << 7,
17 NSTextCheckingTypeReplacement = 1 << 8,
18 NSTextCheckingTypeCorrection = 1 << 9,
19 NSTextCheckingTypeRegularExpression = 1 << 10,
20 NSTextCheckingTypePhoneNumber = 1 << 11,
21 NSTextCheckingTypeTransitInformation = 1 << 12,
22 }
23);
24
25ns_enum!(
26 #[underlying(u64)]
27 pub enum NSTextCheckingTypes {
28 NSTextCheckingAllSystemTypes = 0xffffffff,
29 NSTextCheckingAllCustomTypes = 0xffffffff << 32,
30 NSTextCheckingAllTypes = NSTextCheckingAllSystemTypes | NSTextCheckingAllCustomTypes,
31 }
32);
33
34typed_extensible_enum!(
35 pub type NSTextCheckingKey = NSString;
36);
37
38extern_class!(
39 #[derive(Debug, PartialEq, Eq, Hash)]
40 #[cfg(feature = "Foundation_NSTextCheckingResult")]
41 pub struct NSTextCheckingResult;
42
43 #[cfg(feature = "Foundation_NSTextCheckingResult")]
44 unsafe impl ClassType for NSTextCheckingResult {
45 type Super = NSObject;
46 type Mutability = InteriorMutable;
47 }
48);
49
50#[cfg(feature = "Foundation_NSTextCheckingResult")]
51unsafe impl NSCoding for NSTextCheckingResult {}
52
53#[cfg(feature = "Foundation_NSTextCheckingResult")]
54unsafe impl NSCopying for NSTextCheckingResult {}
55
56#[cfg(feature = "Foundation_NSTextCheckingResult")]
57unsafe impl NSObjectProtocol for NSTextCheckingResult {}
58
59#[cfg(feature = "Foundation_NSTextCheckingResult")]
60unsafe impl NSSecureCoding for NSTextCheckingResult {}
61
62extern_methods!(
63 #[cfg(feature = "Foundation_NSTextCheckingResult")]
64 unsafe impl NSTextCheckingResult {
65 #[method(resultType)]
66 pub unsafe fn resultType(&self) -> NSTextCheckingType;
67
68 #[method(range)]
69 pub unsafe fn range(&self) -> NSRange;
70 }
71);
72
73extern_methods!(
74 #[cfg(feature = "Foundation_NSTextCheckingResult")]
76 unsafe impl NSTextCheckingResult {
77 #[method_id(@__retain_semantics Init init)]
78 pub unsafe fn init(this: Allocated<Self>) -> Id<Self>;
79
80 #[method_id(@__retain_semantics New new)]
81 pub unsafe fn new() -> Id<Self>;
82 }
83);
84
85extern_methods!(
86 #[cfg(feature = "Foundation_NSTextCheckingResult")]
88 unsafe impl NSTextCheckingResult {
89 #[cfg(feature = "Foundation_NSOrthography")]
90 #[method_id(@__retain_semantics Other orthography)]
91 pub unsafe fn orthography(&self) -> Option<Id<NSOrthography>>;
92
93 #[cfg(all(
94 feature = "Foundation_NSArray",
95 feature = "Foundation_NSDictionary",
96 feature = "Foundation_NSString"
97 ))]
98 #[method_id(@__retain_semantics Other grammarDetails)]
99 pub unsafe fn grammarDetails(
100 &self,
101 ) -> Option<Id<NSArray<NSDictionary<NSString, AnyObject>>>>;
102
103 #[cfg(feature = "Foundation_NSDate")]
104 #[method_id(@__retain_semantics Other date)]
105 pub unsafe fn date(&self) -> Option<Id<NSDate>>;
106
107 #[cfg(feature = "Foundation_NSTimeZone")]
108 #[method_id(@__retain_semantics Other timeZone)]
109 pub unsafe fn timeZone(&self) -> Option<Id<NSTimeZone>>;
110
111 #[method(duration)]
112 pub unsafe fn duration(&self) -> NSTimeInterval;
113
114 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
115 #[method_id(@__retain_semantics Other components)]
116 pub unsafe fn components(&self) -> Option<Id<NSDictionary<NSTextCheckingKey, NSString>>>;
117
118 #[cfg(feature = "Foundation_NSURL")]
119 #[method_id(@__retain_semantics Other URL)]
120 pub unsafe fn URL(&self) -> Option<Id<NSURL>>;
121
122 #[cfg(feature = "Foundation_NSString")]
123 #[method_id(@__retain_semantics Other replacementString)]
124 pub unsafe fn replacementString(&self) -> Option<Id<NSString>>;
125
126 #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
127 #[method_id(@__retain_semantics Other alternativeStrings)]
128 pub unsafe fn alternativeStrings(&self) -> Option<Id<NSArray<NSString>>>;
129
130 #[cfg(feature = "Foundation_NSRegularExpression")]
131 #[method_id(@__retain_semantics Other regularExpression)]
132 pub unsafe fn regularExpression(&self) -> Option<Id<NSRegularExpression>>;
133
134 #[cfg(feature = "Foundation_NSString")]
135 #[method_id(@__retain_semantics Other phoneNumber)]
136 pub unsafe fn phoneNumber(&self) -> Option<Id<NSString>>;
137
138 #[method(numberOfRanges)]
139 pub unsafe fn numberOfRanges(&self) -> NSUInteger;
140
141 #[method(rangeAtIndex:)]
142 pub unsafe fn rangeAtIndex(&self, idx: NSUInteger) -> NSRange;
143
144 #[cfg(feature = "Foundation_NSString")]
145 #[method(rangeWithName:)]
146 pub unsafe fn rangeWithName(&self, name: &NSString) -> NSRange;
147
148 #[method_id(@__retain_semantics Other resultByAdjustingRangesWithOffset:)]
149 pub unsafe fn resultByAdjustingRangesWithOffset(
150 &self,
151 offset: NSInteger,
152 ) -> Id<NSTextCheckingResult>;
153
154 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
155 #[method_id(@__retain_semantics Other addressComponents)]
156 pub unsafe fn addressComponents(
157 &self,
158 ) -> Option<Id<NSDictionary<NSTextCheckingKey, NSString>>>;
159 }
160);
161
162extern_static!(NSTextCheckingNameKey: &'static NSTextCheckingKey);
163
164extern_static!(NSTextCheckingJobTitleKey: &'static NSTextCheckingKey);
165
166extern_static!(NSTextCheckingOrganizationKey: &'static NSTextCheckingKey);
167
168extern_static!(NSTextCheckingStreetKey: &'static NSTextCheckingKey);
169
170extern_static!(NSTextCheckingCityKey: &'static NSTextCheckingKey);
171
172extern_static!(NSTextCheckingStateKey: &'static NSTextCheckingKey);
173
174extern_static!(NSTextCheckingZIPKey: &'static NSTextCheckingKey);
175
176extern_static!(NSTextCheckingCountryKey: &'static NSTextCheckingKey);
177
178extern_static!(NSTextCheckingPhoneKey: &'static NSTextCheckingKey);
179
180extern_static!(NSTextCheckingAirlineKey: &'static NSTextCheckingKey);
181
182extern_static!(NSTextCheckingFlightKey: &'static NSTextCheckingKey);
183
184extern_methods!(
185 #[cfg(feature = "Foundation_NSTextCheckingResult")]
187 unsafe impl NSTextCheckingResult {
188 #[cfg(feature = "Foundation_NSOrthography")]
189 #[method_id(@__retain_semantics Other orthographyCheckingResultWithRange:orthography:)]
190 pub unsafe fn orthographyCheckingResultWithRange_orthography(
191 range: NSRange,
192 orthography: &NSOrthography,
193 ) -> Id<NSTextCheckingResult>;
194
195 #[method_id(@__retain_semantics Other spellCheckingResultWithRange:)]
196 pub unsafe fn spellCheckingResultWithRange(range: NSRange) -> Id<NSTextCheckingResult>;
197
198 #[cfg(all(
199 feature = "Foundation_NSArray",
200 feature = "Foundation_NSDictionary",
201 feature = "Foundation_NSString"
202 ))]
203 #[method_id(@__retain_semantics Other grammarCheckingResultWithRange:details:)]
204 pub unsafe fn grammarCheckingResultWithRange_details(
205 range: NSRange,
206 details: &NSArray<NSDictionary<NSString, AnyObject>>,
207 ) -> Id<NSTextCheckingResult>;
208
209 #[cfg(feature = "Foundation_NSDate")]
210 #[method_id(@__retain_semantics Other dateCheckingResultWithRange:date:)]
211 pub unsafe fn dateCheckingResultWithRange_date(
212 range: NSRange,
213 date: &NSDate,
214 ) -> Id<NSTextCheckingResult>;
215
216 #[cfg(all(feature = "Foundation_NSDate", feature = "Foundation_NSTimeZone"))]
217 #[method_id(@__retain_semantics Other dateCheckingResultWithRange:date:timeZone:duration:)]
218 pub unsafe fn dateCheckingResultWithRange_date_timeZone_duration(
219 range: NSRange,
220 date: &NSDate,
221 time_zone: &NSTimeZone,
222 duration: NSTimeInterval,
223 ) -> Id<NSTextCheckingResult>;
224
225 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
226 #[method_id(@__retain_semantics Other addressCheckingResultWithRange:components:)]
227 pub unsafe fn addressCheckingResultWithRange_components(
228 range: NSRange,
229 components: &NSDictionary<NSTextCheckingKey, NSString>,
230 ) -> Id<NSTextCheckingResult>;
231
232 #[cfg(feature = "Foundation_NSURL")]
233 #[method_id(@__retain_semantics Other linkCheckingResultWithRange:URL:)]
234 pub unsafe fn linkCheckingResultWithRange_URL(
235 range: NSRange,
236 url: &NSURL,
237 ) -> Id<NSTextCheckingResult>;
238
239 #[cfg(feature = "Foundation_NSString")]
240 #[method_id(@__retain_semantics Other quoteCheckingResultWithRange:replacementString:)]
241 pub unsafe fn quoteCheckingResultWithRange_replacementString(
242 range: NSRange,
243 replacement_string: &NSString,
244 ) -> Id<NSTextCheckingResult>;
245
246 #[cfg(feature = "Foundation_NSString")]
247 #[method_id(@__retain_semantics Other dashCheckingResultWithRange:replacementString:)]
248 pub unsafe fn dashCheckingResultWithRange_replacementString(
249 range: NSRange,
250 replacement_string: &NSString,
251 ) -> Id<NSTextCheckingResult>;
252
253 #[cfg(feature = "Foundation_NSString")]
254 #[method_id(@__retain_semantics Other replacementCheckingResultWithRange:replacementString:)]
255 pub unsafe fn replacementCheckingResultWithRange_replacementString(
256 range: NSRange,
257 replacement_string: &NSString,
258 ) -> Id<NSTextCheckingResult>;
259
260 #[cfg(feature = "Foundation_NSString")]
261 #[method_id(@__retain_semantics Other correctionCheckingResultWithRange:replacementString:)]
262 pub unsafe fn correctionCheckingResultWithRange_replacementString(
263 range: NSRange,
264 replacement_string: &NSString,
265 ) -> Id<NSTextCheckingResult>;
266
267 #[cfg(all(feature = "Foundation_NSArray", feature = "Foundation_NSString"))]
268 #[method_id(@__retain_semantics Other correctionCheckingResultWithRange:replacementString:alternativeStrings:)]
269 pub unsafe fn correctionCheckingResultWithRange_replacementString_alternativeStrings(
270 range: NSRange,
271 replacement_string: &NSString,
272 alternative_strings: &NSArray<NSString>,
273 ) -> Id<NSTextCheckingResult>;
274
275 #[cfg(feature = "Foundation_NSRegularExpression")]
276 #[method_id(@__retain_semantics Other regularExpressionCheckingResultWithRanges:count:regularExpression:)]
277 pub unsafe fn regularExpressionCheckingResultWithRanges_count_regularExpression(
278 ranges: NSRangePointer,
279 count: NSUInteger,
280 regular_expression: &NSRegularExpression,
281 ) -> Id<NSTextCheckingResult>;
282
283 #[cfg(feature = "Foundation_NSString")]
284 #[method_id(@__retain_semantics Other phoneNumberCheckingResultWithRange:phoneNumber:)]
285 pub unsafe fn phoneNumberCheckingResultWithRange_phoneNumber(
286 range: NSRange,
287 phone_number: &NSString,
288 ) -> Id<NSTextCheckingResult>;
289
290 #[cfg(all(feature = "Foundation_NSDictionary", feature = "Foundation_NSString"))]
291 #[method_id(@__retain_semantics Other transitInformationCheckingResultWithRange:components:)]
292 pub unsafe fn transitInformationCheckingResultWithRange_components(
293 range: NSRange,
294 components: &NSDictionary<NSTextCheckingKey, NSString>,
295 ) -> Id<NSTextCheckingResult>;
296 }
297);