| Tizen Native API
    7.0
    | 
The Sticker Data API provides the functions for setting and getting sticker attributes.
Required Header
#include <sticker_data.h>
Overview
The Sticker Data API provides the functions to set and get sticker attributes:
- Name of the provider application
- URI type
- URI
- Keyword
- Group name
- Thumbnail path
- Description
- Last updated date
| Functions | |
| int | sticker_data_create (sticker_data_h *data_handle) | 
| Creates a sticker data handle. | |
| int | sticker_data_destroy (sticker_data_h data_handle) | 
| Destroys a sticker data handle. | |
| int | sticker_data_clone (sticker_data_h origin_handle, sticker_data_h *target_handle) | 
| Clones a sticker data handle. | |
| int | sticker_data_get_handle (const char *uri, sticker_data_h *data_handle) | 
| Gets the sticker data handle for the given URI. | |
| int | sticker_data_get_app_id (sticker_data_h data_handle, char **app_id) | 
| Gets the name of the sticker provider application from sticker data handle. | |
| int | sticker_data_set_uri (sticker_data_h data_handle, sticker_data_uri_type_e type, const char *uri) | 
| Sets the URI and URI type of the sticker. | |
| int | sticker_data_get_uri (sticker_data_h data_handle, sticker_data_uri_type_e *type, char **uri) | 
| Gets the URI and URI type from sticker data handle. | |
| int | sticker_data_foreach_keyword (sticker_data_h data_handle, sticker_data_keyword_foreach_cb callback, void *user_data) | 
| Retrieves all keywords of the sticker using callback function. | |
| int | sticker_data_add_keyword (sticker_data_h data_handle, const char *keyword) | 
| Adds a keyword of the sticker to the list. | |
| int | sticker_data_remove_keyword (sticker_data_h data_handle, const char *keyword) | 
| Removes a keyword of the sticker from the list. | |
| int | sticker_data_set_group_name (sticker_data_h data_handle, const char *group) | 
| Sets the group name of the sticker. | |
| int | sticker_data_get_group_name (sticker_data_h data_handle, char **group) | 
| Gets the group name from sticker data handle. | |
| int | sticker_data_set_thumbnail (sticker_data_h data_handle, const char *thumbnail) | 
| Sets the thumbnail local path of the sticker. | |
| int | sticker_data_get_thumbnail (sticker_data_h data_handle, char **thumbnail) | 
| Gets the thumbnail local path from sticker data handle. | |
| int | sticker_data_set_description (sticker_data_h data_handle, const char *description) | 
| Sets the description of the sticker. | |
| int | sticker_data_get_description (sticker_data_h data_handle, char **description) | 
| Gets the description from sticker data handle. | |
| int | sticker_data_get_date (sticker_data_h data_handle, char **date) | 
| Gets the last updated date from sticker data handle. | |
| int | sticker_data_set_display_type (sticker_data_h data_handle, sticker_data_display_type_e type) | 
| Sets the display type of the sticker. | |
| int | sticker_data_get_display_type (sticker_data_h data_handle, sticker_data_display_type_e *type) | 
| Gets the display type from sticker data handle. | |
| Typedefs | |
| typedef struct sticker_data_s * | sticker_data_h | 
| The sticker data handle. | |
| typedef void(* | sticker_data_keyword_foreach_cb )(const char *keyword, void *user_data) | 
| Called to retrieve the keyword of the sticker. | |
Typedef Documentation
| typedef struct sticker_data_s* sticker_data_h | 
The sticker data handle.
- Since :
- 5.5
| typedef void(* sticker_data_keyword_foreach_cb)(const char *keyword, void *user_data) | 
Called to retrieve the keyword of the sticker.
The sticker_data_foreach_keyword() must be called to invoke this callback function, synchronously.
- Since :
- 5.5
- Remarks:
- keyword should not be freed and can be used only in the callback.
- Parameters:
- 
  [in] keyword The sticker keyword [in] user_data The user data passed from the foreach function 
- Precondition:
- sticker_data_foreach_keyword() will invoke this callback.
- See also:
- sticker_data_foreach_keyword()
Enumeration Type Documentation
Function Documentation
| int sticker_data_add_keyword | ( | sticker_data_h | data_handle, | 
| const char * | keyword | ||
| ) | 
Adds a keyword of the sticker to the list.
- Since :
- 5.5
- Remarks:
- keyword must have a non-null value and can not have duplicate value. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] keyword The keyword to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
| int sticker_data_clone | ( | sticker_data_h | origin_handle, | 
| sticker_data_h * | target_handle | ||
| ) | 
Clones a sticker data handle.
- Since :
- 5.5
- Remarks:
- If the function succeeds, target_handle must be released with sticker_data_destroy().
- Parameters:
- 
  [in] origin_handle The sticker data handle [out] target_handle The sticker data handle to be cloned 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_OUT_OF_MEMORY Out of memory 
- See also:
- sticker_data_destroy()
| int sticker_data_create | ( | sticker_data_h * | data_handle | ) | 
Creates a sticker data handle.
- Since :
- 5.5
- Remarks:
- If the function succeeds, data_handle must be released with sticker_data_destroy().
- Parameters:
- 
  [out] data_handle The sticker data handle 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_OUT_OF_MEMORY Out of memory STICKER_ERROR_OPERATION_FAILED Operation failed 
- See also:
- sticker_data_destroy()
| int sticker_data_destroy | ( | sticker_data_h | data_handle | ) | 
Destroys a sticker data handle.
- Since :
- 5.5
- Parameters:
- 
  [in] data_handle The sticker data handle 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_create()
| int sticker_data_foreach_keyword | ( | sticker_data_h | data_handle, | 
| sticker_data_keyword_foreach_cb | callback, | ||
| void * | user_data | ||
| ) | 
Retrieves all keywords of the sticker using callback function.
- Since :
- 5.5
- Parameters:
- 
  [in] data_handle The sticker data handle [in] callback The callback function to invoke [in] user_data The user data to be passed to the callback function 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_NO_DATA No data available 
- Postcondition:
- This function invokes sticker_data_keyword_foreach_cb() repeatedly for getting keywords.
| int sticker_data_get_app_id | ( | sticker_data_h | data_handle, | 
| char ** | app_id | ||
| ) | 
Gets the name of the sticker provider application from sticker data handle.
- Since :
- 5.5
- Remarks:
- app_id must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] app_id The name of the application that provides sticker information 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_NO_DATA No data available 
| int sticker_data_get_date | ( | sticker_data_h | data_handle, | 
| char ** | date | ||
| ) | 
Gets the last updated date from sticker data handle.
The format of date is YYYY-MM-DD HH:MM:SS.
- Since :
- 5.5
- Remarks:
- date must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] date The last updated date 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_NO_DATA No data available 
| int sticker_data_get_description | ( | sticker_data_h | data_handle, | 
| char ** | description | ||
| ) | 
Gets the description from sticker data handle.
If the description is empty, the result will be an empty string.
- Since :
- 5.5
- Remarks:
- description must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] description The description of the sticker 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_set_description()
| int sticker_data_get_display_type | ( | sticker_data_h | data_handle, | 
| sticker_data_display_type_e * | type | ||
| ) | 
Gets the display type from sticker data handle.
If the display type is empty, the result will be a zero.
- Since :
- 5.5
- Parameters:
- 
  [in] data_handle The sticker data handle [out] type The display type of the sticker 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_set_display_type()
| int sticker_data_get_group_name | ( | sticker_data_h | data_handle, | 
| char ** | group | ||
| ) | 
Gets the group name from sticker data handle.
- Since :
- 5.5
- Remarks:
- group must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] group The group name 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_NO_DATA No data available 
- See also:
- sticker_data_set_group_name()
| int sticker_data_get_handle | ( | const char * | uri, | 
| sticker_data_h * | data_handle | ||
| ) | 
Gets the sticker data handle for the given URI.
- Since :
- 5.5
- Remarks:
- If the function succeeds, data_handle must be released with sticker_data_destroy().
- Parameters:
- 
  [in] uri The URI of the sticker data handle [out] data_handle The sticker data handle for the given sticker URI 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_OUT_OF_MEMORY Out of memory STICKER_ERROR_OPERATION_FAILED Operation failed STICKER_ERROR_NO_SUCH_FILE A sticker with given uri does not exist 
- See also:
- sticker_data_destroy()
| int sticker_data_get_thumbnail | ( | sticker_data_h | data_handle, | 
| char ** | thumbnail | ||
| ) | 
Gets the thumbnail local path from sticker data handle.
If the thumbnail is empty, the result will be an empty string.
- Since :
- 5.5
- Remarks:
- thumbnail must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] thumbnail The thumbnail path 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_set_thumbnail()
| int sticker_data_get_uri | ( | sticker_data_h | data_handle, | 
| sticker_data_uri_type_e * | type, | ||
| char ** | uri | ||
| ) | 
Gets the URI and URI type from sticker data handle.
- Since :
- 5.5
- Remarks:
- uri must be released using free().
- Parameters:
- 
  [in] data_handle The sticker data handle [out] type The URI type [out] uri The URI 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter STICKER_ERROR_NO_DATA No data available 
- See also:
- sticker_data_set_uri()
| int sticker_data_remove_keyword | ( | sticker_data_h | data_handle, | 
| const char * | keyword | ||
| ) | 
Removes a keyword of the sticker from the list.
- Since :
- 5.5
- Remarks:
- keyword must exist value in the list. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] keyword The keyword to be removed 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
| int sticker_data_set_description | ( | sticker_data_h | data_handle, | 
| const char * | description | ||
| ) | 
Sets the description of the sticker.
- Since :
- 5.5
- Remarks:
- description must have a non-null value. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] description The description to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_get_description()
| int sticker_data_set_display_type | ( | sticker_data_h | data_handle, | 
| sticker_data_display_type_e | type | ||
| ) | 
Sets the display type of the sticker.
- Since :
- 5.5
- Parameters:
- 
  [in] data_handle The sticker data handle [in] type The display type to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_get_display_type()
| int sticker_data_set_group_name | ( | sticker_data_h | data_handle, | 
| const char * | group | ||
| ) | 
Sets the group name of the sticker.
- Since :
- 5.5
- Remarks:
- group must have a non-null value. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] group The group name to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_get_group_name()
| int sticker_data_set_thumbnail | ( | sticker_data_h | data_handle, | 
| const char * | thumbnail | ||
| ) | 
Sets the thumbnail local path of the sticker.
thumbnail must be a relative path like '/res/smile_thumbnail.png'.
- Since :
- 5.5
- Remarks:
- thumbnail must have a non-null value and must be an existing file. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] thumbnail The thumbnail path to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_get_thumbnail()
| int sticker_data_set_uri | ( | sticker_data_h | data_handle, | 
| sticker_data_uri_type_e | type, | ||
| const char * | uri | ||
| ) | 
Sets the URI and URI type of the sticker.
uri must be a relative path like '/res/smile.png' when the type of URI is local path.
- Since :
- 5.5
- Remarks:
- uri must have a non-null value and must be an existing file. If not, the error as invalid parameter will be returned.
- Parameters:
- 
  [in] data_handle The sticker data handle [in] type The URI type to be saved [in] uri The URI to be saved 
- Returns:
- 0 on success, otherwise a negative error value
- Return values:
- 
  STICKER_ERROR_NONE Successful STICKER_ERROR_NOT_SUPPORTED Not supported STICKER_ERROR_INVALID_PARAMETER Invalid parameter 
- See also:
- sticker_data_get_uri()