Tizen Native API  5.5
Sticker Consumer

The Sticker Consumer API provides the functions to retrieve the sticker information.

Required Header

#include <sticker_consumer.h>

Overview

The Sticker Consumer API provides the functions to retrieve the sticker information stored by the provider application. The application that use stickers can retrieve the sticker information using group name, keyword, and so on.

Functions

int sticker_consumer_create (sticker_consumer_h *consumer_handle)
 Creates a sticker consumer handle.
int sticker_consumer_destroy (sticker_consumer_h consumer_handle)
 Destroys a sticker consumer handle.
int sticker_consumer_data_foreach_all (sticker_consumer_h consumer_handle, int offset, int count, int *result, sticker_consumer_data_foreach_cb callback, void *user_data)
 Retrieves all sticker data in the sticker database.
int sticker_consumer_data_foreach_by_keyword (sticker_consumer_h consumer_handle, int offset, int count, int *result, const char *keyword, sticker_consumer_data_foreach_cb callback, void *user_data)
 Retrieves all sticker data in the sticker database using keyword.
int sticker_consumer_data_foreach_by_group (sticker_consumer_h consumer_handle, int offset, int count, int *result, const char *group, sticker_consumer_data_foreach_cb callback, void *user_data)
 Retrieves all sticker data in the sticker database using group name.
int sticker_consumer_data_foreach_by_type (sticker_consumer_h consumer_handle, int offset, int count, int *result, sticker_data_uri_type_e type, sticker_consumer_data_foreach_cb callback, void *user_data)
 Retrieves all sticker data in the sticker database using URI type.
int sticker_consumer_group_list_foreach_all (sticker_consumer_h consumer_handle, sticker_consumer_group_list_foreach_cb callback, void *user_data)
 Retrieves all group name in the sticker database.
int sticker_consumer_keyword_list_foreach_all (sticker_consumer_h consumer_handle, sticker_consumer_keyword_list_foreach_cb callback, void *user_data)
 Retrieves all keyword in the sticker database.
int sticker_consumer_data_foreach_by_display_type (sticker_consumer_h consumer_handle, int offset, int count, int *result, sticker_data_display_type_e type, sticker_consumer_data_foreach_cb callback, void *user_data)
 Retrieves all sticker data in the sticker database using display type.
int sticker_consumer_group_list_foreach_by_display_type (sticker_consumer_h consumer_handle, sticker_data_display_type_e type, sticker_consumer_group_list_foreach_cb callback, void *user_data)
 Retrieves all group names assigned to stickers with a matching display type.
int sticker_consumer_add_recent_data (sticker_consumer_h consumer_handle, sticker_data_h data_handle)
 Adds entry to recently used stickers list.
int sticker_consumer_get_recent_data_list (sticker_consumer_h consumer_handle, int count, int *result, sticker_consumer_data_foreach_cb callback, void *user_data)
 Gets recently used stickers list.
int sticker_consumer_set_event_cb (sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data)
 Registers a callback function to be invoked when the stickers are inserted, deleted, or updated.
int sticker_consumer_unset_event_cb (sticker_consumer_h consumer_handle)
 Unregisters a callback function.

Typedefs

typedef struct sticker_consumer_s * sticker_consumer_h
 The sticker consumer handle.
typedef void(* sticker_consumer_data_foreach_cb )(sticker_data_h data_handle, void *user_data)
 Called to retrieve all sticker data in the sticker database.
typedef void(* sticker_consumer_group_list_foreach_cb )(const char *group, void *user_data)
 Called to retrieve all group names in the sticker database.
typedef void(* sticker_consumer_keyword_list_foreach_cb )(const char *keyword, void *user_data)
 Called to retrieve all keywords in the sticker database.
typedef void(* sticker_consumer_event_cb )(sticker_consumer_event_type_e event_type, sticker_data_h data_handle, void *user_data)
 Called when the stickers are inserted, deleted, or updated.

Typedef Documentation

typedef void(* sticker_consumer_data_foreach_cb)(sticker_data_h data_handle, void *user_data)

Called to retrieve all sticker data in the sticker database.

The sticker_consumer_data_foreach_all(), sticker_consumer_data_foreach_by_keyword(), sticker_consumer_data_foreach_by_group(), sticker_consumer_data_foreach_by_type() must be called to invoke this callback function, synchronously.

Since :
5.5
Remarks:
data_handle should not be freed and can be used only in the callback. If you want to use it outside of the callback, you need to use a clone which can be obtained sticker_data_clone().
Parameters:
[in]data_handleThe sticker data handle
[in]user_dataThe user data passed from the foreach function
Precondition:
sticker_consumer_data_foreach_all() will invoke this callback.
sticker_consumer_data_foreach_by_keyword() will invoke this callback.
sticker_consumer_data_foreach_by_group() will invoke this callback.
sticker_consumer_data_foreach_by_type() will invoke this callback.
See also:
sticker_consumer_data_foreach_all()
sticker_consumer_data_foreach_by_keyword()
sticker_consumer_data_foreach_by_group()
sticker_consumer_data_foreach_by_type()
typedef void(* sticker_consumer_event_cb)(sticker_consumer_event_type_e event_type, sticker_data_h data_handle, void *user_data)

Called when the stickers are inserted, deleted, or updated.

Since :
5.5
Remarks:
data_handle should not be freed and can be used only in the callback. If you want to use it outside of the callback, you need to use a clone which can be obtained sticker_data_clone(). When the event_type is STICKER_CONSUMER_EVENT_TYPE_DELETE, sticker data can be obtained using data_handle, but the files have been already deleted.
Parameters:
[in]event_typeThe event type
[in]data_handleThe sticker data handle
[in]user_dataThe user data passed from sticker_consumer_set_event_cb()
Precondition:
The callback can be registered using sticker_consumer_set_event_cb()
See also:
sticker_consumer_set_event_cb()
sticker_consumer_unset_event_cb()
typedef void(* sticker_consumer_group_list_foreach_cb)(const char *group, void *user_data)

Called to retrieve all group names in the sticker database.

The sticker_consumer_group_list_foreach_all() must be called to invoke this callback function, synchronously.

Since :
5.5
Remarks:
group should not be freed and can be used only in the callback.
Parameters:
[in]groupThe group name of the sticker
[in]user_dataThe user data passed from the foreach function
Precondition:
sticker_consumer_group_list_foreach_all() will invoke this callback.
See also:
sticker_consumer_group_list_foreach_all()
typedef struct sticker_consumer_s* sticker_consumer_h

The sticker consumer handle.

Since :
5.5
typedef void(* sticker_consumer_keyword_list_foreach_cb)(const char *keyword, void *user_data)

Called to retrieve all keywords in the sticker database.

The sticker_consumer_keyword_list_foreach_all() 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 keyword of the sticker
[in]user_dataThe user data passed from the foreach function
Precondition:
sticker_consumer_keyword_list_foreach_all() will invoke this callback.
See also:
sticker_consumer_keyword_list_foreach_all()

Enumeration Type Documentation

Enumeration for event type.

Since :
5.5
Enumerator:
STICKER_CONSUMER_EVENT_TYPE_INSERT 

A sticker data has been added

STICKER_CONSUMER_EVENT_TYPE_DELETE 

A sticker data has been removed

STICKER_CONSUMER_EVENT_TYPE_UPDATE 

A sticker data has been updated


Function Documentation

int sticker_consumer_add_recent_data ( sticker_consumer_h  consumer_handle,
sticker_data_h  data_handle 
)

Adds entry to recently used stickers list.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer handle
[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
STICKER_ERROR_OPERATION_FAILEDOperation failed
See also:
sticker_consumer_get_recent_data_list()
int sticker_consumer_create ( sticker_consumer_h consumer_handle)

Creates a sticker consumer handle.

Since :
5.5
Privilege Level:
public
Privilege:
http://tizen.org/privilege/mediastorage
Remarks:
If the function succeeds, consumer_handle must be released with sticker_consumer_destroy().
Parameters:
[out]consumer_handleThe sticker consumer handle
Returns:
0 on success, otherwise a negative error value
Return values:
STICKER_ERROR_NONESuccessful
STICKER_ERROR_NOT_SUPPORTEDNot supported
STICKER_ERROR_PERMISSION_DENIEDPermission denied
STICKER_ERROR_INVALID_PARAMETERInvalid parameter
STICKER_ERROR_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
See also:
sticker_consumer_destroy()
int sticker_consumer_data_foreach_all ( sticker_consumer_h  consumer_handle,
int  offset,
int  count,
int *  result,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Retrieves all sticker data in the sticker database.

If you set the offset as 10 and count as 10, then only retrieved data from 10 to 19 will be invoked.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]offsetThe start position (Starting from zero)
[in]countThe number of stickers to be retrieved with respect to the offset
[out]resultThe number of stickers retrieved (zero indicates that no data was found)
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
int sticker_consumer_data_foreach_by_display_type ( sticker_consumer_h  consumer_handle,
int  offset,
int  count,
int *  result,
sticker_data_display_type_e  type,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Retrieves all sticker data in the sticker database using display type.

If you set the offset as 10 and count as 10, then only retrieved data from 10 to 19 will be invoked.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]offsetThe start position (Starting from zero)
[in]countThe number of stickers to be retrieved with respect to the offset
[out]resultThe number of stickers retrieved (zero indicates that no data was found)
[in]typeThe display type of the sticker for getting sticker data
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
int sticker_consumer_data_foreach_by_group ( sticker_consumer_h  consumer_handle,
int  offset,
int  count,
int *  result,
const char *  group,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Retrieves all sticker data in the sticker database using group name.

If you set the offset as 10 and count as 10, then only retrieved data from 10 to 19 will be invoked.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]offsetThe start position (Starting from zero)
[in]countThe number of stickers to be retrieved with respect to the offset
[out]resultThe number of stickers retrieved (zero indicates that no data was found)
[in]groupThe group name of the sticker for getting sticker data
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
int sticker_consumer_data_foreach_by_keyword ( sticker_consumer_h  consumer_handle,
int  offset,
int  count,
int *  result,
const char *  keyword,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Retrieves all sticker data in the sticker database using keyword.

If you set the offset as 10 and count as 10, then only retrieved data from 10 to 19 will be invoked.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]offsetThe start position (Starting from zero)
[in]countThe number of stickers to be retrieved with respect to the offset
[out]resultThe number of stickers retrieved (zero indicates that no data was found)
[in]keywordThe keyword of the sticker for getting sticker data
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
int sticker_consumer_data_foreach_by_type ( sticker_consumer_h  consumer_handle,
int  offset,
int  count,
int *  result,
sticker_data_uri_type_e  type,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Retrieves all sticker data in the sticker database using URI type.

If you set the offset as 10 and count as 10, then only retrieved data from 10 to 19 will be invoked.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]offsetThe start position (Starting from zero)
[in]countThe number of stickers to be retrieved with respect to the offset
[out]resultThe number of stickers retrieved (zero indicates that no data was found)
[in]typeThe URI type of the sticker for getting sticker data
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
int sticker_consumer_destroy ( sticker_consumer_h  consumer_handle)

Destroys a sticker consumer handle.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer 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_OPERATION_FAILEDOperation failed
See also:
sticker_consumer_create()
int sticker_consumer_get_recent_data_list ( sticker_consumer_h  consumer_handle,
int  count,
int *  result,
sticker_consumer_data_foreach_cb  callback,
void *  user_data 
)

Gets recently used stickers list.

The most recently used stickers are delivered in order.

Since :
5.5
Remarks:
It is not an error if result is smaller than count.
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]countThe number of stickers that you want to receive. If -1, the number of stickers is not restricted
[out]resultThe number of stickers received (zero indicates that no data was found)
[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_OUT_OF_MEMORYOut of memory
STICKER_ERROR_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_data_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_data_foreach_cb()
sticker_consumer_add_recent_data()
int sticker_consumer_group_list_foreach_all ( sticker_consumer_h  consumer_handle,
sticker_consumer_group_list_foreach_cb  callback,
void *  user_data 
)

Retrieves all group name in the sticker database.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer 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_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_group_list_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_group_list_foreach_cb()

Retrieves all group names assigned to stickers with a matching display type.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer handle
[in]typeThe display type of the sticker for getting sticker data
[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_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_group_list_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_group_list_foreach_cb()

Retrieves all keyword in the sticker database.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer 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_OPERATION_FAILEDOperation failed
Postcondition:
This function invokes sticker_consumer_keyword_list_foreach_cb() repeatedly for getting data.
See also:
sticker_consumer_keyword_list_foreach_cb()
int sticker_consumer_set_event_cb ( sticker_consumer_h  consumer_handle,
sticker_consumer_event_cb  callback,
void *  user_data 
)

Registers a callback function to be invoked when the stickers are inserted, deleted, or updated.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer 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_OPERATION_FAILEDOperation failed
See also:
sticker_consumer_event_cb()
sticker_consumer_unset_event_cb()

Unregisters a callback function.

Since :
5.5
Parameters:
[in]consumer_handleThe sticker consumer 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_OPERATION_FAILEDOperation failed
See also:
sticker_consumer_event_cb()
sticker_consumer_set_event_cb()