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::*;
78use crate::*;
910extern_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)]
21pub struct DDMatch;
22);
2324extern_conformance!(
25unsafe impl NSObjectProtocol for DDMatch {}
26);
2728impl DDMatch {
29extern_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)]
37pub unsafe fn matchedString(&self) -> Retained<NSString>;
3839#[unsafe(method(init))]
40 #[unsafe(method_family = init)]
41pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
42 );
43}
4445/// Methods declared on superclass `NSObject`.
46impl DDMatch {
47extern_methods!(
48#[unsafe(method(new))]
49 #[unsafe(method_family = new)]
50pub unsafe fn new() -> Retained<Self>;
51 );
52}
5354extern_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)]
66pub struct DDMatchLink;
67);
6869extern_conformance!(
70unsafe impl NSObjectProtocol for DDMatchLink {}
71);
7273impl DDMatchLink {
74extern_methods!(
75/// An address for a web resource, such as a webpage or image.
76#[unsafe(method(URL))]
77 #[unsafe(method_family = none)]
78pub unsafe fn URL(&self) -> Retained<NSURL>;
79 );
80}
8182/// Methods declared on superclass `DDMatch`.
83impl DDMatchLink {
84extern_methods!(
85#[unsafe(method(init))]
86 #[unsafe(method_family = init)]
87pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88 );
89}
9091/// Methods declared on superclass `NSObject`.
92impl DDMatchLink {
93extern_methods!(
94#[unsafe(method(new))]
95 #[unsafe(method_family = new)]
96pub unsafe fn new() -> Retained<Self>;
97 );
98}
99100extern_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)]
111pub struct DDMatchPhoneNumber;
112);
113114extern_conformance!(
115unsafe impl NSObjectProtocol for DDMatchPhoneNumber {}
116);
117118impl DDMatchPhoneNumber {
119extern_methods!(
120/// A string that represents a phone number.
121#[unsafe(method(phoneNumber))]
122 #[unsafe(method_family = none)]
123pub unsafe fn phoneNumber(&self) -> Retained<NSString>;
124125/// A string that categorizes a phone number, such as Home or Work.
126#[unsafe(method(label))]
127 #[unsafe(method_family = none)]
128pub unsafe fn label(&self) -> Option<Retained<NSString>>;
129 );
130}
131132/// Methods declared on superclass `DDMatch`.
133impl DDMatchPhoneNumber {
134extern_methods!(
135#[unsafe(method(init))]
136 #[unsafe(method_family = init)]
137pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
138 );
139}
140141/// Methods declared on superclass `NSObject`.
142impl DDMatchPhoneNumber {
143extern_methods!(
144#[unsafe(method(new))]
145 #[unsafe(method_family = new)]
146pub unsafe fn new() -> Retained<Self>;
147 );
148}
149150extern_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)]
161pub struct DDMatchEmailAddress;
162);
163164extern_conformance!(
165unsafe impl NSObjectProtocol for DDMatchEmailAddress {}
166);
167168impl DDMatchEmailAddress {
169extern_methods!(
170/// A string that represents an email address.
171#[unsafe(method(emailAddress))]
172 #[unsafe(method_family = none)]
173pub unsafe fn emailAddress(&self) -> Retained<NSString>;
174175/// A string that categorizes an email address, such as Home or Work.
176#[unsafe(method(label))]
177 #[unsafe(method_family = none)]
178pub unsafe fn label(&self) -> Option<Retained<NSString>>;
179 );
180}
181182/// Methods declared on superclass `DDMatch`.
183impl DDMatchEmailAddress {
184extern_methods!(
185#[unsafe(method(init))]
186 #[unsafe(method_family = init)]
187pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
188 );
189}
190191/// Methods declared on superclass `NSObject`.
192impl DDMatchEmailAddress {
193extern_methods!(
194#[unsafe(method(new))]
195 #[unsafe(method_family = new)]
196pub unsafe fn new() -> Retained<Self>;
197 );
198}
199200extern_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)]
211pub struct DDMatchPostalAddress;
212);
213214extern_conformance!(
215unsafe impl NSObjectProtocol for DDMatchPostalAddress {}
216);
217218impl DDMatchPostalAddress {
219extern_methods!(
220/// The street name in a postal address.
221#[unsafe(method(street))]
222 #[unsafe(method_family = none)]
223pub unsafe fn street(&self) -> Option<Retained<NSString>>;
224225/// The city name in a postal address.
226#[unsafe(method(city))]
227 #[unsafe(method_family = none)]
228pub unsafe fn city(&self) -> Option<Retained<NSString>>;
229230/// The state name in a postal address.
231#[unsafe(method(state))]
232 #[unsafe(method_family = none)]
233pub unsafe fn state(&self) -> Option<Retained<NSString>>;
234235/// The postal code in a postal address.
236#[unsafe(method(postalCode))]
237 #[unsafe(method_family = none)]
238pub unsafe fn postalCode(&self) -> Option<Retained<NSString>>;
239240/// The country or region name in a postal address.
241#[unsafe(method(country))]
242 #[unsafe(method_family = none)]
243pub unsafe fn country(&self) -> Option<Retained<NSString>>;
244 );
245}
246247/// Methods declared on superclass `DDMatch`.
248impl DDMatchPostalAddress {
249extern_methods!(
250#[unsafe(method(init))]
251 #[unsafe(method_family = init)]
252pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
253 );
254}
255256/// Methods declared on superclass `NSObject`.
257impl DDMatchPostalAddress {
258extern_methods!(
259#[unsafe(method(new))]
260 #[unsafe(method_family = new)]
261pub unsafe fn new() -> Retained<Self>;
262 );
263}
264265extern_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)]
276pub struct DDMatchCalendarEvent;
277);
278279extern_conformance!(
280unsafe impl NSObjectProtocol for DDMatchCalendarEvent {}
281);
282283impl DDMatchCalendarEvent {
284extern_methods!(
285/// A Boolean value that indicates whether the event is an all-day event.
286#[unsafe(method(isAllDay))]
287 #[unsafe(method_family = none)]
288pub unsafe fn isAllDay(&self) -> bool;
289290/// A date that represents the start of the event.
291#[unsafe(method(startDate))]
292 #[unsafe(method_family = none)]
293pub unsafe fn startDate(&self) -> Option<Retained<NSDate>>;
294295/// The time zone for the event’s start date.
296#[unsafe(method(startTimeZone))]
297 #[unsafe(method_family = none)]
298pub unsafe fn startTimeZone(&self) -> Option<Retained<NSTimeZone>>;
299300/// A date that represents the end of the event.
301#[unsafe(method(endDate))]
302 #[unsafe(method_family = none)]
303pub unsafe fn endDate(&self) -> Option<Retained<NSDate>>;
304305/// The time zone for the event’s end date.
306#[unsafe(method(endTimeZone))]
307 #[unsafe(method_family = none)]
308pub unsafe fn endTimeZone(&self) -> Option<Retained<NSTimeZone>>;
309 );
310}
311312/// Methods declared on superclass `DDMatch`.
313impl DDMatchCalendarEvent {
314extern_methods!(
315#[unsafe(method(init))]
316 #[unsafe(method_family = init)]
317pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
318 );
319}
320321/// Methods declared on superclass `NSObject`.
322impl DDMatchCalendarEvent {
323extern_methods!(
324#[unsafe(method(new))]
325 #[unsafe(method_family = new)]
326pub unsafe fn new() -> Retained<Self>;
327 );
328}
329330extern_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)]
341pub struct DDMatchShipmentTrackingNumber;
342);
343344extern_conformance!(
345unsafe impl NSObjectProtocol for DDMatchShipmentTrackingNumber {}
346);
347348impl DDMatchShipmentTrackingNumber {
349extern_methods!(
350/// The name of a parcel carrier.
351#[unsafe(method(carrier))]
352 #[unsafe(method_family = none)]
353pub unsafe fn carrier(&self) -> Retained<NSString>;
354355/// A string that represents a carrier’s tracking identifier for a parcel.
356#[unsafe(method(trackingNumber))]
357 #[unsafe(method_family = none)]
358pub unsafe fn trackingNumber(&self) -> Retained<NSString>;
359 );
360}
361362/// Methods declared on superclass `DDMatch`.
363impl DDMatchShipmentTrackingNumber {
364extern_methods!(
365#[unsafe(method(init))]
366 #[unsafe(method_family = init)]
367pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
368 );
369}
370371/// Methods declared on superclass `NSObject`.
372impl DDMatchShipmentTrackingNumber {
373extern_methods!(
374#[unsafe(method(new))]
375 #[unsafe(method_family = new)]
376pub unsafe fn new() -> Retained<Self>;
377 );
378}
379380extern_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)]
391pub struct DDMatchFlightNumber;
392);
393394extern_conformance!(
395unsafe impl NSObjectProtocol for DDMatchFlightNumber {}
396);
397398impl DDMatchFlightNumber {
399extern_methods!(
400/// The name of an airline.
401#[unsafe(method(airline))]
402 #[unsafe(method_family = none)]
403pub unsafe fn airline(&self) -> Retained<NSString>;
404405/// A string that represents a flight number.
406#[unsafe(method(flightNumber))]
407 #[unsafe(method_family = none)]
408pub unsafe fn flightNumber(&self) -> Retained<NSString>;
409 );
410}
411412/// Methods declared on superclass `DDMatch`.
413impl DDMatchFlightNumber {
414extern_methods!(
415#[unsafe(method(init))]
416 #[unsafe(method_family = init)]
417pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
418 );
419}
420421/// Methods declared on superclass `NSObject`.
422impl DDMatchFlightNumber {
423extern_methods!(
424#[unsafe(method(new))]
425 #[unsafe(method_family = new)]
426pub unsafe fn new() -> Retained<Self>;
427 );
428}
429430extern_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)]
441pub struct DDMatchMoneyAmount;
442);
443444extern_conformance!(
445unsafe impl NSObjectProtocol for DDMatchMoneyAmount {}
446);
447448impl DDMatchMoneyAmount {
449extern_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)]
454pub unsafe fn currency(&self) -> Retained<NSString>;
455456/// A number that represents an amount of money.
457#[unsafe(method(amount))]
458 #[unsafe(method_family = none)]
459pub unsafe fn amount(&self) -> c_double;
460 );
461}
462463/// Methods declared on superclass `DDMatch`.
464impl DDMatchMoneyAmount {
465extern_methods!(
466#[unsafe(method(init))]
467 #[unsafe(method_family = init)]
468pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
469 );
470}
471472/// Methods declared on superclass `NSObject`.
473impl DDMatchMoneyAmount {
474extern_methods!(
475#[unsafe(method(new))]
476 #[unsafe(method_family = new)]
477pub unsafe fn new() -> Retained<Self>;
478 );
479}