diff options
author | mk5004.lee <mk5004.lee@samsung.com> | 2018-04-06 11:33:29 +0900 |
---|---|---|
committer | mk5004.lee <mk5004.lee@samsung.com> | 2018-04-06 12:21:34 +0900 |
commit | 9e300c87ce8364c30eee3726643e207f5841f1a0 (patch) | |
tree | bfc24d2d9b0eacf77ba56e59227999d3a2a557f0 | |
parent | d8706aa25108295c99d273f46d7168acd24c8017 (diff) | |
download | shortcut-9e300c87ce8364c30eee3726643e207f5841f1a0.tar.gz shortcut-9e300c87ce8364c30eee3726643e207f5841f1a0.tar.bz2 shortcut-9e300c87ce8364c30eee3726643e207f5841f1a0.zip |
Update header files
Change-Id: I8934e4e2f280efabb4167bdc2f1767fa6d8288c4
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
-rwxr-xr-x | lib/include/shortcut.h | 9 | ||||
-rwxr-xr-x | lib/include/shortcut_internal.h | 4 | ||||
-rwxr-xr-x | lib/include/shortcut_manager.h | 82 | ||||
-rwxr-xr-x | lib/src/shortcut_manager.c | 16 |
4 files changed, 54 insertions, 57 deletions
diff --git a/lib/include/shortcut.h b/lib/include/shortcut.h index e83558d..b598224 100755 --- a/lib/include/shortcut.h +++ b/lib/include/shortcut.h @@ -44,11 +44,10 @@ extern "C" { * otherwise it returns an errno * @param[in] pid The process ID of who handle this add_to_home request * @param[in] data The callback data - * @return int @c 0 if there is no error, - * otherwise errno + * @return int @c 0 if there is no error, otherwise errno * @see add_to_home_shortcut() */ -typedef int (*result_internal_cb_t)(int ret, int pid, void *data); +typedef int (*result_internal_cb)(int ret, int pid, void *user_data); /** * @brief Enumeration for shortcut types. @@ -103,8 +102,8 @@ GQuark shortcut_error_quark(void); #define ADD_TO_HOME_IS_DYNAMICBOX(type) (!!((type) & 0x10000000)) /* DEPRECATED API */ -int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon, int allow_duplicate, result_internal_cb_t result_cb, void *data) __attribute__((deprecated)); -int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb_t result_cb, void *data) __attribute__((deprecated)); +int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content_info, const char *icon, int allow_duplicate, result_internal_cb result_cb, void *data) __attribute__((deprecated)); +int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb result_cb, void *data) __attribute__((deprecated)); /** * @} diff --git a/lib/include/shortcut_internal.h b/lib/include/shortcut_internal.h index c31fd9a..f40263c 100755 --- a/lib/include/shortcut_internal.h +++ b/lib/include/shortcut_internal.h @@ -38,8 +38,8 @@ extern "C" { */ struct result_cb_item { - result_internal_cb_t result_internal_cb; - result_cb_t result_cb; + result_internal_cb result_internal_cb; + result_cb result_cb; void *data; }; diff --git a/lib/include/shortcut_manager.h b/lib/include/shortcut_manager.h index 6d656fc..1840fa8 100755 --- a/lib/include/shortcut_manager.h +++ b/lib/include/shortcut_manager.h @@ -46,7 +46,6 @@ extern "C" { * @since_tizen 2.3 */ typedef enum _shortcut_type { - /**< Use these */ LAUNCH_BY_APP = 0x00000000, /**< Launch the application itself */ LAUNCH_BY_URI = 0x00000001, /**< Launch the application with the given data(URI) */ } shortcut_type; @@ -56,7 +55,7 @@ typedef enum _shortcut_type { * @since_tizen 2.4 */ typedef enum shortcut_widget_size { - WIDGET_SIZE_DEFAULT = 0x10000000, /* Type mask for the normal mode widget , don't use this value for specific size.*/ + WIDGET_SIZE_DEFAULT = 0x10000000, /**< Type mask for the normal mode widget , don't use this value for specific size.*/ WIDGET_SIZE_1x1 = 0x10010000, /**< 1x1 */ WIDGET_SIZE_2x1 = 0x10020000, /**< 2x1 */ WIDGET_SIZE_2x2 = 0x10040000, /**< 2x2 */ @@ -66,7 +65,7 @@ typedef enum shortcut_widget_size { WIDGET_SIZE_4x4 = 0x10400000, /**< 4x4 */ WIDGET_SIZE_4x5 = 0x11000000, /**< 4x5 */ WIDGET_SIZE_4x6 = 0x12000000, /**< 4x6 */ - WIDGET_SIZE_EASY_DEFAULT = 0x30000000, /* Type mask for the easy mode widget, don't use this value for specific size. */ + WIDGET_SIZE_EASY_DEFAULT = 0x30000000, /**< Type mask for the easy mode widget, don't use this value for specific size. */ WIDGET_SIZE_EASY_1x1 = 0x30010000, /**< Easy mode 1x1 */ WIDGET_SIZE_EASY_3x1 = 0x30020000, /**< Easy mode 3x2 */ WIDGET_SIZE_EASY_3x3 = 0x30040000, /**< Easy mode 3x3 */ @@ -78,30 +77,30 @@ typedef enum shortcut_widget_size { * @since_tizen 2.3 * @param[in] ret The result value, it could be @c 0 if it succeeds to add a shortcut, * otherwise it returns an errno - * @param[in] data The callback data + * @param[in] user_data The callback data * @return int @c 0 if there is no error, * otherwise errno * @see shortcut_add_to_home() */ -typedef int (*result_cb_t)(int ret, void *data); +typedef int (*result_cb)(int ret, void *user_data); /** * @brief Adds a shortcut to home, asynchronously. * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/shortcut * @remarks If a homescreen does not support this feature, you will get a proper error code.\n * Application must check the return value of this function.\n * Application must check the return status from the callback function.\n * Application should set the callback function to get the result of this request. - * @privlevel public - * @privilege %http://tizen.org/privilege/shortcut * @param[in] name The name of the created shortcut icon * @param[in] type The type of shortcuts * @param[in] uri The specific information for delivering to the viewer for creating a shortcut * @param[in] icon The absolute path of an icon file * @param[in] allow_duplicate @c 1 if it accepts the duplicated shortcut, * otherwise @c 0 - * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer + * @param[in] cb The address of the callback function that is called when the result comes back from the viewer * @param[in] data The callback data that is used in the callback function * @return @c 0 on success, * otherwise a negative error value @@ -118,12 +117,12 @@ typedef int (*result_cb_t)(int ret, void *data); * @retval #SHORTCUT_ERROR_COMM Connection not established or communication problem * @pre You have to prepare the callback function. * @post You have to check the return status from the callback function which is passed by the argument. - * @see result_cb_t + * @see result_cb * @par Example * @code #include <stdio.h> #include <shortcut_manager.h> -static int result_cb(int ret, int pid, void *data) +static int _result_cb(int ret, int pid, void *data) { if (ret < 0) dlog_print("Failed to add a shortcut: %s\n", perror(ret)); @@ -141,25 +140,25 @@ static int app_create(void *data) strncat(path, data_path, path_len); strncat(path, "Friend.jpg", path_len); - shortcut_add_to_home("With friends", LAUNCH_BY_URI, "gallery:0000-0000", path, 0, result_cb, NULL); + shortcut_add_to_home("With friends", LAUNCH_BY_URI, "gallery:0000-0000", path, 0, _result_cb, NULL); free(path); return 0; } * @endcode */ -int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb_t result_cb, void *data); +int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, const char *icon, int allow_duplicate, result_cb cb, void *data); /** * @brief Adds a widget to home, asynchronously. * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/shortcut * @remarks If a homescreen does not support this feature, you will get a proper error code.\n * Application must check the return value of this function.\n * Application must check the return status from the callback function.\n * Application should set the callback function to get the result of this request. - * @privlevel public - * @privilege %http://tizen.org/privilege/shortcut * @param[in] name The name of the created widget which will be shown when the widget is not prepared * @param[in] size The size of widget * @param[in] widget_id Widget ID @@ -167,7 +166,7 @@ int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, * @param[in] period The Update period in seconds * @param[in] allow_duplicate @c 1 if it accepts the duplicated widget, * otherwise @c 0 - * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer + * @param[in] cb The address of the callback function that is called when the result comes back from the viewer * @param[in] data The callback data that is used in the callback function * @return @c 0 on success, * otherwise a negative error value @@ -181,7 +180,7 @@ int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, * @retval #SHORTCUT_ERROR_COMM Connection not established or communication problem * @pre You have to prepare the callback function. * @post You have to check the return status from the callback function which is passed by the argument. - * @see result_cb_t + * @see result_cb * @see shortcut_widget_size_e * @par Example * @code @@ -190,7 +189,7 @@ int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, #include <storage.h> #define TIZEN_PATH_MAX 1024 -static int result_cb(int ret, int pid, void *data) +static int _result_cb(int ret, int pid, void *data) { if (ret < 0) dlog_print("Failed to add a widget: %s\n", perror(ret)); @@ -209,13 +208,13 @@ static int app_create(void *data) snprintf(image_path, TIZEN_PATH_MAX, "%s/alter_icon.png", image_root); shortcut_add_to_home_widget("alter_name", WIDGET_SIZE_1x1, "org.tizen.testwidget", - image_path, -1.0f, 0, result_cb, NULL); + image_path, -1.0f, 0, _result_cb, NULL); return 0; } * @endcode */ -int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, const char *widget_id, const char *icon, double period, int allow_duplicate, result_cb_t result_cb, void *data); +int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, const char *widget_id, const char *icon, double period, int allow_duplicate, result_cb cb, void *data); /** @@ -225,7 +224,7 @@ int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, c * @privlevel public * @privilege %http://tizen.org/privilege/shortcut * @param[in] name The name of the created shortcut icon - * @param[in] result_cb The address of the callback function that is called when the result comes back from the viewer + * @param[in] cb The address of the callback function that is called when the result comes back from the viewer * @param[in] user_data The callback data that is used in the callback function * @return 0 on success, otherwise a negative error value * @retval #SHORTCUT_ERROR_NONE Successful @@ -237,12 +236,12 @@ int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, c * @retval #SHORTCUT_ERROR_NOT_SUPPORTED Not supported * @pre You have to prepare the callback function. * @post You have to check the return status from the callback function which is passed by the argument. - * @see result_cb_t + * @see result_cb * @par Example * @code #include <shortcut_manager.h> -int result_cb(int ret, void *data) +int _result_cb(int ret, void *data) { if (ret < 0) dlog_print("Failed to remove a shortcut: %d\n", ret); @@ -253,7 +252,7 @@ int result_cb(int ret, void *data) { int result; - result = shortcut_remove_from_home("shortcut_name", result_cb, NULL); + result = shortcut_remove_from_home("shortcut_name", _result_cb, NULL); if (result != SHORTCUT_ERROR_NONE) { dlog_print("Failed to remove a shortcut: %d\n", result); return result; @@ -262,7 +261,7 @@ int result_cb(int ret, void *data) * @endcode */ -int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void *user_data); +int shortcut_remove_from_home(const char *name, result_cb cb, void *user_data); /** @@ -283,12 +282,12 @@ typedef int (*shortcut_list_cb)(const char *package_name, const char *icon, cons /** * @brief Gets the preset list of shortcut template from the installed package, synchronously. * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/shortcut * @remarks If a homescreen does not support this feature, you will get a proper error code.\n * Application must check the return value of this function.\n * Application must check the return status from the callback function.\n * Application should set the callback function to get the result of this request. - * @privlevel public - * @privilege %http://tizen.org/privilege/shortcut * @param[in] package_name The package name * @param[in] list_cb The callback function to get the shortcut item information * @param[in] data The callback data that is used in the callback function @@ -319,15 +318,16 @@ int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, void * * @param[in] content_info The specific information for creating a new shortcut * @param[in] icon The absolute path of an icon file for this shortcut * @param[in] pid The process ID of who request add_to_home + * @param[in] period The Update period in seconds * @param[in] allow_duplicate @c 1 if the shortcut can be duplicated, * otherwise a shourtcut should exist only once - * @param[in] data The callback data + * @param[in] user_data The callback data * @return The result of handling a shortcut creation request\n * This returns @c 0 if the add_to_home request is handled successfully, * otherwise it returns a proper errno * @see shortcut_set_request_cb() */ -typedef int (*shortcut_request_cb)(const char *package_name, const char *name, int type, const char *content_info, const char *icon, int pid, double period, int allow_duplicate, void *data); +typedef int (*shortcut_request_cb)(const char *package_name, const char *name, int type, const char *content_info, const char *icon, int pid, double period, int allow_duplicate, void *user_data); /** @@ -346,18 +346,16 @@ typedef int (*shortcut_remove_cb)(const char *package_name, const char *name, in /** - * @brief Registers a callback function to listen requests from applications. + * @brief Sets a callback function to listen requests from applications. * @since_tizen 2.4 + * @privlevel public + * @privilege %http://tizen.org/privilege/shortcut * @remarks Should be used in the homescreen.\n * Should check the return value of this function. * Prospective Clients: Homescreen. - * @privlevel public - * @privilege %http://tizen.org/privilege/shortcut - * * @param[in] request_cb The callback function pointer that is invoked when add_to_home is requested * @param[in] data The callback data to deliver to the callback function - * @return @c 0 on success, - * otherwise a negative error value + * @return @c 0 on success, otherwise a negative error value * @retval #SHORTCUT_ERROR_NONE Successful * @retval #SHORTCUT_ERROR_INVALID_PARAMETER Invalid function parameter * @retval #SHORTCUT_ERROR_OUT_OF_MEMORY Out of memory @@ -374,11 +372,11 @@ int shortcut_set_request_cb(shortcut_request_cb request_cb, void *data); /** - * @brief Unregisters a callback for the shortcut request. + * @brief Unsets a callback for the shortcut request. * @since_tizen 3.0 - * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section. * @privlevel public * @privilege %http://tizen.org/privilege/shortcut + * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section. * @return None * @exception #SHORTCUT_ERROR_NONE Successful * @exception #SHORTCUT_ERROR_NOT_SUPPORTED Not supported @@ -390,13 +388,13 @@ void shortcut_unset_request_cb(void); /** - * @brief Registers the callback function to listen the remove requests from applications. - * @remarks Should be used in the homescreen.\n - * Should check the return value of this function. - * Prospective Clients: Homescreen. + * @brief Sets the callback function to listen the remove requests from applications. * @since_tizen 3.0 * @privlevel public * @privilege %http://tizen.org/privilege/shortcut + * @remarks Should be used in the homescreen.\n + * Should check the return value of this function. + * Prospective Clients: Homescreen. * @param[in] remove_cb The callback function pointer that is invoked when remove_from_home is requested * @param[in] data The callback data to deliver to the callback function * @return 0 on success, otherwise a negative error value @@ -416,11 +414,11 @@ int shortcut_set_remove_cb(shortcut_remove_cb remove_cb, void *data); /** - * @brief Unregisters a callback for the shortcut remove. + * @brief Unsets a callback for the shortcut remove. * @since_tizen 3.0 - * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section. * @privlevel public * @privilege %http://tizen.org/privilege/shortcut + * @remarks The specific error code can be obtained using the gat_last_result() method. Error codes are described in Exception section. * @return None * @exception #SHORTCUT_ERROR_NONE Successful * @exception #SHORTCUT_ERROR_NOT_SUPPORTED Not supported diff --git a/lib/src/shortcut_manager.c b/lib/src/shortcut_manager.c index 390925f..e069d6a 100755 --- a/lib/src/shortcut_manager.c +++ b/lib/src/shortcut_manager.c @@ -155,7 +155,7 @@ static char *_make_request_id() } EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char *uri, - const char *icon, int allow_duplicate, result_cb_t result_cb, void *data) + const char *icon, int allow_duplicate, result_cb cb, void *data) { struct result_cb_item *item; char *appid; @@ -203,7 +203,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char * /* LCOV_EXCL_STOP */ } - item->result_cb = result_cb; + item->result_cb = cb; item->result_internal_cb = NULL; item->data = data; @@ -238,7 +238,7 @@ EAPI int shortcut_add_to_home(const char *name, shortcut_type type, const char * } EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e size, const char *widget_id, - const char *icon, double period, int allow_duplicate, result_cb_t result_cb, void *data) + const char *icon, double period, int allow_duplicate, result_cb cb, void *data) { struct result_cb_item *item; char *appid; @@ -291,7 +291,7 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si /* LCOV_EXCL_STOP */ } - item->result_cb = result_cb; + item->result_cb = cb; item->result_internal_cb = NULL; item->data = data; @@ -316,7 +316,7 @@ EAPI int shortcut_add_to_home_widget(const char *name, shortcut_widget_size_e si return ret; } -EAPI int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void *user_data) +EAPI int shortcut_remove_from_home(const char *name, result_cb cb, void *user_data) { struct result_cb_item *item; char *appid; @@ -362,7 +362,7 @@ EAPI int shortcut_remove_from_home(const char *name, result_cb_t result_cb, void /* LCOV_EXCL_STOP */ } - item->result_cb = result_cb; + item->result_cb = cb; item->result_internal_cb = NULL; item->data = user_data; @@ -441,7 +441,7 @@ EAPI int shortcut_get_list(const char *package_name, shortcut_list_cb list_cb, v /* LCOV_EXCL_START */ EAPI int add_to_home_shortcut(const char *appid, const char *name, int type, const char *content, - const char *icon, int allow_duplicate, result_internal_cb_t result_cb, void *data) + const char *icon, int allow_duplicate, result_internal_cb result_cb, void *data) { CHECK_SHORTCUT_FEATURE(); /*Deprecated API */ @@ -450,7 +450,7 @@ EAPI int add_to_home_shortcut(const char *appid, const char *name, int type, con /* LCOV_EXCL_STOP */ /* LCOV_EXCL_START */ -EAPI int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb_t result_cb, void *data) +EAPI int add_to_home_dynamicbox(const char *appid, const char *name, int type, const char *content, const char *icon, double period, int allow_duplicate, result_internal_cb result_cb, void *data) { CHECK_SHORTCUT_FEATURE(); /*Deprecated API */ |