123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676 |
- #import <CoreGraphics/CoreGraphics.h>
- #import <Foundation/Foundation.h>
- #import "FIRVisionBarcodeDetectorOptions.h"
- NS_ASSUME_NONNULL_BEGIN
- /**
- * @enum VisionBarcodeValueType
- * Barcode's value format. For example, TEXT, PRODUCT, URL, etc.
- */
- typedef NS_ENUM(NSInteger, FIRVisionBarcodeValueType) {
- /**
- * Unknown Barcode value types.
- */
- FIRVisionBarcodeValueTypeUnknown,
- /**
- * Barcode value type for contact info.
- */
- FIRVisionBarcodeValueTypeContactInfo,
- /**
- * Barcode value type for email addresses.
- */
- FIRVisionBarcodeValueTypeEmail,
- /**
- * Barcode value type for ISBNs.
- */
- FIRVisionBarcodeValueTypeISBN,
- /**
- * Barcode value type for phone numbers.
- */
- FIRVisionBarcodeValueTypePhone,
- /**
- * Barcode value type for product codes.
- */
- FIRVisionBarcodeValueTypeProduct,
- /**
- * Barcode value type for SMS details.
- */
- FIRVisionBarcodeValueTypeSMS,
- /**
- * Barcode value type for plain text.
- */
- FIRVisionBarcodeValueTypeText,
- /**
- * Barcode value type for URLs/bookmarks.
- */
- FIRVisionBarcodeValueTypeURL,
- /**
- * Barcode value type for Wi-Fi access point details.
- */
- FIRVisionBarcodeValueTypeWiFi,
- /**
- * Barcode value type for geographic coordinates.
- */
- FIRVisionBarcodeValueTypeGeographicCoordinates,
- /**
- * Barcode value type for calendar events.
- */
- FIRVisionBarcodeValueTypeCalendarEvent,
- /**
- * Barcode value type for driver's license data.
- */
- FIRVisionBarcodeValueTypeDriversLicense,
- } NS_SWIFT_NAME(VisionBarcodeValueType);
- /**
- * @enum VisionBarcodeAddressType
- * Address type.
- */
- typedef NS_ENUM(NSInteger, FIRVisionBarcodeAddressType) {
- /**
- * Barcode unknown address type.
- */
- FIRVisionBarcodeAddressTypeUnknown,
- /**
- * Barcode work address type.
- */
- FIRVisionBarcodeAddressTypeWork,
- /**
- * Barcode home address type.
- */
- FIRVisionBarcodeAddressTypeHome,
- } NS_SWIFT_NAME(VisionBarcodeAddressType);
- /**
- * @enum VisionBarcodeEmailType
- * Email type for VisionBarcodeEmail.
- */
- typedef NS_ENUM(NSInteger, FIRVisionBarcodeEmailType) {
- /**
- * Unknown email type.
- */
- FIRVisionBarcodeEmailTypeUnknown,
- /**
- * Barcode work email type.
- */
- FIRVisionBarcodeEmailTypeWork,
- /**
- * Barcode home email type.
- */
- FIRVisionBarcodeEmailTypeHome,
- } NS_SWIFT_NAME(VisionBarcodeEmailType);
- /**
- * @enum VisionBarcodePhoneType
- * Phone type for VisionBarcodePhone.
- */
- typedef NS_ENUM(NSInteger, FIRVisionBarcodePhoneType) {
- /**
- * Unknown phone type.
- */
- FIRVisionBarcodePhoneTypeUnknown,
- /**
- * Barcode work phone type.
- */
- FIRVisionBarcodePhoneTypeWork,
- /**
- * Barcode home phone type.
- */
- FIRVisionBarcodePhoneTypeHome,
- /**
- * Barcode fax phone type.
- */
- FIRVisionBarcodePhoneTypeFax,
- /**
- * Barcode mobile phone type.
- */
- FIRVisionBarcodePhoneTypeMobile,
- } NS_SWIFT_NAME(VisionBarcodePhoneType);
- /**
- * @enum VisionBarcodeWiFiEncryptionType
- * Wi-Fi encryption type for VisionBarcodeWiFi.
- */
- typedef NS_ENUM(NSInteger, FIRVisionBarcodeWiFiEncryptionType) {
- /**
- * Barcode unknown Wi-Fi encryption type.
- */
- FIRVisionBarcodeWiFiEncryptionTypeUnknown,
- /**
- * Barcode open Wi-Fi encryption type.
- */
- FIRVisionBarcodeWiFiEncryptionTypeOpen,
- /**
- * Barcode WPA Wi-Fi encryption type.
- */
- FIRVisionBarcodeWiFiEncryptionTypeWPA,
- /**
- * Barcode WEP Wi-Fi encryption type.
- */
- FIRVisionBarcodeWiFiEncryptionTypeWEP,
- } NS_SWIFT_NAME(VisionBarcodeWiFiEncryptionType);
- /**
- * An address.
- */
- NS_SWIFT_NAME(VisionBarcodeAddress)
- @interface FIRVisionBarcodeAddress : NSObject
- /**
- * Formatted address, containing multiple lines when appropriate.
- *
- * The parsing of address formats is quite limited. Typically all address information will appear
- * on the first address line. To handle addresses better, it is recommended to parse the raw data.
- * The raw data is available in `FIRVisionBarcode`'s `rawValue` property.
- */
- @property(nonatomic, readonly, nullable) NSArray<NSString *> *addressLines;
- /**
- * Address type.
- */
- @property(nonatomic, readonly) FIRVisionBarcodeAddressType type;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A calendar event extracted from a QR code.
- */
- NS_SWIFT_NAME(VisionBarcodeCalendarEvent)
- @interface FIRVisionBarcodeCalendarEvent : NSObject
- /**
- * Calendar event description.
- */
- @property(nonatomic, readonly, nullable) NSString *eventDescription;
- /**
- * Calendar event location.
- */
- @property(nonatomic, readonly, nullable) NSString *location;
- /**
- * Clendar event organizer.
- */
- @property(nonatomic, readonly, nullable) NSString *organizer;
- /**
- * Calendar event status.
- */
- @property(nonatomic, readonly, nullable) NSString *status;
- /**
- * Calendar event summary.
- */
- @property(nonatomic, readonly, nullable) NSString *summary;
- /**
- * Calendar event start date.
- */
- @property(nonatomic, readonly, nullable) NSDate *start;
- /**
- * Calendar event end date.
- */
- @property(nonatomic, readonly, nullable) NSDate *end;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A driver license or ID card data representation.
- *
- * An ANSI driver license contains more fields than are represented by this class. The
- * `FIRVisionBarcode`s `rawValue` property can be used to access the other fields.
- */
- NS_SWIFT_NAME(VisionBarcodeDriverLicense)
- @interface FIRVisionBarcodeDriverLicense : NSObject
- /**
- * Holder's first name.
- */
- @property(nonatomic, readonly, nullable) NSString *firstName;
- /**
- * Holder's middle name.
- */
- @property(nonatomic, readonly, nullable) NSString *middleName;
- /**
- * Holder's last name.
- */
- @property(nonatomic, readonly, nullable) NSString *lastName;
- /**
- * Holder's gender. 1 is male and 2 is female.
- */
- @property(nonatomic, readonly, nullable) NSString *gender;
- /**
- * Holder's city address.
- */
- @property(nonatomic, readonly, nullable) NSString *addressCity;
- /**
- * Holder's state address.
- */
- @property(nonatomic, readonly, nullable) NSString *addressState;
- /**
- * Holder's street address.
- */
- @property(nonatomic, readonly, nullable) NSString *addressStreet;
- /**
- * Holder's address' zipcode.
- */
- @property(nonatomic, readonly, nullable) NSString *addressZip;
- /**
- * Holder's birthday. The date format depends on the issuing country.
- */
- @property(nonatomic, readonly, nullable) NSString *birthDate;
- /**
- * "DL" for driver licenses, "ID" for ID cards.
- */
- @property(nonatomic, readonly, nullable) NSString *documentType;
- /**
- * Driver license ID number.
- */
- @property(nonatomic, readonly, nullable) NSString *licenseNumber;
- /**
- * Driver license expiration date. The date format depends on the issuing country.
- */
- @property(nonatomic, readonly, nullable) NSString *expiryDate;
- /**
- * The date format depends on the issuing country.
- */
- @property(nonatomic, readonly, nullable) NSString *issuingDate;
- /**
- * A country in which DL/ID was issued.
- */
- @property(nonatomic, readonly, nullable) NSString *issuingCountry;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * An email message from a 'MAILTO:' or similar QR Code type.
- */
- NS_SWIFT_NAME(VisionBarcodeEmail)
- @interface FIRVisionBarcodeEmail : NSObject
- /**
- * Email message address.
- */
- @property(nonatomic, readonly, nullable) NSString *address;
- /**
- * Email message body.
- */
- @property(nonatomic, readonly, nullable) NSString *body;
- /**
- * Email message subject.
- */
- @property(nonatomic, readonly, nullable) NSString *subject;
- /**
- * Email message type.
- */
- @property(nonatomic, readonly) FIRVisionBarcodeEmailType type;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * GPS coordinates from a 'GEO:' or similar QR Code type data.
- */
- NS_SWIFT_NAME(VisionBarcodeGeoPoint)
- @interface FIRVisionBarcodeGeoPoint : NSObject
- /**
- * A location latitude.
- */
- @property(nonatomic, readonly) double latitude;
- /**
- * A location longitude.
- */
- @property(nonatomic, readonly) double longitude;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A person's name, both formatted and as individual name components.
- */
- NS_SWIFT_NAME(VisionBarcodePersonName)
- @interface FIRVisionBarcodePersonName : NSObject
- /**
- * Properly formatted name.
- */
- @property(nonatomic, readonly, nullable) NSString *formattedName;
- /**
- * First name.
- */
- @property(nonatomic, readonly, nullable) NSString *first;
- /**
- * Last name.
- */
- @property(nonatomic, readonly, nullable) NSString *last;
- /**
- * Middle name.
- */
- @property(nonatomic, readonly, nullable) NSString *middle;
- /**
- * Name prefix.
- */
- @property(nonatomic, readonly, nullable) NSString *prefix;
- /**
- * Designates a text string to be set as the kana name in the phonebook.
- * Used for Japanese contacts.
- */
- @property(nonatomic, readonly, nullable) NSString *pronounciation;
- /**
- * Name suffix.
- */
- @property(nonatomic, readonly, nullable) NSString *suffix;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A phone number from a 'TEL:' or similar QR Code type.
- */
- NS_SWIFT_NAME(VisionBarcodePhone)
- @interface FIRVisionBarcodePhone : NSObject
- /**
- * Phone number.
- */
- @property(nonatomic, readonly, nullable) NSString *number;
- /**
- * Phone number type.
- */
- @property(nonatomic, readonly) FIRVisionBarcodePhoneType type;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * An SMS message from an 'SMS:' or similar QR Code type.
- */
- NS_SWIFT_NAME(VisionBarcodeSMS)
- @interface FIRVisionBarcodeSMS : NSObject
- /**
- * An SMS message body.
- */
- @property(nonatomic, readonly, nullable) NSString *message;
- /**
- * An SMS message phone number.
- */
- @property(nonatomic, readonly, nullable) NSString *phoneNumber;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A URL and title from a 'MEBKM:' or similar QR Code type.
- */
- NS_SWIFT_NAME(VisionBarcodeURLBookmark)
- @interface FIRVisionBarcodeURLBookmark : NSObject
- /**
- * A URL bookmark title.
- */
- @property(nonatomic, readonly, nullable) NSString *title;
- /**
- * A URL bookmark url.
- */
- @property(nonatomic, readonly, nullable) NSString *url;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * Wi-Fi network parameters from a 'WIFI:' or similar QR Code type.
- */
- NS_SWIFT_NAME(VisionBarcodeWifi)
- @interface FIRVisionBarcodeWiFi : NSObject
- /**
- * A Wi-Fi access point SSID.
- */
- @property(nonatomic, readonly, nullable) NSString *ssid;
- /**
- * A Wi-Fi access point password.
- */
- @property(nonatomic, readonly, nullable) NSString *password;
- /**
- * A Wi-Fi access point encryption type.
- */
- @property(nonatomic, readonly) FIRVisionBarcodeWiFiEncryptionType type;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A person's or organization's business card. This may come from different underlying formats
- * including VCARD and MECARD.
- *
- * This object represents a simplified view of possible business cards. If you require lossless
- * access to the information in the barcode, you should parse the raw data yourself. To access the
- * raw data, use the `FIRVisionBarcode`s `rawValue` property.
- */
- NS_SWIFT_NAME(VisionBarcodeContactInfo)
- @interface FIRVisionBarcodeContactInfo : NSObject
- /**
- * Person's or organization's addresses.
- */
- @property(nonatomic, readonly, nullable) NSArray<FIRVisionBarcodeAddress *> *addresses;
- /**
- * Contact emails.
- */
- @property(nonatomic, readonly, nullable) NSArray<FIRVisionBarcodeEmail *> *emails;
- /**
- * A person's name.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodePersonName *name;
- /**
- * Contact phone numbers.
- */
- @property(nonatomic, readonly, nullable) NSArray<FIRVisionBarcodePhone *> *phones;
- /**
- * Contact URLs.
- */
- @property(nonatomic, readonly, nullable) NSArray<NSString *> *urls;
- /**
- * A job title.
- */
- @property(nonatomic, readonly, nullable) NSString *jobTitle;
- /**
- * A business organization.
- */
- @property(nonatomic, readonly, nullable) NSString *organization;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- /**
- * A barcode in an image.
- */
- NS_SWIFT_NAME(VisionBarcode)
- @interface FIRVisionBarcode : NSObject
- /**
- * The rectangle that holds the discovered relative to the detected image in the view
- * coordinate system.
- */
- @property(nonatomic, readonly) CGRect frame;
- /**
- * A barcode value as it was encoded in the barcode. Structured values are not parsed, for example:
- * 'MEBKM:TITLE:Google;URL:https://www.google.com;;'. Does not include the supplemental value.
- */
- @property(nonatomic, readonly, nullable) NSString *rawValue;
- /**
- * A barcode value in a user-friendly format. May omit some of the information encoded in the
- * barcode. For example, in the case above the display value might be 'https://www.google.com'.
- * If valueType == .text, this field will be equal to rawValue. This value may be multiline,
- * for example, when line breaks are encoded into the original TEXT barcode value. May include
- * the supplement value.
- */
- @property(nonatomic, readonly, nullable) NSString *displayValue;
- /**
- * A barcode format; for example, EAN_13. Note that if the format is not in the list,
- * VisionBarcodeFormat.unknown would be returned.
- */
- @property(nonatomic, readonly) FIRVisionBarcodeFormat format;
- /**
- * The four corner points of the barcode, in clockwise order starting with the top left relative
- * to the detected image in the view coordinate system. These are CGPoints boxed in NSValues.
- * Due to the possible perspective distortions, this is not necessarily a rectangle.
- */
- @property(nonatomic, readonly, nullable) NSArray<NSValue *> *cornerPoints;
- /**
- * A type of the barcode value. For example, TEXT, PRODUCT, URL, etc. Note that if the type is not
- * in the list, .unknown would be returned.
- */
- @property(nonatomic, readonly) FIRVisionBarcodeValueType valueType;
- /**
- * An email message from a 'MAILTO:' or similar QR Code type. This property is only set if
- * valueType is .email.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeEmail *email;
- /**
- * A phone number from a 'TEL:' or similar QR Code type. This property is only set if valueType
- * is .phone.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodePhone *phone;
- /**
- * An SMS message from an 'SMS:' or similar QR Code type. This property is only set if valueType
- * is .sms.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeSMS *sms;
- /**
- * A URL and title from a 'MEBKM:' or similar QR Code type. This property is only set if
- * valueType is .url.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeURLBookmark *URL;
- /**
- * Wi-Fi network parameters from a 'WIFI:' or similar QR Code type. This property is only set
- * if valueType is .wifi.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeWiFi *wifi;
- /**
- * GPS coordinates from a 'GEO:' or similar QR Code type. This property is only set if valueType
- * is .geo.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeGeoPoint *geoPoint;
- /**
- * A person's or organization's business card. For example a VCARD. This property is only set
- * if valueType is .contactInfo.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeContactInfo *contactInfo;
- /**
- * A calendar event extracted from a QR Code. This property is only set if valueType is
- * .calendarEvent.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeCalendarEvent *calendarEvent;
- /**
- * A driver license or ID card. This property is only set if valueType is .driverLicense.
- */
- @property(nonatomic, readonly, nullable) FIRVisionBarcodeDriverLicense *driverLicense;
- /**
- * Unavailable.
- */
- - (instancetype)init NS_UNAVAILABLE;
- @end
- NS_ASSUME_NONNULL_END
|