Tizen Native API
3.0
|
Required Header
#include <phone_number.h>
Overview
The phonenumber utils API provides methods for parsing and formatting phone numbers.
Related Features
This API is related with the following feature:
- http://tizen.org/feature/network.telephony It is recommended to design feature related codes in your application for reliability.
You can check if a device supports the related features for this API by using System Information, thereby controlling the procedure of your application.
To ensure your application is only running on the device with specific features, please define the features in your manifest file using the manifest editor in the SDK.
More details on featuring your application can be found from Feature Element.
Functions | |
int | phone_number_connect (void) |
Connects to the phonenumber-utils service. | |
int | phone_number_disconnect (void) |
Disconnects from the phonenumber-utils service. | |
int | phone_number_get_location_from_number (const char *number, phone_number_region_e region, phone_number_lang_e language, char **location) |
Gets the location string from number, region, and language. | |
int | phone_number_get_formatted_number (const char *number, phone_number_region_e region, char **formatted_number) |
Gets the formatted number. | |
int | phone_number_get_normalized_number (const char *number, char **normalized_number) |
Gets the normalized number. |
Enumeration Type Documentation
enum phone_number_error_e |
Enumeration for phone number errors.
- Since :
- 2.4
- Enumerator:
enum phone_number_lang_e |
Enumeration for language type.
- Since :
- 2.4
- Enumerator:
Enumeration for region type.
- Since :
- 2.4
- Enumerator:
Function Documentation
int phone_number_connect | ( | void | ) |
Connects to the phonenumber-utils service.
- Since :
- 3.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PHONE_NUMBER_ERROR_NONE Successful PHONE_NUMBER_ERROR_SYSTEM Internal error
- See also:
- phone_number_disconnect()
int phone_number_disconnect | ( | void | ) |
Disconnects from the phonenumber-utils service.
- Since :
- 3.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PHONE_NUMBER_ERROR_NONE Successful PHONE_NUMBER_ERROR_SYSTEM Internal error
- See also:
- phone_number_connect()
int phone_number_get_formatted_number | ( | const char * | number, |
phone_number_region_e | region, | ||
char ** | formatted_number | ||
) |
Gets the formatted number.
- Since :
- 2.4
- Remarks:
- You must release formatted_number using free().
- The phonenumber-utils is changed to client/server architecture for performance improvement since 3.0. phone_number_connect()/phone_number_disconnect() should be called.
- Parameters:
-
[in] number The number [in] region The region of number [out] formatted_number The formatted number string to be returned
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PHONE_NUMBER_ERROR_NONE Successful PHONE_NUMBER_ERROR_OUT_OF_MEMORY Out of memory PHONE_NUMBER_ERROR_INVALID_PARAMETER Invalid parameter PHONE_NUMBER_ERROR_FILE_NO_SPACE_ON_DEVICE FS Full PHONE_NUMBER_ERROR_PERMISSION_DENIED Permission denied PHONE_NUMBER_ERROR_NOT_SUPPORTED Not supported PHONE_NUMBER_ERROR_NO_DATA Requested data does not exist
- Precondition:
- phone_number_connect() should be called to open a connection to the phonenumber-utils service. (Since 3.0)
- Postcondition:
- phone_number_disconnect() should be called to close a connection to the phonenumber-utils service. (Since 3.0)
int phone_number_get_location_from_number | ( | const char * | number, |
phone_number_region_e | region, | ||
phone_number_lang_e | language, | ||
char ** | location | ||
) |
Gets the location string from number, region, and language.
- Since :
- 2.4
- Remarks:
- You must release location using free().
- The phonenumber-utils is changed to client/server architecture for performance improvement since 3.0. phone_number_connect()/phone_number_disconnect() should be called.
- Parameters:
-
[in] number The number [in] region The region of number [in] language The language of location [out] location The location string to be returned
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PHONE_NUMBER_ERROR_NONE Successful PHONE_NUMBER_ERROR_OUT_OF_MEMORY Out of memory PHONE_NUMBER_ERROR_INVALID_PARAMETER Invalid parameter PHONE_NUMBER_ERROR_FILE_NO_SPACE_ON_DEVICE FS Full PHONE_NUMBER_ERROR_PERMISSION_DENIED Permission denied PHONE_NUMBER_ERROR_NOT_SUPPORTED Not supported PHONE_NUMBER_ERROR_NO_DATA Requested data does not exist
- Precondition:
- phone_number_connect() should be called to open a connection to the phonenumber-utils service. (Since 3.0)
- Postcondition:
- phone_number_disconnect() should be called to close a connection to the phonenumber-utils service. (Since 3.0)
int phone_number_get_normalized_number | ( | const char * | number, |
char ** | normalized_number | ||
) |
Gets the normalized number.
Normalized number starts with plus('+') and country code, and excludes the separators such as dash or space. It is a format of E.164 standard including the country code based on current network.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/telephony
- Remarks:
- You must release normalized_number using free().
- The phonenumber-utils is changed to client/server architecture for performance improvement since 3.0. phone_number_connect()/phone_number_disconnect() should be called.
- Parameters:
-
[in] number The number [out] normalized_number The normalized number string to be returned
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
PHONE_NUMBER_ERROR_NONE Successful PHONE_NUMBER_ERROR_OUT_OF_MEMORY Out of memory PHONE_NUMBER_ERROR_NOT_SUPPORTED Not supported PHONE_NUMBER_ERROR_INVALID_PARAMETER Invalid parameter PHONE_NUMBER_ERROR_PERMISSION_DENIED Permission denied PHONE_NUMBER_ERROR_NO_DATA Requested data does not exist PHONE_NUMBER_ERROR_SYSTEM Internal error
- Precondition:
- phone_number_connect() should be called to open a connection to the phonenumber-utils service. (Since 3.0)
- Postcondition:
- phone_number_disconnect() should be called to close a connection to the phonenumber-utils service. (Since 3.0)