NBPhoneNumberDefines.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // NBPhoneNumberDefines.h
  3. // libPhoneNumber
  4. //
  5. //
  6. #import <Foundation/Foundation.h>
  7. #ifndef libPhoneNumber_NBPhoneNumberDefines_h
  8. #define libPhoneNumber_NBPhoneNumberDefines_h
  9. #define NB_YES [NSNumber numberWithBool:YES]
  10. #define NB_NO [NSNumber numberWithBool:NO]
  11. #pragma mark - Enum -
  12. typedef NS_ENUM(NSInteger, NBEPhoneNumberFormat) {
  13. NBEPhoneNumberFormatE164 = 0,
  14. NBEPhoneNumberFormatINTERNATIONAL = 1,
  15. NBEPhoneNumberFormatNATIONAL = 2,
  16. NBEPhoneNumberFormatRFC3966 = 3
  17. };
  18. typedef NS_ENUM(NSInteger, NBEPhoneNumberType) {
  19. NBEPhoneNumberTypeFIXED_LINE = 0,
  20. NBEPhoneNumberTypeMOBILE = 1,
  21. // In some regions (e.g. the USA), it is impossible to distinguish between
  22. // fixed-line and mobile numbers by looking at the phone number itself.
  23. NBEPhoneNumberTypeFIXED_LINE_OR_MOBILE = 2,
  24. // Freephone lines
  25. NBEPhoneNumberTypeTOLL_FREE = 3,
  26. NBEPhoneNumberTypePREMIUM_RATE = 4,
  27. // The cost of this call is shared between the caller and the recipient, and
  28. // is hence typically less than PREMIUM_RATE calls. See
  29. // http://en.wikipedia.org/wiki/Shared_Cost_Service for more information.
  30. NBEPhoneNumberTypeSHARED_COST = 5,
  31. // Voice over IP numbers. This includes TSoIP (Telephony Service over IP).
  32. NBEPhoneNumberTypeVOIP = 6,
  33. // A personal number is associated with a particular person, and may be routed
  34. // to either a MOBILE or FIXED_LINE number. Some more information can be found
  35. // here = http://en.wikipedia.org/wiki/Personal_Numbers
  36. NBEPhoneNumberTypePERSONAL_NUMBER = 7,
  37. NBEPhoneNumberTypePAGER = 8,
  38. // Used for 'Universal Access Numbers' or 'Company Numbers'. They may be
  39. // further routed to specific offices, but allow one number to be used for a
  40. // company.
  41. NBEPhoneNumberTypeUAN = 9,
  42. // Used for 'Voice Mail Access Numbers'.
  43. NBEPhoneNumberTypeVOICEMAIL = 10,
  44. // A phone number is of type UNKNOWN when it does not fit any of the known
  45. // patterns for a specific region.
  46. NBEPhoneNumberTypeUNKNOWN = -1
  47. };
  48. typedef NS_ENUM(NSInteger, NBEMatchType) {
  49. NBEMatchTypeNOT_A_NUMBER = 0,
  50. NBEMatchTypeNO_MATCH = 1,
  51. NBEMatchTypeSHORT_NSN_MATCH = 2,
  52. NBEMatchTypeNSN_MATCH = 3,
  53. NBEMatchTypeEXACT_MATCH = 4
  54. };
  55. typedef NS_ENUM(NSInteger, NBEValidationResult) {
  56. NBEValidationResultINVALID_LENGTH = -1,
  57. NBEValidationResultUNKNOWN = 0,
  58. NBEValidationResultIS_POSSIBLE = 1,
  59. NBEValidationResultINVALID_COUNTRY_CODE = 2,
  60. NBEValidationResultTOO_SHORT = 3,
  61. NBEValidationResultTOO_LONG = 4,
  62. NBEValidationResultIS_POSSIBLE_LOCAL_ONLY = 5
  63. };
  64. typedef NS_ENUM(NSInteger, NBECountryCodeSource) {
  65. NBECountryCodeSourceFROM_NUMBER_WITH_PLUS_SIGN = 1,
  66. NBECountryCodeSourceFROM_NUMBER_WITH_IDD = 5,
  67. NBECountryCodeSourceFROM_NUMBER_WITHOUT_PLUS_SIGN = 10,
  68. NBECountryCodeSourceFROM_DEFAULT_COUNTRY = 20
  69. };
  70. extern NSString* const NB_UNKNOWN_REGION;
  71. extern NSString* const NB_NON_BREAKING_SPACE;
  72. extern NSString* const NB_PLUS_CHARS;
  73. extern NSString* const NB_VALID_DIGITS_STRING;
  74. extern NSString* const NB_REGION_CODE_FOR_NON_GEO_ENTITY;
  75. #endif