Tizen Native API
7.0
|
Service applications can provide their own data.
Required Header
#include <data_control.h>
Overview
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(). Note: All callbacks are called in the main loop context, unless stated otherwise.
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 SQL data control request 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 map data control request 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 to 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. | |
int | data_control_provider_send_data_change_noti (data_control_h provider, data_control_data_change_type_e type, bundle *data) |
Sends a data change notification to consumer applications which have successfully added a data change callback. | |
int | data_control_provider_add_data_change_consumer_filter_cb (data_control_provider_data_change_consumer_filter_cb callback, void *user_data, int *callback_id) |
Adds a consumer filter for the data changed callback addition process. | |
int | data_control_provider_remove_data_change_consumer_filter_cb (int callback_id) |
Removes a consumer filter for the data changed callback addition process. | |
int | data_control_provider_foreach_data_change_consumer (data_control_h provider, data_control_provider_data_change_consumer_cb list_cb, void *user_data) |
Retrieves ids of all applications which receive data change notifications from a given provider. | |
int | data_control_provider_send_bulk_insert_result (int request_id, data_control_bulk_result_data_h bulk_results) |
Sends the result of the bulk insert request to the client application. | |
int | data_control_provider_send_map_bulk_add_result (int request_id, data_control_bulk_result_data_h bulk_results) |
Sends the result of the bulk add request to the client application. | |
int | data_control_provider_sql_register_insert_bulk_data_request_cb (data_control_provider_bulk_cb callback, void *user_data) |
Registers a callback for the SQL bulk data request. | |
int | data_control_provider_sql_unregister_insert_bulk_data_request_cb (void) |
Unregisters the callback for the SQL bulk data request. | |
int | data_control_provider_map_register_add_bulk_data_request_cb (data_control_provider_bulk_cb callback, void *user_data) |
Registers a callback for the MAP bulk data request. | |
int | data_control_provider_map_unregister_add_bulk_data_request_cb (void) |
Unregisters the callback for the MAP bulk data request. | |
Typedefs | |
typedef bool(* | data_control_provider_data_change_consumer_cb )(data_control_h provider, char *consumer_appid, void *user_data) |
Called for each application which successfully added a data change callback. | |
typedef bool(* | data_control_provider_data_change_consumer_filter_cb )(data_control_h provider, char *consumer_appid, void *user_data) |
Called when a consumer requests a data change callback addition. | |
typedef void(* | data_control_provider_bulk_cb )(int request_id, data_control_h provider, data_control_bulk_data_h bulk_data, void *user_data) |
Called when the bulk data request is received from an consumer application. | |
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. |
Typedef Documentation
typedef void(* data_control_provider_bulk_cb)(int request_id, data_control_h provider, data_control_bulk_data_h bulk_data, void *user_data) |
Called when the bulk data request is received from an consumer application.
- Since :
- 3.0
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[in] bulk_data The bulk data handle which contains data to be inserted or added [in] user_data The user data passed from the register function
typedef bool(* data_control_provider_data_change_consumer_cb)(data_control_h provider, char *consumer_appid, void *user_data) |
Called for each application which successfully added a data change callback.
- Since :
- 3.0
- Parameters:
-
[in] provider The provider handle. provider is valid only inside this function
provider should not be freed[in] consumer_appid The id of the consumer application. consumer_appid is valid only inside this function
To use outside the callback, make a copy. consumer_appid should not be freed[in] user_data The user data
- Returns:
true
to continue with the next iteration of the loop, otherwisefalse
to break out of the loop
- Precondition:
- data_control_provider_foreach_data_change_consumer() must be called to invoke this callback.
typedef bool(* data_control_provider_data_change_consumer_filter_cb)(data_control_h provider, char *consumer_appid, void *user_data) |
Called when a consumer requests a data change callback addition.
The callback decides - through the return value - whether a consumer application should be allowed to add a data change callback.
If it returns true, it means the application should be allowed to do so, if it returns false, it means it should be denied.
- Since :
- 3.0
- Parameters:
-
[in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[in] consumer_appid The id of the consumer application which requested to add the callback. consumer_appid is valid only inside this function.
To use outside the callback, make a copy. consumer_appid should not be freed[in] user_data The user data.
- Returns:
- A boolean value indicating whether the consumer application should be allowed to add data change callbacks.
true
let the application add a data change callback, otherwisefalse
application not allowed to add data change callback
- Precondition:
- The callback must be registered using data_control_provider_add_data_change_consumer_filter_cb().
data_control_add_data_change_cb() must be called to invoke this callback.
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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[in] insert_data The column-value pairs to insert
If the value is a string, the value must be wrapped in single quotes, otherwise it does not need to be wrapped in single quotes.
To use outside the callback, make a copy by using bundle_dup(). insert_data should not be freed.[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] provider The provider handle. provider is valid only inside this function.
provider should not be freed[in] update_data The column-value pairs to update
If the value is a string, the value must be wrapped in single quotes, otherwise it does not need to be wrapped in single quotes.
To use outside the callback, make a copy by using bundle_dup(). update_data should not be freed.[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
Function Documentation
int data_control_provider_add_data_change_consumer_filter_cb | ( | data_control_provider_data_change_consumer_filter_cb | callback, |
void * | user_data, | ||
int * | callback_id | ||
) |
Adds a consumer filter for the data changed callback addition process.
- Since :
- 3.0
- Remarks:
- If the provider does not add any filters by calling this function, all requests to add a data change callback will be granted.
If filters are added, and at least one filter returns false for a consumer application, the application will not be able to add data change callbacks.
- Parameters:
-
[in] callback Consumer filter callback, filtering consumers which try to add data changed callback [in] user_data The user data to be passed to the list_cb function [out] callback_id Added callback ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
char* data_control_provider_create_delete_statement | ( | data_control_h | provider, |
const char * | where | ||
) |
Creates SQL DELETE statement.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[in] provider The provider handle [in] where A filter to select the desired rows to delete
PassNULL
if all rows need to be deleted
- Returns:
- The SQL DELETE statement on success, otherwise NULL
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
char* data_control_provider_create_insert_statement | ( | data_control_h | provider, |
bundle * | insert_map | ||
) |
Creates SQL INSERT statement.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[in] provider The provider handle [in] insert_map The column-value pairs to insert
- Returns:
- The SQL INSERT statement on success, otherwise NULL
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[in] provider The provider handle [in] column_list The column names to query
PassNULL
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
- Returns:
- The SQL SELECT statement on success, otherwise NULL
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
char* data_control_provider_create_update_statement | ( | data_control_h | provider, |
bundle * | update_map, | ||
const char * | where | ||
) |
Creates SQL UPDATE statement.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[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
- Returns:
- The SQL UPDATE statement on success, otherwise NULL
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_foreach_data_change_consumer | ( | data_control_h | provider, |
data_control_provider_data_change_consumer_cb | list_cb, | ||
void * | user_data | ||
) |
Retrieves ids of all applications which receive data change notifications from a given provider.
This function calls data_control_provider_data_change_consumer_cb() once for each provider's notification target consumer id.
If the data_control_provider_data_change_consumer_cb() callback function returns false
, then iteration will be finished.
- Since :
- 3.0
- Parameters:
-
[in] provider Target provider handle [in] list_cb The iteration callback function [in] user_data The user data to be passed to the list_cb function
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
- Postcondition:
- This function invokes data_control_provider_data_change_consumer_cb().
int data_control_provider_get_client_appid | ( | int | request_id, |
char ** | appid | ||
) |
Gets the application ID which sends the data control request.
- Since :
- 2.3
- Remarks:
- You must release appid using free() after it is used.
- Parameters:
-
[in] request_id The request ID [out] appid The application ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_map_register_add_bulk_data_request_cb | ( | data_control_provider_bulk_cb | callback, |
void * | user_data | ||
) |
Registers a callback for the MAP bulk data request.
The provider is notified when a data control request is received from the client applications.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_PERMISSION_DENIED Permission denied DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
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.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_PERMISSION_DENIED Permission denied DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
Unregisters the callback for the MAP bulk data request.
- Since :
- 3.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful
int data_control_provider_map_unregister_cb | ( | void | ) |
Unregisters the map data control request callback functions.
- Since :
- 2.3
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful
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.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[in] provider The provider handle [in] data_id The data ID to be compared with handle's data ID
- Returns:
true
if the data_id matches, otherwisefalse
if it does not match
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Remarks:
- The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
- Parameters:
-
[in] provider The provider handle [in] provider_id The provider ID to be compared with handle's provider ID
- Returns:
true
if the provider_id matches, otherwisefalse
if it does not match
- Exceptions:
-
DATA_CONTROL_ERROR_NONE Success DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_remove_data_change_consumer_filter_cb | ( | int | callback_id | ) |
Removes a consumer filter for the data changed callback addition process.
- Since :
- 3.0
- Parameters:
-
[in] callback_id Target callback ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter
int data_control_provider_send_bulk_insert_result | ( | int | request_id, |
data_control_bulk_result_data_h | bulk_results | ||
) |
Sends the result of the bulk insert request to the client application.
- Since :
- 3.0
- Parameters:
-
[in] request_id The request ID [in] bulk_results The bulk add result for each data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_send_data_change_noti | ( | data_control_h | provider, |
data_control_data_change_type_e | type, | ||
bundle * | data | ||
) |
Sends a data change notification to consumer applications which have successfully added a data change callback.
If the function is successful, data_control_data_change_cb() callback will be called under certain conditions.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[in] provider Target provider handle [in] type Changed data type [in] data Customized information about changed data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_PERMISSION_DENIED Permission denied DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
- Precondition:
- The consumer should call data_control_add_data_change_cb() to receive data change notifications
int data_control_provider_send_delete_result | ( | int | request_id | ) |
Sends the success result of the delete request to the client application.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_send_error | ( | int | request_id, |
const char * | error | ||
) |
Sends the provider error message to the client application.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] error The provider-defined error message
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] row_id The row ID of the database changed by the insert request
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_send_map_bulk_add_result | ( | int | request_id, |
data_control_bulk_result_data_h | bulk_results | ||
) |
Sends the result of the bulk add request to the client application.
- Since :
- 3.0
- Parameters:
-
[in] request_id The request ID [in] bulk_results The bulk add result for each data
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] value_list The result value list [in] value_count The number of the values
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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 to the client application.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID [in] db_handle The result DB handle for the result set
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
int data_control_provider_send_update_result | ( | int | request_id | ) |
Sends the success result of the update request to the client application.
- Since :
- 2.3
- Parameters:
-
[in] request_id The request ID
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error DATA_CONTROL_ERROR_OUT_OF_MEMORY Out of memory
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.
- Since :
- 2.3
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_PERMISSION_DENIED Permission denied DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
int data_control_provider_sql_register_insert_bulk_data_request_cb | ( | data_control_provider_bulk_cb | callback, |
void * | user_data | ||
) |
Registers a callback for the SQL bulk data request.
The provider is notified when a data control request is received from the client applications.
- Since :
- 3.0
- Privilege Level:
- public
- Privilege:
- http://tizen.org/privilege/datasharing
- Parameters:
-
[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
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful DATA_CONTROL_ERROR_PERMISSION_DENIED Permission denied DATA_CONTROL_ERROR_INVALID_PARAMETER Invalid parameter DATA_CONTROL_ERROR_IO_ERROR I/O error
int data_control_provider_sql_unregister_cb | ( | void | ) |
Unregisters the SQL data control request callback functions.
- Since :
- 2.3
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful
Unregisters the callback for the SQL bulk data request.
- Since :
- 3.0
- Returns:
0
on success, otherwise a negative error value
- Return values:
-
DATA_CONTROL_ERROR_NONE Successful