Tizen Native API  7.0
Sticker Data

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]keywordThe sticker keyword
[in]user_dataThe 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

Enumeration for sticker display type.

Since :
5.5
Enumerator:
STICKER_DATA_DISP_EMOJI 

Emoji type

STICKER_DATA_DISP_WALLPAPER 

Wallpaper type.

The stickers of the wallpaper type are intended to be used by a wallpaper application and usually have larger size.

Enumeration for sticker URI type.

Since :
5.5
Enumerator:
STICKER_DATA_URI_LOCAL_PATH 

Local path URI

STICKER_DATA_URI_WEB_RESOURCE 

Web resource URI


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_handleThe sticker data handle
[in]keywordThe keyword to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sticker_data_keyword_foreach_cb()
sticker_data_foreach_keyword()
sticker_data_remove_keyword()
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_handleThe sticker data handle
[out]target_handleThe sticker data handle to be cloned
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_OUT_OF_MEMORYOut 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_handleThe sticker data handle
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation 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_handleThe sticker data handle
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[in]callbackThe callback function to invoke
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_NO_DATANo data available
Postcondition:
This function invokes sticker_data_keyword_foreach_cb() repeatedly for getting keywords.
See also:
sticker_data_keyword_foreach_cb()
sticker_data_add_keyword()
sticker_data_remove_keyword()
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_handleThe sticker data handle
[out]app_idThe name of the application that provides sticker information
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_NO_DATANo 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_handleThe sticker data handle
[out]dateThe last updated date
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_NO_DATANo 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_handleThe sticker data handle
[out]descriptionThe description of the sticker
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sticker_data_set_description()

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_handleThe sticker data handle
[out]typeThe display type of the sticker
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[out]groupThe group name
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_NO_DATANo 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]uriThe URI of the sticker data handle
[out]data_handleThe sticker data handle for the given sticker URI
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
STICKER_ERROR_NO_SUCH_FILEA 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_handleThe sticker data handle
[out]thumbnailThe thumbnail path
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[out]typeThe URI type
[out]uriThe URI
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_NO_DATANo 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_handleThe sticker data handle
[in]keywordThe keyword to be removed
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sticker_data_keyword_foreach_cb()
sticker_data_foreach_keyword()
sticker_data_add_keyword()
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_handleThe sticker data handle
[in]descriptionThe description to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sticker_data_get_description()

Sets the display type of the sticker.

Since :
5.5
Parameters:
[in]data_handleThe sticker data handle
[in]typeThe display type to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[in]groupThe group name to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[in]thumbnailThe thumbnail path to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid 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_handleThe sticker data handle
[in]typeThe URI type to be saved
[in]uriThe URI to be saved
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
sticker_data_get_uri()