objc2_data_detection/generated/
DDMatch.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    /// A base class for common types of data that the data detection system
12    /// matches.
13    ///
14    /// The DataDetection framework returns results in objects that are subclasses
15    /// of `DDMatch`, which are specific to the type of matching data. Each object
16    /// contains the matched string.
17    ///
18    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatch?language=objc)
19    #[unsafe(super(NSObject))]
20    #[derive(Debug, PartialEq, Eq, Hash)]
21    pub struct DDMatch;
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for DDMatch {}
26);
27
28impl DDMatch {
29    extern_methods!(
30        /// A substring that the data detection system identifies from an original
31        /// string as a common type of data.
32        ///
33        /// Use `DDMatch` subclasses that the data detection system provides for a
34        /// semantic interpretation of this string.
35        #[unsafe(method(matchedString))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn matchedString(&self) -> Retained<NSString>;
38
39        #[unsafe(method(init))]
40        #[unsafe(method_family = init)]
41        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42    );
43}
44
45/// Methods declared on superclass `NSObject`.
46impl DDMatch {
47    extern_methods!(
48        #[unsafe(method(new))]
49        #[unsafe(method_family = new)]
50        pub unsafe fn new() -> Retained<Self>;
51    );
52}
53
54extern_class!(
55    /// An object that contains a web link that the data detection system matches.
56    ///
57    /// The DataDetection framework returns a link match in a `DDMatchLink` object, which contains a
58    /// <doc
59    /// ://com.apple.documentation/documentation/foundation/url> (Swift) or
60    /// <doc
61    /// ://com.apple.documentation/documentation/foundation/nsurl> (Objective-C).
62    ///
63    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchlink?language=objc)
64    #[unsafe(super(DDMatch, NSObject))]
65    #[derive(Debug, PartialEq, Eq, Hash)]
66    pub struct DDMatchLink;
67);
68
69extern_conformance!(
70    unsafe impl NSObjectProtocol for DDMatchLink {}
71);
72
73impl DDMatchLink {
74    extern_methods!(
75        /// An address for a web resource, such as a webpage or image.
76        #[unsafe(method(URL))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn URL(&self) -> Retained<NSURL>;
79    );
80}
81
82/// Methods declared on superclass `DDMatch`.
83impl DDMatchLink {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88    );
89}
90
91/// Methods declared on superclass `NSObject`.
92impl DDMatchLink {
93    extern_methods!(
94        #[unsafe(method(new))]
95        #[unsafe(method_family = new)]
96        pub unsafe fn new() -> Retained<Self>;
97    );
98}
99
100extern_class!(
101    /// An object that contains a phone number that the data detection system
102    /// matches.
103    ///
104    /// The DataDetection framework returns a phone number match in a
105    /// `DDMatchPhoneNumber` object, which contains a phone number, and optionally a
106    /// label that categorizes the phone number.
107    ///
108    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchphonenumber?language=objc)
109    #[unsafe(super(DDMatch, NSObject))]
110    #[derive(Debug, PartialEq, Eq, Hash)]
111    pub struct DDMatchPhoneNumber;
112);
113
114extern_conformance!(
115    unsafe impl NSObjectProtocol for DDMatchPhoneNumber {}
116);
117
118impl DDMatchPhoneNumber {
119    extern_methods!(
120        /// A string that represents a phone number.
121        #[unsafe(method(phoneNumber))]
122        #[unsafe(method_family = none)]
123        pub unsafe fn phoneNumber(&self) -> Retained<NSString>;
124
125        /// A string that categorizes a phone number, such as Home or Work.
126        #[unsafe(method(label))]
127        #[unsafe(method_family = none)]
128        pub unsafe fn label(&self) -> Option<Retained<NSString>>;
129    );
130}
131
132/// Methods declared on superclass `DDMatch`.
133impl DDMatchPhoneNumber {
134    extern_methods!(
135        #[unsafe(method(init))]
136        #[unsafe(method_family = init)]
137        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138    );
139}
140
141/// Methods declared on superclass `NSObject`.
142impl DDMatchPhoneNumber {
143    extern_methods!(
144        #[unsafe(method(new))]
145        #[unsafe(method_family = new)]
146        pub unsafe fn new() -> Retained<Self>;
147    );
148}
149
150extern_class!(
151    /// An object that contains an email address that the data detection system
152    /// matches.
153    ///
154    /// The DataDetection framework returns an email match in a
155    /// `DDMatchEmailAddress` object, which includes an email address, and
156    /// optionally a label that categorizes the email address.
157    ///
158    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchemailaddress?language=objc)
159    #[unsafe(super(DDMatch, NSObject))]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    pub struct DDMatchEmailAddress;
162);
163
164extern_conformance!(
165    unsafe impl NSObjectProtocol for DDMatchEmailAddress {}
166);
167
168impl DDMatchEmailAddress {
169    extern_methods!(
170        /// A string that represents an email address.
171        #[unsafe(method(emailAddress))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn emailAddress(&self) -> Retained<NSString>;
174
175        /// A string that categorizes an email address, such as Home or Work.
176        #[unsafe(method(label))]
177        #[unsafe(method_family = none)]
178        pub unsafe fn label(&self) -> Option<Retained<NSString>>;
179    );
180}
181
182/// Methods declared on superclass `DDMatch`.
183impl DDMatchEmailAddress {
184    extern_methods!(
185        #[unsafe(method(init))]
186        #[unsafe(method_family = init)]
187        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188    );
189}
190
191/// Methods declared on superclass `NSObject`.
192impl DDMatchEmailAddress {
193    extern_methods!(
194        #[unsafe(method(new))]
195        #[unsafe(method_family = new)]
196        pub unsafe fn new() -> Retained<Self>;
197    );
198}
199
200extern_class!(
201    /// An object that contains a postal address that the data detection system
202    /// matches.
203    ///
204    /// The DataDetection framework returns a postal address match in a
205    /// `DDMatchPostalAddress` object, which optionally contains the matching parts
206    /// of a postal address: street, city, state, postal code, and country.
207    ///
208    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchpostaladdress?language=objc)
209    #[unsafe(super(DDMatch, NSObject))]
210    #[derive(Debug, PartialEq, Eq, Hash)]
211    pub struct DDMatchPostalAddress;
212);
213
214extern_conformance!(
215    unsafe impl NSObjectProtocol for DDMatchPostalAddress {}
216);
217
218impl DDMatchPostalAddress {
219    extern_methods!(
220        /// The street name in a postal address.
221        #[unsafe(method(street))]
222        #[unsafe(method_family = none)]
223        pub unsafe fn street(&self) -> Option<Retained<NSString>>;
224
225        /// The city name in a postal address.
226        #[unsafe(method(city))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn city(&self) -> Option<Retained<NSString>>;
229
230        /// The state name in a postal address.
231        #[unsafe(method(state))]
232        #[unsafe(method_family = none)]
233        pub unsafe fn state(&self) -> Option<Retained<NSString>>;
234
235        /// The postal code in a postal address.
236        #[unsafe(method(postalCode))]
237        #[unsafe(method_family = none)]
238        pub unsafe fn postalCode(&self) -> Option<Retained<NSString>>;
239
240        /// The country or region name in a postal address.
241        #[unsafe(method(country))]
242        #[unsafe(method_family = none)]
243        pub unsafe fn country(&self) -> Option<Retained<NSString>>;
244    );
245}
246
247/// Methods declared on superclass `DDMatch`.
248impl DDMatchPostalAddress {
249    extern_methods!(
250        #[unsafe(method(init))]
251        #[unsafe(method_family = init)]
252        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
253    );
254}
255
256/// Methods declared on superclass `NSObject`.
257impl DDMatchPostalAddress {
258    extern_methods!(
259        #[unsafe(method(new))]
260        #[unsafe(method_family = new)]
261        pub unsafe fn new() -> Retained<Self>;
262    );
263}
264
265extern_class!(
266    /// An object that represents a calendar date or date range that the data
267    /// detection system matches.
268    ///
269    /// The DataDetection framework returns a calendar event match in a
270    /// `DDMatchCalendarEvent` object, which has only a beginning date, only an end
271    /// date, or both a beginning date and an end date.
272    ///
273    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchcalendarevent?language=objc)
274    #[unsafe(super(DDMatch, NSObject))]
275    #[derive(Debug, PartialEq, Eq, Hash)]
276    pub struct DDMatchCalendarEvent;
277);
278
279extern_conformance!(
280    unsafe impl NSObjectProtocol for DDMatchCalendarEvent {}
281);
282
283impl DDMatchCalendarEvent {
284    extern_methods!(
285        /// A Boolean value that indicates whether the event is an all-day event.
286        #[unsafe(method(isAllDay))]
287        #[unsafe(method_family = none)]
288        pub unsafe fn isAllDay(&self) -> bool;
289
290        /// A date that represents the start of the event.
291        #[unsafe(method(startDate))]
292        #[unsafe(method_family = none)]
293        pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;
294
295        /// The time zone for the event’s start date.
296        #[unsafe(method(startTimeZone))]
297        #[unsafe(method_family = none)]
298        pub unsafe fn startTimeZone(&self) -> Option<Retained<NSTimeZone>>;
299
300        /// A date that represents the end of the event.
301        #[unsafe(method(endDate))]
302        #[unsafe(method_family = none)]
303        pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
304
305        /// The time zone for the event’s end date.
306        #[unsafe(method(endTimeZone))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn endTimeZone(&self) -> Option<Retained<NSTimeZone>>;
309    );
310}
311
312/// Methods declared on superclass `DDMatch`.
313impl DDMatchCalendarEvent {
314    extern_methods!(
315        #[unsafe(method(init))]
316        #[unsafe(method_family = init)]
317        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
318    );
319}
320
321/// Methods declared on superclass `NSObject`.
322impl DDMatchCalendarEvent {
323    extern_methods!(
324        #[unsafe(method(new))]
325        #[unsafe(method_family = new)]
326        pub unsafe fn new() -> Retained<Self>;
327    );
328}
329
330extern_class!(
331    /// An object that contains parcel tracking information that the data detection
332    /// system matches.
333    ///
334    /// The DataDetection framework returns a shipment tracking number match in a
335    /// `DDMatchShipmentTrackingNumber` object, which contains a carrier name and
336    /// tracking identifier.
337    ///
338    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchshipmenttrackingnumber?language=objc)
339    #[unsafe(super(DDMatch, NSObject))]
340    #[derive(Debug, PartialEq, Eq, Hash)]
341    pub struct DDMatchShipmentTrackingNumber;
342);
343
344extern_conformance!(
345    unsafe impl NSObjectProtocol for DDMatchShipmentTrackingNumber {}
346);
347
348impl DDMatchShipmentTrackingNumber {
349    extern_methods!(
350        /// The name of a parcel carrier.
351        #[unsafe(method(carrier))]
352        #[unsafe(method_family = none)]
353        pub unsafe fn carrier(&self) -> Retained<NSString>;
354
355        /// A string that represents a carrier’s tracking identifier for a parcel.
356        #[unsafe(method(trackingNumber))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn trackingNumber(&self) -> Retained<NSString>;
359    );
360}
361
362/// Methods declared on superclass `DDMatch`.
363impl DDMatchShipmentTrackingNumber {
364    extern_methods!(
365        #[unsafe(method(init))]
366        #[unsafe(method_family = init)]
367        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
368    );
369}
370
371/// Methods declared on superclass `NSObject`.
372impl DDMatchShipmentTrackingNumber {
373    extern_methods!(
374        #[unsafe(method(new))]
375        #[unsafe(method_family = new)]
376        pub unsafe fn new() -> Retained<Self>;
377    );
378}
379
380extern_class!(
381    /// An object that contains a flight number that the data detection system
382    /// matches.
383    ///
384    /// The DataDetection framework returns a flight number match in a
385    /// `DDMatchFlightNumber` object, which contains an airline name and flight
386    /// number.
387    ///
388    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchflightnumber?language=objc)
389    #[unsafe(super(DDMatch, NSObject))]
390    #[derive(Debug, PartialEq, Eq, Hash)]
391    pub struct DDMatchFlightNumber;
392);
393
394extern_conformance!(
395    unsafe impl NSObjectProtocol for DDMatchFlightNumber {}
396);
397
398impl DDMatchFlightNumber {
399    extern_methods!(
400        /// The name of an airline.
401        #[unsafe(method(airline))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn airline(&self) -> Retained<NSString>;
404
405        /// A string that represents a flight number.
406        #[unsafe(method(flightNumber))]
407        #[unsafe(method_family = none)]
408        pub unsafe fn flightNumber(&self) -> Retained<NSString>;
409    );
410}
411
412/// Methods declared on superclass `DDMatch`.
413impl DDMatchFlightNumber {
414    extern_methods!(
415        #[unsafe(method(init))]
416        #[unsafe(method_family = init)]
417        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
418    );
419}
420
421/// Methods declared on superclass `NSObject`.
422impl DDMatchFlightNumber {
423    extern_methods!(
424        #[unsafe(method(new))]
425        #[unsafe(method_family = new)]
426        pub unsafe fn new() -> Retained<Self>;
427    );
428}
429
430extern_class!(
431    /// An object that contains an amount of money that the data detection system
432    /// matches.
433    ///
434    /// The DataDetection framework returns a match for an amount of money in a
435    /// `DDMatchMoneyAmount` object, which contains an amount of money and an ISO
436    /// currency code.
437    ///
438    /// See also [Apple's documentation](https://developer.apple.com/documentation/datadetection/ddmatchmoneyamount?language=objc)
439    #[unsafe(super(DDMatch, NSObject))]
440    #[derive(Debug, PartialEq, Eq, Hash)]
441    pub struct DDMatchMoneyAmount;
442);
443
444extern_conformance!(
445    unsafe impl NSObjectProtocol for DDMatchMoneyAmount {}
446);
447
448impl DDMatchMoneyAmount {
449    extern_methods!(
450        /// A string that contains an ISO currency code, which the data detection system
451        /// identifies from the matched string and user preferences.
452        #[unsafe(method(currency))]
453        #[unsafe(method_family = none)]
454        pub unsafe fn currency(&self) -> Retained<NSString>;
455
456        /// A number that represents an amount of money.
457        #[unsafe(method(amount))]
458        #[unsafe(method_family = none)]
459        pub unsafe fn amount(&self) -> c_double;
460    );
461}
462
463/// Methods declared on superclass `DDMatch`.
464impl DDMatchMoneyAmount {
465    extern_methods!(
466        #[unsafe(method(init))]
467        #[unsafe(method_family = init)]
468        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
469    );
470}
471
472/// Methods declared on superclass `NSObject`.
473impl DDMatchMoneyAmount {
474    extern_methods!(
475        #[unsafe(method(new))]
476        #[unsafe(method_family = new)]
477        pub unsafe fn new() -> Retained<Self>;
478    );
479}