Tizen Native API
|
Functions | |
int | data_control_provider_sql_register_cb (data_control_provider_sql_cb *callback, void *user_data) |
Registers a callback function for the SQL data control request. The provider is notified when a data control request is received from the client applications. | |
int | data_control_provider_sql_unregister_cb (void) |
Unregisters the callback functions. | |
int | data_control_provider_map_register_cb (data_control_provider_map_cb *callback, void *user_data) |
Registers a callback function for the map data control request. The provider is notified when a data control request is received from the client applications. | |
int | data_control_provider_map_unregister_cb (void) |
Unregisters the callback functions. | |
int | data_control_provider_get_client_appid (int request_id, char **appid) |
Gets the application ID which sends the data control request. | |
int | data_control_provider_send_select_result (int request_id, void *db_handle) |
Sends the success result and the result set of the select request to the client application. | |
int | data_control_provider_send_insert_result (int request_id, long long row_id) |
Sends the success result of the insert request and the last inserted row ID to the client application. | |
int | data_control_provider_send_update_result (int request_id) |
Sends the success result of the update request to the client application. | |
int | data_control_provider_send_delete_result (int request_id) |
Sends the success result of the delete request to the client application. | |
int | data_control_provider_send_error (int request_id, const char *error) |
Sends the provider error message to the client application. | |
int | data_control_provider_send_map_result (int request_id) |
Sends the success result of the request for setting, adding and removing the key-value structured data the client application. | |
int | data_control_provider_send_map_get_value_result (int request_id, char **value_list, int value_count) |
Sends the success result of the request for getting the value list to the client application. | |
char * | data_control_provider_create_insert_statement (data_control_h provider, bundle *insert_map) |
Creates SQL INSERT statement. | |
char * | data_control_provider_create_delete_statement (data_control_h provider, const char *where) |
Creates SQL DELETE statement. | |
char * | data_control_provider_create_update_statement (data_control_h provider, bundle *update_map, const char *where) |
Creates SQL UPDATE statement. | |
char * | data_control_provider_create_select_statement (data_control_h provider, const char **column_list, int column_count, const char *where, const char *order) |
Creates SQL SELECT statement. | |
bool | data_control_provider_match_provider_id (data_control_h provider, const char *provider_id) |
Checks whether the given provider ID matches the provider handle's provider ID. | |
bool | data_control_provider_match_data_id (data_control_h provider, const char *data_id) |
Checks whether the given data ID matches the provider handle's data ID. | |
Typedefs | |
typedef void(* | data_control_provider_sql_insert_request_cb )(int request_id, data_control_h provider, bundle *insert_data, void *user_data) |
Called when the insert request is received from an application using SQL-friendly interface based data control. | |
typedef void(* | data_control_provider_sql_update_request_cb )(int request_id, data_control_h provider, bundle *update_data, const char *where, void *user_data) |
Called when the update request is received from an application using SQL-friendly interface based data control. | |
typedef void(* | data_control_provider_sql_delete_request_cb )(int request_id, data_control_h provider, const char *where, void *user_data) |
Called when the delete request is received from an application using SQL-friendly interface based data control. | |
typedef void(* | data_control_provider_sql_select_request_cb )(int request_id, data_control_h provider, const char **column_list, int column_count, const char *where, const char *order, void *user_data) |
Called when the select request is received from an application using SQL-friendly interface based data control. | |
typedef void(* | data_control_provider_map_get_value_request_cb )(int request_id, data_control_h provider, const char *key, void *user_data) |
Called when the request for obtaining the value list is received from the key-value structured data control consumer. | |
typedef void(* | data_control_provider_map_set_value_request_cb )(int request_id, data_control_h provider, const char *key, const char *old_value, const char *new_value, void *user_data) |
Called when the request for replacing the value is received from the key-value structured data control consumer. | |
typedef void(* | data_control_provider_map_add_value_request_cb )(int request_id, data_control_h provider, const char *key, const char *value, void *user_data) |
Called when the request for adding the value is received from the key-value structured data control consumer. | |
typedef void(* | data_control_provider_map_remove_value_request_cb )(int request_id, data_control_h provider, const char *key, const char *value, void *user_data) |
Called when the request for removing the value is received from the key-value structured data control consumer. |
Service applications can provide their own data.
#include <data_control.h>
The service application providing its own database file must register the provider callback using data_control_provider_sql_register_cb(). The service application providing its own registry file or key-value pairs data set must register the provider callback using the data_control_provider_map_register_cb(). The service application sends SQL-type or Map-type data control result to the other application, by using methods such as data_control_provider_send_select_result(),data_control_provider_send_insert_result(), data_control_provider_send_update_result(), or data_control_provider_send_delete_result().
typedef void(* data_control_provider_map_add_value_request_cb)(int request_id, data_control_h provider, const char *key, const char *value, void *user_data) |
Called when the request for adding the value is received from the key-value structured data control consumer.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | key | The key of the value to add |
[in] | value | The value to add |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_map_get_value_request_cb)(int request_id, data_control_h provider, const char *key, void *user_data) |
Called when the request for obtaining the value list is received from the key-value structured data control consumer.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | key | The key of the value list to obtain |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_map_remove_value_request_cb)(int request_id, data_control_h provider, const char *key, const char *value, void *user_data) |
Called when the request for removing the value is received from the key-value structured data control consumer.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | key | The key of the value to remove |
[in] | value | The value to remove |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_map_set_value_request_cb)(int request_id, data_control_h provider, const char *key, const char *old_value, const char *new_value, void *user_data) |
Called when the request for replacing the value is received from the key-value structured data control consumer.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | key | The key of the value to replace |
[in] | old_value | The value to replace |
[in] | new_value | The new value that replaces the existing value |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_sql_delete_request_cb)(int request_id, data_control_h provider, const char *where, void *user_data) |
Called when the delete request is received from an application using SQL-friendly interface based data control.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | where | A filter to select the desired rows to delete It is an SQL 'WHERE' clause excluding the 'WHERE' itself such as column1 = 'stringValue' and column2 = numericValue. |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_sql_insert_request_cb)(int request_id, data_control_h provider, bundle *insert_data, void *user_data) |
Called when the insert request is received from an application using SQL-friendly interface based data control.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | insert_data | The column-value pairs to insert If the value is a string, the value must be wrapped in single quotes, else it does not need to be wrapped in single quotes. |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_sql_select_request_cb)(int request_id, data_control_h provider, const char **column_list, int column_count, const char *where, const char *order, void *user_data) |
Called when the select request is received from an application using SQL-friendly interface based data control.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | column_list | The column list to query |
[in] | column_count | The total number of columns to be queried |
[in] | where | A filter to select the desired rows It is an SQL 'WHERE' clause excluding the 'WHERE' itself such as column1 = 'stringValue' and column2 = numericValue. |
[in] | order | The sorting order of the rows to query It is an SQL 'ORDER BY' clause excluding the 'ORDER BY' itself. |
[in] | user_data | The user data passed from the register function |
typedef void(* data_control_provider_sql_update_request_cb)(int request_id, data_control_h provider, bundle *update_data, const char *where, void *user_data) |
Called when the update request is received from an application using SQL-friendly interface based data control.
[in] | request_id | The request ID |
[in] | provider | The provider handle |
[in] | update_data | The column-value pairs to update If the value is a string, the value must be wrapped in single quotes, else it does not need to be wrapped in single quotes. |
[in] | where | A filter to select the desired rows to update It is an SQL 'WHERE' clause excluding the 'WHERE' itself such as column1 = 'stringValue' and column2 = numericValue. |
[in] | user_data | The user data passed from the register function |
char* data_control_provider_create_delete_statement | ( | data_control_h | provider, |
const char * | where | ||
) |
Creates SQL DELETE statement.
[in] | provider | The provider handle |
[in] | where | A filter to select the desired rows to delete Pass NULL if all rows need to be deleted. |
DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_OUT_OF_MEMORY | Out of memory |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
char* data_control_provider_create_insert_statement | ( | data_control_h | provider, |
bundle * | insert_map | ||
) |
Creates SQL INSERT statement.
[in] | provider | The provider handle |
[in] | insert_map | The column-value pairs to insert |
DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_OUT_OF_MEMORY | Out of memory |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
char* data_control_provider_create_select_statement | ( | data_control_h | provider, |
const char ** | column_list, | ||
int | column_count, | ||
const char * | where, | ||
const char * | order | ||
) |
Creates SQL SELECT statement.
[in] | provider | The provider handle |
[in] | column_list | The column names to query Pass NULL if all columns need to be selected. |
[in] | column_count | The total number of columns to be queried |
[in] | where | A filter to select the desired rows |
[in] | order | The sorting order of rows to query |
DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_OUT_OF_MEMORY | Out of memory |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
char* data_control_provider_create_update_statement | ( | data_control_h | provider, |
bundle * | update_map, | ||
const char * | where | ||
) |
Creates SQL UPDATE statement.
[in] | provider | The provider handle |
[in] | update_map | The column-value pairs to update |
[in] | where | A filter to select the desired rows to update |
DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_OUT_OF_MEMORY | Out of memory |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_get_client_appid | ( | int | request_id, |
char ** | appid | ||
) |
Gets the application ID which sends the data control request.
[in] | request_id | The request ID |
[out] | appid | The application ID |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_map_register_cb | ( | data_control_provider_map_cb * | callback, |
void * | user_data | ||
) |
Registers a callback function for the map data control request. The provider is notified when a data control request is received from the client applications.
[in] | callback | The callback function to be called when a data control request is received |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
DATA_CONTROL_ERROR_PERMISSION_DENIED | Permission denied |
int data_control_provider_map_unregister_cb | ( | void | ) |
Unregisters the callback functions.
0
on success, otherwise a negative error value bool data_control_provider_match_data_id | ( | data_control_h | provider, |
const char * | data_id | ||
) |
Checks whether the given data ID matches the provider handle's data ID.
[in] | provider | The provider handle |
[in] | data_id | The data ID to be compared with handle's data ID |
true
if the data_id matches, otherwise false
if it does not match DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
bool data_control_provider_match_provider_id | ( | data_control_h | provider, |
const char * | provider_id | ||
) |
Checks whether the given provider ID matches the provider handle's provider ID.
[in] | provider | The provider handle |
[in] | provider_id | The provider ID to be compared with handle's provider ID |
true
if the provider_id matches, otherwise false
if it does not match DATA_CONTROL_ERROR_NONE | Success |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_send_delete_result | ( | int | request_id | ) |
Sends the success result of the delete request to the client application.
[in] | request_id | The request ID |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_send_error | ( | int | request_id, |
const char * | error | ||
) |
Sends the provider error message to the client application.
[in] | request_id | The request ID |
[in] | error | The provider-defined error message |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_send_insert_result | ( | int | request_id, |
long long | row_id | ||
) |
Sends the success result of the insert request and the last inserted row ID to the client application.
[in] | request_id | The request ID |
[in] | row_id | The row ID of the database changed by the insert request |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_send_map_get_value_result | ( | int | request_id, |
char ** | value_list, | ||
int | value_count | ||
) |
Sends the success result of the request for getting the value list to the client application.
[in] | request_id | The request ID |
[in] | value_list | The result value list |
[in] | value_count | The number of the values |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
DATA_CONTROL_ERROR_PERMISSION_DENIED | Permission denied |
int data_control_provider_send_map_result | ( | int | request_id | ) |
Sends the success result of the request for setting, adding and removing the key-value structured data the client application.
[in] | request_id | The request ID |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_send_select_result | ( | int | request_id, |
void * | db_handle | ||
) |
Sends the success result and the result set of the select request to the client application.
[in] | request_id | The request ID |
[in] | db_handle | The result DB handle for the result set |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
DATA_CONTROL_ERROR_PERMISSION_DENIED | Permission denied |
int data_control_provider_send_update_result | ( | int | request_id | ) |
Sends the success result of the update request to the client application.
[in] | request_id | The request ID |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
int data_control_provider_sql_register_cb | ( | data_control_provider_sql_cb * | callback, |
void * | user_data | ||
) |
Registers a callback function for the SQL data control request. The provider is notified when a data control request is received from the client applications.
[in] | callback | The callback function to be called when a data control request is received |
[in] | user_data | The user data to be passed to the callback function |
0
on success, otherwise a negative error valueDATA_CONTROL_ERROR_NONE | Successful |
DATA_CONTROL_ERROR_IO_ERROR | I/O error |
DATA_CONTROL_ERROR_INVALID_PARAMETER | Invalid parameter |
DATA_CONTROL_ERROR_PERMISSION_DENIED | Permission denied |
int data_control_provider_sql_unregister_cb | ( | void | ) |
Unregisters the callback functions.
0
on success, otherwise a negative error value