Gjsify LogoGjsify Logo

This opaque type describes a parsed phone number. It can be copied using e_phone_number_copy(). To release it call e_phone_number_free().

record

Hierarchy

  • PhoneNumber

Index

Constructors

Properties

name: string

Methods

  • free(): void
  • Queries the phone_number's country calling code and optionally stores the country calling code's origin in source. For instance when parsing "+1-617-5423789" this function would return one and assing E_PHONE_NUMBER_COUNTRY_FROM_FQTN to source.

    Parameters

    Returns number

  • get_national_number(): string
  • Queries the national portion of phone_number without any call-out prefixes. For instance when parsing "+1-617-5423789" this function would return the string "6175423789".

    Returns string

  • compare_strings_with_region(first_number: string, second_number: string, region_code: string): PhoneNumberMatch
  • Compares two phone numbers within the context of region_code.

    Parameters

    • first_number: string

      the first EPhoneNumber to compare

    • second_number: string

      the second EPhoneNumber to compare

    • region_code: string

      a two-letter country code, or %NULL

    Returns PhoneNumberMatch

  • error_quark(): number
  • from_string(phone_number: string, region_code: string): PhoneNumber
  • Parses the string passed in phone_number. Note that no validation is performed whether the recognized phone number is valid for a particular region.

    The two-letter country code passed in region_code only is used if the phone_number is not written in international format. The application's default region as returned by e_phone_number_get_default_region() is used if region_code is %NULL.

    If the number is guaranteed to start with a '+' followed by the country calling code, then "ZZ" can be passed for region_code.

    Parameters

    • phone_number: string

      the phone number to parse

    • region_code: string

      a two-letter country code, or %NULL

    Returns PhoneNumber

  • get_country_code_for_region(region_code: string): number
  • Retrieves the preferred country calling code for region_code, e.g. 358 for "fi" or 1 for "en_USUTF-8".

    If %NULL is passed for region_code the default region as returned by e_phone_number_get_default_region() is used.

    Parameters

    • region_code: string

      a two-letter country code, a locale name, or %NULL

    Returns number

  • get_default_region(): string
  • Retrieves the current two-letter country code that's used by default for parsing phone numbers in e_phone_number_from_string(). It can be useful to store this number before parsing a bigger number of phone numbers.

    The result of this functions depends on the current setup of the %LC_ADDRESS category: If that category provides a reasonable value for %_NL_ADDRESS_COUNTRY_AB2 this value is returned. Otherwise the locale name configured for %LC_ADDRESS is parsed.

    Returns string

  • is_supported(): boolean
  • Checks if phone number support is available. It is recommended to call this function before using any of the phone-utils functions to ensure that the required functionality is available, and to pick alternative mechanisms if needed.

    Returns boolean

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method