diff options
author | hyun lee <hyunn.lee@samsung.com> | 2014-11-13 11:28:14 +0900 |
---|---|---|
committer | hyun lee <hyunn.lee@samsung.com> | 2014-11-13 11:28:14 +0900 |
commit | 7cdc03b89a5a9a28b8bc4094e7c21e8b7e83fde4 (patch) | |
tree | 297e0f55d4b7896482aa1408f8cc0793f30505d3 /include | |
parent | c17dc905783b7ebe6043390fdfe29528380eb2ae (diff) | |
download | badge-7cdc03b89a5a9a28b8bc4094e7c21e8b7e83fde4.tar.gz badge-7cdc03b89a5a9a28b8bc4094e7c21e8b7e83fde4.tar.bz2 badge-7cdc03b89a5a9a28b8bc4094e7c21e8b7e83fde4.zip |
Merge from 2.3b
Change-Id: I345059b9ebd35f874c530cd74ba2b46b1af480f4
Signed-off-by: hyun lee <hyunn.lee@samsung.com>
Diffstat (limited to 'include')
-rwxr-xr-x | include/badge.h | 341 | ||||
-rwxr-xr-x | include/badge_db.h | 10 | ||||
-rwxr-xr-x | include/badge_error.h | 26 | ||||
-rwxr-xr-x | include/badge_internal.h | 84 | ||||
-rwxr-xr-x | include/badge_ipc.h | 20 | ||||
-rwxr-xr-x | include/badge_setting_service.h | 4 |
6 files changed, 335 insertions, 150 deletions
diff --git a/include/badge.h b/include/badge.h index 347dcad..0b742ea 100755 --- a/include/badge.h +++ b/include/badge.h @@ -32,73 +32,184 @@ extern "C" { /** * @file badge.h - * @brief This file contains the badge APIs + * @brief This file contains the badge APIs. */ /** - * @addtogroup BADGE_TYPE + * @addtogroup BADGE_MODULE * @{ */ + /** - * @brief Enumeration for Badge action + * @internal + * @brief Enumeration for Badge Action. + * @since_tizen 2.3 */ -enum _badge_action { - BADGE_ACTION_CREATE = 0, - BADGE_ACTION_REMOVE, - BADGE_ACTION_UPDATE, - BADGE_ACTION_CHANGED_DISPLAY, - BADGE_ACTION_SERVICE_READY, +enum badge_action { + BADGE_ACTION_CREATE = 0, /**< @internal Badge created */ + BADGE_ACTION_REMOVE, /**< @internal Badge removed */ + BADGE_ACTION_UPDATE, /**< @internal Badge updated */ + BADGE_ACTION_CHANGED_DISPLAY, /**< @internal The display option of the badge changed */ + BADGE_ACTION_SERVICE_READY, /**< @internal The badge service is ready */ }; /** - * @brief Called to retrieve the badge existed. - * @param[in] pkgname The name of package - * @param[in] count The count of badge - * @param[in] user_data The user data passed from the foreach function + * @internal + * @brief Called to retrieve the badge existence. + * @since_tizen 2.3 + * @param[in] app_id The name of the application + * @param[in] count The count of the badge + * @param[in] data The user data passed from the foreach function * @pre badge_foreach_existed() will invoke this callback. * @see badge_foreach_existed() */ -typedef void (*badge_cb)(const char *pkgname, unsigned int count, void *data); +typedef void (*badge_cb)(const char *app_id, unsigned int count, void *data); /** - * @brief Called when badge information is changed. - * @param[in] action The type of changing - * @param[in] pkgname The name of package - * @param[in] count The count of badge - * @param[in] user_data The user data passed from the callback register function + * @internal + * @brief Called when the badge information is changed. + * @since_tizen 2.3 + * @param[in] action The type of the change + * @param[in] app_id The name of the application + * @param[in] count The count of the badge + * @param[in] data The user data passed from the callback register function * @pre badge_register_changed_cb() will invoke this callback. * @see badge_unregister_changed_cb() */ -typedef void (*badge_change_cb)(unsigned int action, const char *pkgname, +typedef void (*badge_change_cb)(unsigned int action, const char *app_id, unsigned int count, void *data); /** - * @} + * @internal + * @brief Retrieves all existing badges. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] callback The callback function + * @param[in] data The user data to be passed to the callback function + * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_FROM_DB Error form DB + * @retval BADGE_ERROR_OUT_OF_MEMORY Out of memory + * @retval BADGE_ERROR_NOT_EXIST Not exist + * @see #badge_error_e + * @see badge_get_count() + * @see badge_is_existing() */ +int badge_foreach_existed(badge_cb callback, void *data); /** - * @addtogroup BADGE_MODULE - * @{ + * @internal + * @brief Registers a callback function to receive badge change event. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] callback The callback function + * @param[in] data The user data to be passed to the callback function + * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_OUT_OF_MEMORY Out of memory + * @see #badge_error_e + * @see badge_new() + * @see badge_remove() + * @see badge_set_count() + */ +int badge_register_changed_cb(badge_change_cb callback, void *data); + +/** + * @internal + * @brief Unregisters a callback function to receive badge change event. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] callback The callback function + * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_NOT_EXIST Not exist + * @see #badge_error_e + * @see badge_register_changed_cb() + */ +int badge_unregister_changed_cb(badge_change_cb callback); + +/** + * @internal + * @brief This function checks whether badge service is ready + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section. + * @return 1 if badge service is ready, other value if badge service isn't ready + * @exception BADGE_ERROR_NONE Success + * @exception BADGE_ERROR_SERVICE_NOT_READY Service is not ready + */ +int badge_is_service_ready(void); + +/** + * @internal + * @brief This function adds deferred task. the registered task will be executed when badge service become ready + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] badge_add_deferred_task The callback function + * @param[in] user_data The user data to be passed to the callback function + * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_OUT_OF_MEMORY Out of memory + * @see #badge_error_e + * @see badge_is_service_ready() */ +int badge_add_deferred_task( + void (*badge_add_deferred_task)(void *data), void *user_data); /** - * @brief This function creates badge for designated package. + * @internal + * @brief This function removes deferred task. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] badge_add_deferred_task The callback function + * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @see #badge_error_e + * @see badge_is_service_ready() + */ +int badge_del_deferred_task( + void (*badge_add_deferred_task)(void *data)); + +/** + * @brief Creates a badge for the application itself. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification * @details Creates new badge to display. - * @param[in] pkgname The name of designated package - * @param[in] writable_pkg The name of package which is authorized to change badge + * @param[in] writable_app_id The id of application which is authorized to change the badge * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_IO_ERROR Error from I/O + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready * @see #badge_error_e * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; - err = badge_create("org.tizen.sms", "org.tizen.sms2"); + err = badge_new(app_id); if(err != BADGE_ERROR_NONE) { return; } @@ -106,22 +217,30 @@ typedef void (*badge_change_cb)(unsigned int action, const char *pkgname, } * @endcode */ -badge_error_e badge_create(const char *pkgname, const char *writable_pkg); +int badge_new(const char *writable_app_id); /** - * @brief This function removes badge for designated package. - * @param[in] pkgname The name of designated package + * @brief Removes the badge for the designated application. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_IO_ERROR Error from I/O + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready * @see #badge_error_e * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; - err = badge_remove("org.tizen.sms"); + err = badge_remove(app_id); if(err != BADGE_ERROR_NONE) { return; } @@ -129,23 +248,31 @@ badge_error_e badge_create(const char *pkgname, const char *writable_pkg); } * @endcode */ -badge_error_e badge_remove(const char *pkgname); +int badge_remove(const char *app_id); /** - * @brief This function sets badge count for designated package. - * @param[in] pkgname The name of designated package - * @param[in] count The count of badge + * @brief Sets badge count for the designated application. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application + * @param[in] count The count of the badge * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_IO_ERROR Error from I/O + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready * @see #badge_error_e - * @see badge_create() + * @see badge_new() * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; - err = badge_set_count("org.tizen.sms", 1); + err = badge_set_count(app_id, 1); if(err != BADGE_ERROR_NONE) { return; } @@ -153,24 +280,34 @@ badge_error_e badge_remove(const char *pkgname); } * @endcode */ -badge_error_e badge_set_count(const char *pkgname, unsigned int count); +int badge_set_count(const char *app_id, unsigned int count); /** - * @brief This function gets badge count for designated package. - * @param[in] pkgname The name of designated package - * @param[out] count The count of badge + * @brief Gets badge count for the designated application. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application + * @param[out] count The count of the badge * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_FROM_DB Error from DB + * @retval BADGE_ERROR_ALREADY_EXIST Already exist + * @retval BADGE_ERROR_OUT_OF_MEMORY Out of memory * @see #badge_error_e - * @see badge_create() + * @see badge_new() * @see badge_set_count() * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; + int count = 0; - err = badge_get_count("org.tizen.sms", 1); + err = badge_get_count(app_id, &count); if(err != BADGE_ERROR_NONE) { return; } @@ -178,23 +315,31 @@ badge_error_e badge_set_count(const char *pkgname, unsigned int count); } * @endcode */ -badge_error_e badge_get_count(const char *pkgname, unsigned int *count); +int badge_get_count(const char *app_id, unsigned int *count); /** - * @brief This function sets displaying option for designated package. - * @param[in] pkgname The name of designated package - * @param[in] is_display The displaying option, 1 = display 0 = not display + * @brief Sets the display option for the designated application. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application + * @param[in] is_display The display option (1 = display, 0 = not display) * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_IO_ERROR Error from I/O + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready * @see #badge_error_e - * @see badge_create() + * @see badge_new() * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; - err = badge_set_display("org.tizen.sms", 1); + err = badge_set_display(app_id, 1); if(err != BADGE_ERROR_NONE) { return; } @@ -202,15 +347,25 @@ badge_error_e badge_get_count(const char *pkgname, unsigned int *count); } * @endcode */ -badge_error_e badge_set_display(const char *pkgname, unsigned int is_display); +int badge_set_display(const char *app_id, unsigned int is_display); /** - * @brief This function gets displaying option for designated package. - * @param[in] pkgname The name of designated package - * @param[out] is_display The displaying option, 1 = display 0 = not display + * @brief Gets the display option for the designated application. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application + * @param[out] is_display The display option (1 = display, 0 = not display) * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_FROM_DB Error from DB + * @retval BADGE_ERROR_NOT_EXIST Not exist + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready + * @retval BADGE_ERROR_OUT_OF_MEMORY Out of memory * @see #badge_error_e - * @see badge_create() + * @see badge_new() * @see badge_set_count() * @par Sample code: * @code @@ -218,9 +373,9 @@ badge_error_e badge_set_display(const char *pkgname, unsigned int is_display); ... { int is_display = 0; - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; - err = badge_get_display("org.tizen.sms", &is_display); + err = badge_get_display(app_id, &is_display); if(err != BADGE_ERROR_NONE) { return; } @@ -228,25 +383,35 @@ badge_error_e badge_set_display(const char *pkgname, unsigned int is_display); } * @endcode */ -badge_error_e badge_get_display(const char *pkgname, unsigned int *is_display); +int badge_get_display(const char *app_id, unsigned int *is_display); /** - * @brief This function tests badge for designated package is existed or not. - * @param[in] pkgname The name of designated package - * @param[out] existing The bool value of badge existing status + * @internal + * @brief Tests if the badge for the designated application exists or not. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @param[in] app_id The name of the designated application + * @param[out] existing The bool value of badge existence status * @return #BADGE_ERROR_NONE if success, other value if failure + * @retval BADGE_ERROR_NONE Success + * @retval BADGE_ERROR_INVALID_PARAMETER Invalid parameter + * @retval BADGE_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method + * @retval BADGE_ERROR_FROM_DB Error from DB + * @retval BADGE_ERROR_NOT_EXIST Not exist + * @retval BADGE_ERROR_SERVICE_NOT_READY Service is not ready * @see #badge_error_e - * @see badge_create() + * @see badge_new() * @see badge_remove() * @par Sample code: * @code #include <badge.h> ... { - badge_error_e err = BADGE_ERROR_NONE; + int err = BADGE_ERROR_NONE; bool exist; - err = badge_is_existing("org.tizen.sms", &exist); + err = badge_is_existing(app_id, &exist); if(err != BADGE_ERROR_NONE) { return; } @@ -254,52 +419,14 @@ badge_error_e badge_get_display(const char *pkgname, unsigned int *is_display); } * @endcode */ -badge_error_e badge_is_existing(const char *pkgname, bool *existing); - -/** - * @brief This function retrieves all badges which are existed. - * @param[in] callback The callback function - * @param[in] data The user data to be passed to the callback function - * @return #BADGE_ERROR_NONE if success, other value if failure - * @see #badge_error_e - * @see badge_get_count() - * @see badge_is_existing() - */ -badge_error_e badge_foreach_existed(badge_cb callback, void *data); +int badge_is_existing(const char *app_id, bool *existing); -/** - * @brief This function registers callback function to receive badge changed event. - * @param[in] callback The callback function - * @param[in] data The user data to be passed to the callback function - * @return #BADGE_ERROR_NONE if success, other value if failure - * @see #badge_error_e - * @see badge_create() - * @see badge_remove() - * @see badge_set_count() - */ -badge_error_e badge_register_changed_cb(badge_change_cb callback, void *data); -/** - * @brief This function unregisters callback function to receive badge changed event. - * @param[in] callback The callback function - * @return #BADGE_ERROR_NONE if success, other value if failure - * @see #badge_error_e - * @see badge_register_changed_cb() - */ -badge_error_e badge_unregister_changed_cb(badge_change_cb callback); /** * @} */ -int badge_is_service_ready(void); - -badge_error_e badge_add_deffered_task( - void (*deffered_task_cb)(void *data), void *user_data); - -badge_error_e badge_del_deffered_task( - void (*deffered_task_cb)(void *data)); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/include/badge_db.h b/include/badge_db.h index 1d490c5..75d6281 100755 --- a/include/badge_db.h +++ b/include/badge_db.h @@ -32,11 +32,11 @@ extern "C" { #endif -badge_error_e badge_db_insert(const char *pkgname, const char *writable_pkg, const char *caller); -badge_error_e badge_db_delete(const char *pkgname, const char *caller_pkg); -badge_error_e badge_db_set_count(const char *pkgname, const char *caller_pkg, int count); -badge_error_e badge_db_set_display_option(const char *pkgname, const char *caller_pkg, int is_display); -badge_error_e badge_db_exec(sqlite3 * db, const char *query, int *num_changes); +int badge_db_insert(const char *pkgname, const char *writable_pkg, const char *caller); +int badge_db_delete(const char *pkgname, const char *caller_pkg); +int badge_db_set_count(const char *pkgname, const char *caller_pkg, int count); +int badge_db_set_display_option(const char *pkgname, const char *caller_pkg, int is_display); +int badge_db_exec(sqlite3 * db, const char *query, int *num_changes); #ifdef __cplusplus } diff --git a/include/badge_error.h b/include/badge_error.h index 89d1abb..9fa5d98 100755 --- a/include/badge_error.h +++ b/include/badge_error.h @@ -24,6 +24,8 @@ #ifndef __BADGE_ERROR_DEF_H__ #define __BADGE_ERROR_DEF_H__ +#include <tizen.h> + #ifdef __cplusplus extern "C" { #endif @@ -34,24 +36,24 @@ extern "C" { */ /** - * @addtogroup BADGE_TYPE + * @addtogroup BADGE_MODULE * @{ */ /** - * @breief Enumeration for Badge error + * @brief Enumeration for Badge Error */ typedef enum _badge_error_e { - BADGE_ERROR_NONE = 0, /**< Success */ - BADGE_ERROR_INVALID_DATA = -1, /**< Invalid parameter */ - BADGE_ERROR_NO_MEMORY = -2, /**< No memory */ - BADGE_ERROR_FROM_DB = -3, /**< Error from DB */ - BADGE_ERROR_ALREADY_EXIST = -4, /**< Already exist */ - BADGE_ERROR_FROM_DBUS = -5, /**< Error from DBus */ - BADGE_ERROR_NOT_EXIST = -6, /**< Not exist */ - BADGE_ERROR_PERMISSION_DENIED = -7, /**< Permission denied */ - BADGE_ERROR_IO = -8, /**< Error from I/O */ - BADGE_ERROR_SERVICE_NOT_READY = -9, /**< Error service not ready */ + BADGE_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */ + BADGE_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */ + BADGE_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */ + BADGE_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */ + BADGE_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< Error from I/O */ + BADGE_ERROR_FROM_DB = TIZEN_ERROR_BADGE | 0x01, /**< Error from DB */ + BADGE_ERROR_ALREADY_EXIST = TIZEN_ERROR_BADGE | 0x02, /**< Already exist */ + BADGE_ERROR_FROM_DBUS = TIZEN_ERROR_BADGE | 0x03, /**< Error from DBus */ + BADGE_ERROR_NOT_EXIST = TIZEN_ERROR_BADGE | 0x04, /**< Not exist */ + BADGE_ERROR_SERVICE_NOT_READY = TIZEN_ERROR_BADGE | 0x05, /**< Error service not ready */ } badge_error_e; /** diff --git a/include/badge_internal.h b/include/badge_internal.h index d3b6681..62463d8 100755 --- a/include/badge_internal.h +++ b/include/badge_internal.h @@ -33,44 +33,100 @@ #define EXPORT_API __attribute__ ((visibility("default"))) #endif +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + typedef struct _badge_h badge_h; char *_badge_get_pkgname_by_pid(void); -badge_error_e _badge_is_existing(const char *pkgname, bool *existing); +int _badge_is_existing(const char *pkgname, bool *existing); -badge_error_e _badge_foreach_existed(badge_cb callback, void *data); +int _badge_foreach_existed(badge_cb callback, void *data); -badge_error_e _badge_insert(badge_h *badge); +int _badge_insert(badge_h *badge); -badge_error_e _badge_remove(const char *caller, const char *pkgname); +int _badge_remove(const char *caller, const char *pkgname); -badge_error_e _badget_set_count(const char *caller, const char *pkgname, +int _badget_set_count(const char *caller, const char *pkgname, unsigned int count); -badge_error_e _badget_get_count(const char *pkgname, unsigned int *count); +int _badget_get_count(const char *pkgname, unsigned int *count); -badge_error_e _badget_set_display(const char *pkgname, +int _badget_set_display(const char *pkgname, unsigned int is_display); -badge_error_e _badget_get_display(const char *pkgname, unsigned int *is_display); +int _badget_get_display(const char *pkgname, unsigned int *is_display); -badge_error_e _badge_register_changed_cb(badge_change_cb callback, void *data); +int _badge_register_changed_cb(badge_change_cb callback, void *data); -badge_error_e _badge_unregister_changed_cb(badge_change_cb callback); +int _badge_unregister_changed_cb(badge_change_cb callback); -badge_error_e _badge_free(badge_h *badge); +int _badge_free(badge_h *badge); badge_h *_badge_new(const char *pkgname, const char *writable_pkgs, - badge_error_e *err); + int *err); -char *_badge_pkgs_new(badge_error_e *err, const char *pkg1, ...); +char *_badge_pkgs_new(int *err, const char *pkg1, ...); -char *_badge_pkgs_new_valist(badge_error_e *err, +char *_badge_pkgs_new_valist(int *err, const char *pkg1, va_list args); void badge_changed_cb_call(unsigned int action, const char *pkgname, unsigned int count); +/** + * @internal + * @brief Creates a badge for the designated package. + * @since_tizen 2.3 + * @privlevel public + * @privilege %http://tizen.org/privilege/notification + * @details Creates new badge to display. + * @param[in] pkgname The name of the designated package + * @param[in] writable_pkg The name of package which is authorized to change the badge + * @return #BADGE_ERROR_NONE if success, other value if failure + * @see #badge_error_e + * @par Sample code: + * @code +#include <badge.h> +... +{ + int err = BADGE_ERROR_NONE; + + err = badge_create("org.tizen.sms", "org.tizen.sms2"); + if(err != BADGE_ERROR_NONE) { + return; + } + +} + * @endcode + */ +int badge_create(const char *pkgname, const char *writable_pkg); + +/** + * @brief This function sets badge property for designated package. + * @param[in] pkgname The name of designated package + * @param[in] property name + * @param[in] property value + * @return #BADGE_ERROR_NONE if success, other value if failure + * @see #badge_error_e + */ +int badge_setting_property_set(const char *pkgname, const char *property, const char *value); + +/** + * @brief This function gets badge property for designated package. + * @param[in] pkgname The name of designated package + * @param[in] property name + * @param[in] pointer which can save the getting value + * @return #BADGE_ERROR_NONE if success, other value if failure + * @see #badge_error_e + */ +int badge_setting_property_get(const char *pkgname, const char *property, char **value); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #endif /* __BADGE_INTERNAL_DEF_H__ */ diff --git a/include/badge_ipc.h b/include/badge_ipc.h index 3574402..2fc87a4 100755 --- a/include/badge_ipc.h +++ b/include/badge_ipc.h @@ -33,20 +33,20 @@ extern "C" { struct packet; -badge_error_e badge_ipc_monitor_init(void); -badge_error_e badge_ipc_monitor_fini(void); +int badge_ipc_monitor_init(void); +int badge_ipc_monitor_fini(void); -badge_error_e badge_ipc_request_insert(const char *pkgname, const char *writable_pkg, const char *caller); -badge_error_e badge_ipc_request_delete(const char *pkgname, const char *caller); -badge_error_e badge_ipc_request_set_count(const char *pkgname, const char *caller, int count); -badge_error_e badge_ipc_request_set_display(const char *pkgname, const char *caller, int display_option); +int badge_ipc_request_insert(const char *pkgname, const char *writable_pkg, const char *caller); +int badge_ipc_request_delete(const char *pkgname, const char *caller); +int badge_ipc_request_set_count(const char *pkgname, const char *caller, int count); +int badge_ipc_request_set_display(const char *pkgname, const char *caller, int display_option); int badge_ipc_is_master_ready(void); -badge_error_e badge_ipc_add_deffered_task(void (*deffered_task_cb)(void *data), void *user_data); -badge_error_e badge_ipc_del_deffered_task(void (*deffered_task_cb)(void *data)); +int badge_ipc_add_deferred_task(void (*badge_add_deferred_task)(void *data), void *user_data); +int badge_ipc_del_deferred_task(void (*badge_add_deferred_task)(void *data)); -badge_error_e badge_ipc_setting_property_set(const char *pkgname, const char *property, const char *value); -badge_error_e badge_ipc_setting_property_get(const char *pkgname, const char *property, char **value); +int badge_ipc_setting_property_set(const char *pkgname, const char *property, const char *value); +int badge_ipc_setting_property_get(const char *pkgname, const char *property, char **value); #ifdef __cplusplus } diff --git a/include/badge_setting_service.h b/include/badge_setting_service.h index 9b452a7..492af84 100755 --- a/include/badge_setting_service.h +++ b/include/badge_setting_service.h @@ -30,8 +30,8 @@ extern "C" { #endif -badge_error_e badge_setting_db_set(const char *pkgname, const char *property, const char *value); -badge_error_e badge_setting_db_get(const char *pkgname, const char *property, char **value); +int badge_setting_db_set(const char *pkgname, const char *property, const char *value); +int badge_setting_db_get(const char *pkgname, const char *property, char **value); #ifdef __cplusplus } |