int ret;
- if (!consumer_handle || !data_handle || (data_handle->sticker_info_id > 0) || !data_handle->uri)
+ if (!consumer_handle || !data_handle || (data_handle->sticker_info_id <= 0) || !data_handle->uri)
return STICKER_ERROR_INVALID_PARAMETER;
ret = sticker_dbus_insert_recent_sticker_info(consumer_handle->gdbus_connection, data_handle->sticker_info_id);
return ret;
}
-EXPORT_API int sticker_consumer_set_event_callback(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data)
+EXPORT_API int sticker_consumer_set_event_cb(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data)
{
CHECK_STICKER_FEATURE();
return STICKER_ERROR_NONE;
}
-EXPORT_API int sticker_consumer_unset_event_callback(sticker_consumer_h consumer_handle)
+EXPORT_API int sticker_consumer_unset_event_cb(sticker_consumer_h consumer_handle)
{
CHECK_STICKER_FEATURE();
*
* @section CAPI_UIX_STICKER_MODULE_OVERVIEW Overview
* Using sticker library, a sticker application can provide sticker information to applications that want to read the sticker information as the standard specification.
+ * A <a href="https://en.wikipedia.org/wiki/Sticker_(messaging)">sticker</a> is an image (possibly animated) that is used in an IM conversation.
+ * The Sticker API covers the exchange of sticker data between applications. How the images are used depends on a particular sticker consumer application.
*
* @section CAPI_UIX_STICKER_MODULE_FEATURE Related Feature
* This API is related with the following feature:\n
* @since_tizen 5.5
*/
typedef enum {
- STICKER_CONSUMER_EVENT_TYPE_INSERT, /**< Insert event type */
- STICKER_CONSUMER_EVENT_TYPE_DELETE, /**< Delete event type */
- STICKER_CONSUMER_EVENT_TYPE_UPDATE, /**< Update event type */
+ 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 */
} sticker_consumer_event_type_e;
/**
* @since_tizen 5.5
* @remarks @a 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 @a event_type is STICKER_CONSUMER_EVENT_TYPE_DELETE, sticker data can be obtained using @a data_handle,
- * but unable to access file because it has been deleted.
- * @param[in] event_type The event type of sticker
+ * When the @a event_type is #STICKER_CONSUMER_EVENT_TYPE_DELETE, sticker data can be obtained using @a data_handle,
+ * but the files have been already deleted.
+ * @param[in] event_type The event type
* @param[in] data_handle The sticker data handle
- * @param[in] user_data The user data passed from sticker_consumer_set_event_callback()
- * @pre The callback can be registered using sticker_consumer_set_event_callback()
- * @see sticker_consumer_set_event_callback()
- * @see sticker_consumer_unset_event_callback()
+ * @param[in] user_data The user data passed from sticker_consumer_set_event_cb()
+ * @pre The callback can be registered using sticker_consumer_set_event_cb()
+ * @see sticker_consumer_set_event_cb()
+ * @see sticker_consumer_unset_event_cb()
*/
typedef void (*sticker_consumer_event_cb)(sticker_consumer_event_type_e event_type, sticker_data_h data_handle, void *user_data);
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);
/**
- * @brief Retrieves all group name in the sticker database using display type.
+ * @brief Retrieves all group names assigned to stickers with a matching display @a type.
* @since_tizen 5.5
* @param[in] consumer_handle The sticker consumer handle
* @param[in] type The display type of the sticker for getting sticker data
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);
/**
- * @brief Add history to recently used stickers list
+ * @brief Adds entry to recently used stickers list.
* @since_tizen 5.5
* @param[in] consumer_handle The sticker consumer handle
* @param[in] data_handle The sticker data handle
* @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
* @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
- * @see sticker_consumer_get_recent_list()
+ * @see sticker_consumer_get_recent_data_list()
*/
int sticker_consumer_add_recent_data(sticker_consumer_h consumer_handle, sticker_data_h data_handle);
* @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
* @see sticker_consumer_event_cb()
- * @see sticker_consumer_unset_event_callback()
+ * @see sticker_consumer_unset_event_cb()
*/
-int sticker_consumer_set_event_callback(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data);
+int sticker_consumer_set_event_cb(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data);
/**
* @brief Unregisters a callback function.
* @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #STICKER_ERROR_OPERATION_FAILED Operation failed
* @see sticker_consumer_event_cb()
- * @see sticker_consumer_set_event_callback()
+ * @see sticker_consumer_set_event_cb()
*/
-int sticker_consumer_unset_event_callback(sticker_consumer_h consumer_handle);
+int sticker_consumer_unset_event_cb(sticker_consumer_h consumer_handle);
/**
* @}
*/
typedef enum {
STICKER_DATA_DISP_EMOJI = 1, /**< Emoji type */
- STICKER_DATA_DISP_WALLPAPER, /**< Wallpaper type */
+ /**
+ * @brief Wallpaper type
+ * @details The stickers of the wallpaper type are intended to be used by
+ * a wallpaper application and usually have larger size.
+ */
+ STICKER_DATA_DISP_WALLPAPER,
} sticker_data_display_type_e;
/**
* @retval #STICKER_ERROR_NONE Successful
* @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
* @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
- * @see sticker_data_get_group()
+ * @see sticker_data_get_group_name()
*/
int sticker_data_set_group_name(sticker_data_h data_handle, const char *group);
* @retval #STICKER_ERROR_NOT_SUPPORTED Not supported
* @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #STICKER_ERROR_NO_DATA No data available
- * @see sticker_data_set_group()
+ * @see sticker_data_set_group_name()
*/
int sticker_data_get_group_name(sticker_data_h data_handle, char **group);
* @brief Inserts a sticker data to the sticker database.
* @since_tizen 5.5
* @remarks All data except thumbnail, description, display_type must be set in the @a data_handle to insert the sticker data.
- * If the uri type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory.
+ * If the URI type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory.
* It is recommended to delete your sticker file after inserting a sticker data.
* @param[in] provider_handle The sticker provider handle
* @param[in] data_handle The sticker data handle to be saved
int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_data_h data_handle);
/**
- * @brief Inserts a sticker data using json file.
+ * @brief Inserts a sticker data using JSON file.
* @details @a json_path must be a relative path like '/data/message_sticker.json'.
* @since_tizen 5.5
- * @remarks All data except thumbnail, description, display_type must be set in the json file to insert the sticker data.
+ * @remarks All data except thumbnail, description, display_type must be set in the JSON file to insert the sticker data.
* @a json_path must have a non-null value and must be an existing file. If not, the error as invalid parameter will be returned.
- * If the uri type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory.
+ * If the URI type is #STICKER_DATA_URI_LOCAL_PATH, the sticker file is copied to a sticker directory.
* It is recommended to delete your sticker files after inserting a sticker data.
* @param[in] provider_handle The sticker provider handle
- * @param[in] json_path The path of json file containing sticker information to be saved
+ * @param[in] json_path The path of JSON file containing sticker information to be saved
* @param[in] callback The callback function to invoke
* @param[in] user_data The user data to be passed to the callback function
* @return 0 on success, otherwise a negative error value
* @see sticker_provider_insert_finished_cb()
*
* @code
- //json file format
+ //JSON file format
{
"sticker":
[
int sticker_provider_delete_data(sticker_provider_h provider_handle, sticker_data_h data_handle);
/**
- * @brief Deletes a sticker data in the sticker database using URI.
+ * @brief Deletes a sticker data with the given @a uri from the sticker database.
+ * @details If the database does not have a sticker that matches the given @a uri, the STICKER_ERROR_NO_SUCH_FILE error is returned.
* @since_tizen 5.5
* @param[in] provider_handle The sticker provider handle
* @param[in] uri The URI of the sticker data to be deleted
Name: capi-ui-sticker
Summary: Sticker client library and daemon
-Version: 0.1.35
+Version: 0.1.40
Release: 1
Group: Graphics & UI Framework/Input
License: Apache-2.0
#define ACCESSORY_SERVICE_CHANNEL_ID 107
#define SYNC_INTERVAL 12*60*60
+#define MAX_WAIT_TIME 48*60*60
#define REMOTE_APP_ID "com.samsung.w-input-selector"
#define MESSAGE_PORT_REMOTE_NAME REMOTE_APP_ID"_msg_port_rcv"
bool request_sticker_data(const char *mode, const char *category, const char *type);
void request_sticker_feature();
void send_disconnect_message();
+void request_show_sync_notification();
bool get_job_progress();
#define STICKER_SYNC_FEATURE_REQ "sticker-sync-feature-req"
#define STICKER_SYNC_FEATURE_RSP "sticker-sync-feature-rsp"
#define STICKER_REQUEST_SYNC_REQ "sticker-request-sync-req"
+#define STICKER_REQUEST_NOTI_REQ "sticker-request-noti-req"
#define STICKER_SYNC_START_REQ "sticker-sync-start-req"
#define STICKER_SYNC_START_RSP "sticker-sync-start-rsp"
#define STICKER_SEND_START_REQ "sticker-send-start-req"
char thumb_path[PATH_MAX];
char *data_path = NULL;
data_path = app_get_shared_data_path();
- sprintf(thumb_path, "%s/thumbnail/%s", data_path, incoming_file_name.c_str());
+ snprintf(thumb_path, sizeof(thumb_path), "%s/thumbnail/%s", data_path, incoming_file_name.c_str());
sticker_data.thumbnail_path = string(thumb_path);
if (data_path)
data_path = app_get_shared_data_path();
LOGI("Path : %s", data_path);
- sprintf(file_path, "%s/%s", data_path, incoming_file_name.c_str());
+ snprintf(file_path, sizeof(file_path), "%s/%s", data_path, incoming_file_name.c_str());
LOGI("Receive filepath : %s", file_path);
sticker_data.file_path = string(file_path);
char thumb_path[PATH_MAX];
char *data_path = NULL;
data_path = app_get_shared_data_path();
- sprintf(thumb_path, "%s/thumbnail", data_path);
+ snprintf(thumb_path, sizeof(thumb_path), "%s/thumbnail", data_path);
if (data_path)
free(data_path);
json_object_unref(j_object);
}
+void request_show_sync_notification()
+{
+ JsonObject *j_object = NULL;
+ j_object = json_object_new();
+ if (j_object == NULL) {
+ LOGE("json object create error");
+ return;
+ }
+
+ json_object_set_string_member(j_object, "msgId", STICKER_REQUEST_NOTI_REQ);
+ json_object_set_int_member(j_object, "tID", ++t_id);
+
+ if (_send_json_data(j_object) == FALSE) {
+ LOGE("Failed to send STICKER_REQUEST_NOTI_REQ");
+ }
+
+ json_object_unref(j_object);
+}
+
void reject_file()
{
int ret = sap_file_transfer_reject(priv_data.file_socket);
json_msgid = json_object_get_string_member(root_obj, "msgId");
msg_id = string(json_msgid ? json_msgid : "");
if (msg_id == STICKER_REQUEST_SYNC_REQ) {
- request_all_sticker_data("auto", "input");
+ request_all_sticker_data("manual", "input");
} else if (msg_id == STICKER_SYNC_FEATURE_RSP) {
LOGD("msg : %s", msg_id.c_str());
#ifdef VCONFKEY_STICKER_SUPPORTED_FEATURE
// compare time
LOGD("current time : %f, last_sync_time : %f", ecore_time_get(), last_sync_time);
- if (ecore_time_get() - last_sync_time > SYNC_INTERVAL)
- result = true;
- else
+
+ if (ecore_time_get() - last_sync_time > MAX_WAIT_TIME) {
+ request_show_sync_notification();
result = false;
+ } else {
+ if (ecore_time_get() - last_sync_time > SYNC_INTERVAL)
+ result = true;
+ else
+ result = false;
+ }
}
else
{
<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.5" package="org.tizen.sticker-receiver" version="1.0.35">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.5" package="org.tizen.sticker-receiver" version="1.0.40">
<profile name="wearable" />
<service-application appid="org.tizen.sticker-receiver" exec="sticker-receiver" type="capp" multiple="false" taskmanage="false" nodisplay="true" launch_mode="single">
<label>sticker-receiver</label>
goto free_memory;
char *rel_thumbnail = __get_string_from_object(info_object, "thumbnail");
- if (rel_thumbnail && rel_thumbnail[0] != '\0') {
- thumbnail_path = __convert_sticker_uri(rel_thumbnail, appid, app_path);
+ if (rel_thumbnail) {
+ if (rel_thumbnail[0] != '\0')
+ thumbnail_path = __convert_sticker_uri(rel_thumbnail, appid, app_path);
+
free(rel_thumbnail);
}