X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=include%2Fsticker_provider.h;h=96907812659299ac67a4cdc6d9abe88723cd9cd8;hb=refs%2Fheads%2Faccepted%2Ftizen_8.0_unified;hp=8ab775818a9e976e6536cae8e6748b892cd73f1d;hpb=cbde5a86fe5975a7f7438daaf0e20bfad9875461;p=platform%2Fcore%2Fuifw%2Fcapi-ui-sticker.git diff --git a/include/sticker_provider.h b/include/sticker_provider.h index 8ab7758..9690781 100644 --- a/include/sticker_provider.h +++ b/include/sticker_provider.h @@ -97,8 +97,8 @@ int sticker_provider_destroy(sticker_provider_h provider_handle); /** * @brief Inserts a sticker data to the sticker database. * @since_tizen 5.5 - * @remarks All data except thumbnail and description 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. + * @remarks All data except thumbnail, description, and 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. * 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 @@ -107,21 +107,23 @@ int sticker_provider_destroy(sticker_provider_h provider_handle); * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed + * @retval #STICKER_ERROR_FILE_EXISTS File exists + * @retval #STICKER_ERROR_NO_SUCH_FILE No such file * @see sticker_provider_update_data() * @see sticker_provider_delete_data() */ 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 and description must be set in the json file to insert the sticker data. + * @remarks All data except thumbnail, description, and 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 @@ -133,7 +135,7 @@ int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_dat * @see sticker_provider_insert_finished_cb() * * @code - //json file format + //JSON file format { "sticker": [ @@ -143,7 +145,8 @@ int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_dat "keyword" : ["heart eyes", "love", "cute"], "group" : "face", "thumbnail" : "/res/face/thumbnail/heart_eyes.png", - "description" : "Smiling face with heart eyes emoji." + "description" : "Smiling face with heart eyes emoji.", + "display_type" : 1 }, { "type" : 2, @@ -151,7 +154,8 @@ int sticker_provider_insert_data(sticker_provider_h provider_handle, sticker_dat "keyword" : ["smile", "high five"], "group" : "face", "thumbnail" : "", - "description" : "Smiling face with high five emoji." + "description" : "Smiling face with high five emoji.", + "display_type" : null }, ..... { @@ -173,6 +177,8 @@ int sticker_provider_insert_data_by_json_file(sticker_provider_h provider_handle * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed + * @retval #STICKER_ERROR_FILE_EXISTS File exists + * @retval #STICKER_ERROR_NO_SUCH_FILE No such file * @see sticker_provider_insert_data() * @see sticker_provider_delete_data() */ @@ -195,6 +201,23 @@ int sticker_provider_update_data(sticker_provider_h provider_handle, sticker_dat int sticker_provider_delete_data(sticker_provider_h provider_handle, sticker_data_h data_handle); /** + * @brief Deletes a sticker 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 + * @return 0 on success, otherwise a negative error value + * @retval #STICKER_ERROR_NONE Successful + * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported + * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed + * @retval #STICKER_ERROR_NO_SUCH_FILE No such file + * @see sticker_provider_insert_data() + * @see sticker_provider_delete_data() + */ +int sticker_provider_delete_data_by_uri(sticker_provider_h provider_handle, const char *uri); + +/** * @brief Gets the count of stickers stored by the provider application. * @since_tizen 5.5 * @param[in] provider_handle The sticker provider handle @@ -230,6 +253,24 @@ int sticker_provider_get_sticker_count(sticker_provider_h provider_handle, int * int sticker_provider_data_foreach_all(sticker_provider_h provider_handle, int offset, int count, int *result, sticker_provider_data_foreach_cb callback, void *user_data); /** + * @brief Sets the image of the sticker group. + * @details @a uri must be a relative path like '/res/smile.png' when @a type is #STICKER_DATA_URI_LOCAL_PATH. + * @since_tizen 6.5 + * @param[in] provider_handle The sticker provider handle + * @param[in] group The group name for setting group image + * @param[in] type The URI type of the image file + * @param[in] uri The URI of the image file + * @return 0 on success, otherwise a negative error value + * @retval #STICKER_ERROR_NONE Successful + * @retval #STICKER_ERROR_NOT_SUPPORTED Not supported + * @retval #STICKER_ERROR_INVALID_PARAMETER Invalid parameter, e.g. @a group is @c NULL or the group name does not exist in the database + * @retval #STICKER_ERROR_OPERATION_FAILED Operation failed + * @retval #STICKER_ERROR_NO_SUCH_FILE No such file, e.g. @a uri is @c NULL or the specified file does not exist + * @see sticker_provider_insert_data() + */ +int sticker_provider_set_group_image(sticker_provider_h provider_handle, const char *group, sticker_data_uri_type_e type, const char *uri); + +/** * @} */