dbus-1
dbus-glib-1
com-core
+ capi-appfw-application
ecore
eina
libtzplatform-config
/**
* @brief Set absolute path for image file to display on notification view
- * @details
+ * @details
* @remarks
* @param[in] noti notification handle
* @param[in] type notification image type
* @param[in] image_path image file full path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre Notification handle should be created by notification_new()
* @post
* @see #notification_image_type_e
/**
* @brief Get absolute path for image file
- * @details
+ * @details
* @remarks Do not free image_path. It will be freed when notification_free() or notification_free_list().
* @param[in] noti notification handle
* @param[in] type notification image type
* @param[out] image_path image file full path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre Notification handle should be created by notification_new()
* @post
* @see #notification_image_type_e
{
char *image_path = NULL;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
-
+
noti_err = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
if(noti_err != NOTIFICATION_ERROR_NONE) {
return;
* @param[in] input_time input time
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre Notification handle should be created by notification_new()
* @post
* @see notification_new()
{
notification_h noti = NULL;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
-
+
noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
if(noti == NULL) {
return;
}
-
+
noti_err = notification_set_time(noti, time(NULL));
if(noti_err != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
* @param[out] ret_time return time value
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre Notification handle should be created by notification_new()
* @post
* @see notification_new()
{
time_t ret_time;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
-
+
noti_err = notification_get_time(noti, &ret_time);
if(noti_err != NOTIFICATION_ERROR_NONE) {
return;
* @param[out] ret_time return time value
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
- * @pre
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
+ * @pre
* @post
- * @see
+ * @see
* @par Sample code:
* @code
#include <notification.h>
{
time_t ret_time;
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
-
+
noti_err = notification_get_insert_time(noti, &ret_time);
if(noti_err != NOTIFICATION_ERROR_NONE) {
return;
* @param[in] args_type variable parameter that type - value pair.
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre notification handle should be created by notification_new().
* @post
* @see
* @param[out] text text
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[in] time time stamp
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre notification handle should be created by notification_new().
* @post
* @see
* @param[in] time pointer of time stamp
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre notification handle should be created by notification_new().
* @post
* @see
* @param[in] dir text dir
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] dir locale dir
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[in] path user sound file path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] path user sound file path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[in] path user vibration file path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] path user vibration file path
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
- * @see
+ * @see
* @par Sample code:
* @code
#include <notification.h>
* @param[in] led_argb notification led color
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] led_argb notification led color
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[in] off_ms time for turning on the LED
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] off_ms time for turning on the LED
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
int *on_ms, int *off_ms);
/**
+ * @brief Sets the launch option for a notification.
+ * @details When notification data selected in display application, application launched by app_control_send_launch_request with app_control handle.
+ * @since_tizen 2.3
+ * @param[in] noti The notification handle
+ * @param[in] type Launching option type
+ * @param[in] option App Control handler
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ app_control_h app_control = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ ...
+
+ app_control_create(&app_control);
+ app_control_set_app_id(app_control, "org.tizen.app");
+
+ ...
+
+ noti_err = notification_set_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)app_control);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+
+ app_control_destroy(app_control);
+}
+ * @endcode
+ */
+int notification_set_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option);
+
+/**
+ * @brief Gets the launch option from the notification handle.
+ * @since_tizen 2.3
+ * @remarks You must release @a app_control using app_control_destroy().
+ * @param[in] noti The notification handle
+ * @param[in] type Launching option type
+ * @param[out] option The pointer of App Control handler
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ app_control_h app_control = NULL;
+ app_control_create(&app_control);
+
+ ...
+
+ noti_err = notification_get_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)&app_control);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option);
+
+/**
* @brief Set execution option for a notification
* @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
* @remarks
* @param[in] service_handle appsvc bundle data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[out] service_handle appsvc bundle data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
* @pre
* @post
* @see
* @param[in] flags property with | operation
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[out] flags notification property
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] applist with | operation
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[out] applist display application list.
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] size double type size.
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[out] size progress size
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] percentage progress percentage
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[out] percentage progress percentage
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] pkgname caller package name
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[out] pkgname caller package name
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] type of layout
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see #notification_ly_type_e
* @param[out] type of layout
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see #notification_ly_type_e
* @param[out] priv_id Private ID
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
- * @pre
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
+ * @pre
* @post
- * @see
+ * @see
* @par Sample code:
* @code
#include <notification.h>
{
notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
int group_id, priv_id;
-
+
noti_err = notification_get_id(noti, &group_id, &priv_id);
if(noti_err != NOTIFICATION_ERROR_NONE) {
return;
* @param[out] type notification type
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
- * @pre
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
+ * @pre
* @post
- * @see
+ * @see
* @par Sample code:
* @code
#include <notification.h>
* @param[out] priv_id private ID
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre notification_new()
* @post notification_free()
* @see #notification_h
* @param[in] noti notification handle that is created by notification_new().
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
* @pre
* @post
* @param[in] user_data user data which you want to use in callback
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
* @pre
* @post
* @param[in] type notification type
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see #notification_type_e
* @param[in] type notification type
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] priv_id priv ID
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see
* @param[in] noti notification handle
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @see #notification_h
* @param[in] progress % value of progressive data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @par Sample code:
* @param[in] size bytes of progressive data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @par Sample code:
* @param[in] content text to update
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
* @pre
* @post
* @par Sample code:
* @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
* #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
* #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
- * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
+ * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
* notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
* If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
* Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
* @param[out] clone newly created notification handle that has same with input noti.
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see #notification_type_e
* @param[in] noti notification handle
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre notification_new()
* @post
* @see #notification_h
* @param[out] NOTIFICATION_ERROR_NONE if success, other value if failure.
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see #notification_list_h
* @param[out] list notification list handle
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see #notification_list_h
* @param[in] list notification list handle
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre notification_get_grouping_list() or notification_get_detail_list ()
* @post
* @see #notification_list_h
* @param[in] user_data user data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre notification_new()
* @post
* @see notification_unresister_changed_cb()
* @param[in] changed_cb callback function
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see notification_resister_changed_cb()
* @param[in] user_data user data
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see notification_unregister_detailed_changed_cb()
* @param[in] changed_cb callback function
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre
* @post
* @see notification_register_detailed_changed_cb()
void *user_data);
/**
+ * @brief Sets the tag of the notification handle.
+ * @since_tizen 2.3
+ * @param[in] noti Notification handle
+ * @param[in] tag tag for loading notification handle
+ * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see notification_get_tag()
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if(noti == NULL) {
+ return;
+ }
+ ...
+
+ noti_err = notification_set_tag(noti, tag);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_set_tag(notification_h noti, const char *tag);
+
+/**
+ * @brief Gets the tag of the notification handle.
+ * @since_tizen 2.3
+ * @param[in] noti Notification handle
+ * @param[out] tag tag for loading notification handle
+ * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see notification_set_tag()
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ const char *tag = NULL;
+
+ ...
+
+ noti_err = notification_get_tag(noti, &tag);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_tag(notification_h noti, const char **tag);
+
+/**
+ * @brief Loads a notification from the notification's database with the tag.
+ * @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.
+ * @param[in] tag tag for loading notification handle
+ * @return Notification handle(notification_h) on success, NULL on failure
+ * @retval notification_h Success
+ * @retval NULL Failure
+ * @exception #NOTIFICATION_ERROR_NONE Success
+ * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
+ * @exception #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see #notification_type_e
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+
+ noti = notification_load_by_tag(tag);
+ if(noti == NULL) {
+ return;
+ }
+ ...
+}
+ * @endcode
+ */
+notification_h notification_load_by_tag(const char *tag);
+
+/**
+ * @brief Posts a notification.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] noti Notification handle
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @pre Notification handle should be created by notification_create().
+ * @post notification_free().
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+ {
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_post(noti);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_post(notification_h noti);
+
+/**
* @brief Get the information of notification event
* @details
* @remarks
* @param[in] list notification list handle
* @return NOTIFICATION_ERROR_NONE if success, other value if failure.
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
* @pre notification_get_grouping_list() or notification_get_detail_list ()
* @post
* @see #notification_op
* @param[out] text response
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
- * @retval NOTIFICATION_ERROR_NO_MEMORY - not enough memory
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
+ * @retval NOTIFICATION_ERROR_OUT_OF_MEMORY - not enough memory
* @pre notification handle should be created by notification_new().
* @post
* @see
* @param[in] text response
* @return NOTIFICATION_ERROR_NONE if success, other value if failure
* @retval NOTIFICATION_ERROR_NONE - success
- * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
- * @retval NOTIFICATION_ERROR_NO_MEMORY - not enough memory
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
+ * @retval NOTIFICATION_ERROR_OUT_OF_MEMORY - not enough memory
* @pre notification handle should be created by notification_new().
* @post
* @see
#ifndef __NOTIFICATION_ERROR_H__
#define __NOTIFICATION_ERROR_H__
+#include <tizen.h>
+
/**
- * @addtogroup NOTIFICATION_TYPE
+ * @file notification_error.h
+ */
+
+/**
+ * @addtogroup NOTIFICATION_MODULE
* @{
*/
/**
- * @breief Enumeration for notification error
+ * @brief Enumeration for notification errors.
+ * @since_tizen 2.3
*/
typedef enum _notification_error {
- NOTIFICATION_ERROR_NONE = 0, /**< Success */
- NOTIFICATION_ERROR_INVALID_DATA = -1, /**< Invalid parameter */
- NOTIFICATION_ERROR_NO_MEMORY = -2, /**< No memory */
- NOTIFICATION_ERROR_FROM_DB = -3, /**< Error from DB query */
- NOTIFICATION_ERROR_ALREADY_EXIST_ID = -4, /**< Already exist private ID */
- NOTIFICATION_ERROR_FROM_DBUS = -5, /**< Error from DBus */
- NOTIFICATION_ERROR_NOT_EXIST_ID = -6, /**< Not exist private ID */
- NOTIFICATION_ERROR_IO = -7, /**< disk i/o error */
- NOTIFICATION_ERROR_SERVICE_NOT_READY = -8, /**< no reponse from master */
- NOTIFICATION_ERROR_PERMISSION_DENIED = -9, /**< Permission denied */
+ NOTIFICATION_ERROR_NONE = TIZEN_ERROR_NONE, /**< Success */
+ NOTIFICATION_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ NOTIFICATION_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< out of memory */
+ NOTIFICATION_ERROR_IO_ERROR = TIZEN_ERROR_IO_ERROR, /**< I/O error */
+ NOTIFICATION_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+ NOTIFICATION_ERROR_FROM_DB = TIZEN_ERROR_NOTIFICATION | 0x01, /**< Error from DB query */
+ NOTIFICATION_ERROR_ALREADY_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x02, /**< Already exist private ID */
+ NOTIFICATION_ERROR_FROM_DBUS = TIZEN_ERROR_NOTIFICATION | 0x03, /**< Error from DBus */
+ NOTIFICATION_ERROR_NOT_EXIST_ID = TIZEN_ERROR_NOTIFICATION | 0x04, /**< Not exist private ID */
+ NOTIFICATION_ERROR_SERVICE_NOT_READY = TIZEN_ERROR_NOTIFICATION | 0x05, /**< No response from notification service */
} notification_error_e;
-/**
+/**
* @}
*/
char *app_name; /* Temporary stored app name from AIL */
char *temp_title;
char *temp_content;
+ char *tag;
};
#endif /* __NOTIFICATION_INTERNAL_H__ */
notification_error_e notification_ipc_request_delete_single(notification_type_e type, char *pkgname, int priv_id);
notification_error_e notification_ipc_request_delete_multiple(notification_type_e type, char *pkgname);
+int notification_ipc_is_master_ready(void);
notification_error_e notification_ipc_add_deffered_task(void (*deffered_task_cb)(void *data), void *user_data);
notification_error_e notification_ipc_del_deffered_task(void (*deffered_task_cb)(void *data));
notification_error_e notification_ipc_noti_setting_property_set(const char *pkgname, const char *property, const char *value);
notification_error_e notification_ipc_noti_setting_property_get(const char *pkgname, const char *property, char **value);
+int notification_ipc_request_load_noti_by_tag(notification_h noti, const char *pkgname, const char *tag);
+
#ifdef __cplusplus
}
#endif
/**
* @file notification_type.h
- * @brief This file contains defines and enumerations for Notification APIs
+ * @brief This file contains type definitions and enumerations for Notification API.
*/
/**
- * @addtogroup NOTIFICATION_TYPE
+ * @addtogroup NOTIFICATION_MODULE
* @{
*/
/**
- * @brief Enumeration for notification layout type
+ * @brief Enumeration for notification layout type.
+ * @since_tizen 2.3
*/
typedef enum _notification_ly_type {
- NOTIFICATION_LY_NONE = 0,
- NOTIFICATION_LY_NOTI_EVENT_SINGLE,
- /**< layout for notification. used to inform single event*/
- NOTIFICATION_LY_NOTI_EVENT_MULTIPLE,
- /**< layout for notification. used to inform multiple event*/
- NOTIFICATION_LY_NOTI_THUMBNAIL,
- /**< layout for notification. used to display images*/
- NOTIFICATION_LY_ONGOING_EVENT,
- /**< layout for ongoing notification. used to display text message*/
- NOTIFICATION_LY_ONGOING_PROGRESS,
- /**< layout for ongoing notification. used to display progress*/
- NOTIFICATION_LY_MAX,
+ NOTIFICATION_LY_NONE = 0, /**< Default */
+ NOTIFICATION_LY_NOTI_EVENT_SINGLE, /**< Layout for notification. Used to inform single event*/
+ NOTIFICATION_LY_NOTI_EVENT_MULTIPLE, /**< Layout for notification. Used to inform multiple event*/
+ NOTIFICATION_LY_NOTI_THUMBNAIL, /**< Layout for notification. Used to display images*/
+ NOTIFICATION_LY_ONGOING_EVENT, /**< Layout for ongoing notification. Used to display text message*/
+ NOTIFICATION_LY_ONGOING_PROGRESS, /**< Layout for ongoing notification. Used to display progress*/
+ NOTIFICATION_LY_MAX, /**< TBD */
} notification_ly_type_e;
/**
+ * @brief Enumeration for notification launch option type.
+ * @since_tizen 2.3
+ */
+typedef enum _notification_launch_option_type {
+ NOTIFICATION_LAUNCH_OPTION_APP_CONTROL = 1, /**< launching with app control */
+} notification_launch_option_type;
+
+/**
* @brief Enumeration for notification sound type.
+ * @since_tizen 2.3
*/
typedef enum _notification_sound_type {
- NOTIFICATION_SOUND_TYPE_NONE = -1,
- /**< Default value. no sound */
- NOTIFICATION_SOUND_TYPE_DEFAULT = 0,
- /**< default sound */
- NOTIFICATION_SOUND_TYPE_USER_DATA,
- /**< User sound data */
- NOTIFICATION_SOUND_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_SOUND_TYPE_NONE = -1, /**< Default value. no sound */
+ NOTIFICATION_SOUND_TYPE_DEFAULT = 0, /**< Default sound */
+ NOTIFICATION_SOUND_TYPE_USER_DATA, /**< User sound data */
+ NOTIFICATION_SOUND_TYPE_MAX, /**< Max flag */
} notification_sound_type_e;
/**
* @brief Enumeration for notification vibration type.
+ * @since_tizen 2.3
*/
typedef enum _notification_vibration_type {
- NOTIFICATION_VIBRATION_TYPE_NONE = -1,
- /**< Default value. no vibration */
- NOTIFICATION_VIBRATION_TYPE_DEFAULT = 0,/**< default vibrate pattern */
- NOTIFICATION_VIBRATION_TYPE_USER_DATA,
- /**< User vibration data */
- NOTIFICATION_VIBRATION_TYPE_MAX,/**< Max flag */
+ NOTIFICATION_VIBRATION_TYPE_NONE = -1, /**< Default value. No vibration */
+ NOTIFICATION_VIBRATION_TYPE_DEFAULT = 0, /**< Default vibrate pattern */
+ NOTIFICATION_VIBRATION_TYPE_USER_DATA, /**< User vibration data */
+ NOTIFICATION_VIBRATION_TYPE_MAX, /**< Max flag */
} notification_vibration_type_e;
/**
- * @brief Enumeration for notification led operation.
+ * @brief Enumeration for notification LED operation.
+ * @since_tizen 2.3
*/
typedef enum _notification_led_op {
- NOTIFICATION_LED_OP_OFF = -1,
- /**< Default value. Disable the LED notification */
- NOTIFICATION_LED_OP_ON = 0,/**< turn on the LED with default color */
- NOTIFICATION_LED_OP_ON_CUSTOM_COLOR,
- /**< turn on the LED with custom color */
- NOTIFICATION_LED_OP_MAX,/**< Max flag */
+ NOTIFICATION_LED_OP_OFF = -1, /**< Default value. Disable the LED notification */
+ NOTIFICATION_LED_OP_ON = 0, /**< Turn on the LED with default color */
+ NOTIFICATION_LED_OP_ON_CUSTOM_COLOR, /**< Turn on the LED with custom color */
+ NOTIFICATION_LED_OP_MAX, /**< Max flag */
} notification_led_op_e;
/**
- * @brief Will be deprecated.
+ * @brief This will be deprecated.
+ * @since_tizen 2.3
*/
typedef enum _notification_count_display_type {
- NOTIFICATION_COUNT_DISPLAY_TYPE_NONE = -1,
- NOTIFICATION_COUNT_DISPLAY_TYPE_LEFT = 0,
- NOTIFICATION_COUNT_DISPLAY_TYPE_IN,
- NOTIFICATION_COUNT_DISPLAY_TYPE_RIGHT,
- NOTIFICATION_COUNT_DISPLAY_TYPE_MAX,
+ NOTIFICATION_COUNT_DISPLAY_TYPE_NONE = -1, /**< None */
+ NOTIFICATION_COUNT_DISPLAY_TYPE_LEFT = 0, /**< The number is placed to left */
+ NOTIFICATION_COUNT_DISPLAY_TYPE_IN, /**< The number is placed to center */
+ NOTIFICATION_COUNT_DISPLAY_TYPE_RIGHT, /**< The number is placed to right */
+ NOTIFICATION_COUNT_DISPLAY_TYPE_MAX, /**< Max flag */
} notification_count_display_type_e;
/**
* @brief Enumeration for notification text type.
+ * @since_tizen 2.3
*/
typedef enum _notification_text_type {
- NOTIFICATION_TEXT_TYPE_NONE = -1,
- /**< NONE */
- NOTIFICATION_TEXT_TYPE_TITLE = 0,
- /**< Title */
- NOTIFICATION_TEXT_TYPE_CONTENT,
- /**< Content */
- NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF,
- /**< Content for content display option is off of the Settings */
- NOTIFICATION_TEXT_TYPE_EVENT_COUNT,
- /**< text to display event count */
- NOTIFICATION_TEXT_TYPE_INFO_1,
- /**< box contents 1 */
- NOTIFICATION_TEXT_TYPE_INFO_SUB_1,
- /**< box contents 1-1 */
- NOTIFICATION_TEXT_TYPE_INFO_2,
- /**< box contents 2 */
- NOTIFICATION_TEXT_TYPE_INFO_SUB_2,
- /**< box contents 2-1 */
- NOTIFICATION_TEXT_TYPE_INFO_3,
- /**< box contents 3 */
- NOTIFICATION_TEXT_TYPE_INFO_SUB_3,
- /**< box contents 3-1 */
- NOTIFICATION_TEXT_TYPE_GROUP_TITLE,
- /**< Group title */
- NOTIFICATION_TEXT_TYPE_GROUP_CONTENT,
- /**< Group content */
- NOTIFICATION_TEXT_TYPE_GROUP_CONTENT_FOR_DISPLAY_OPTION_IS_OFF,
- /**< Group content for content display option is off of the Settings */
- NOTIFICATION_TEXT_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_TEXT_TYPE_NONE = -1, /**< NONE */
+ NOTIFICATION_TEXT_TYPE_TITLE = 0, /**< Title */
+ NOTIFICATION_TEXT_TYPE_CONTENT, /**< Content */
+ NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF, /**< Content for content display option is off of the Settings */
+ NOTIFICATION_TEXT_TYPE_EVENT_COUNT, /**< Text to display event count */
+ NOTIFICATION_TEXT_TYPE_INFO_1, /**< Box contents 1 */
+ NOTIFICATION_TEXT_TYPE_INFO_SUB_1, /**< Box contents 1-1 */
+ NOTIFICATION_TEXT_TYPE_INFO_2, /**< Box contents 2 */
+ NOTIFICATION_TEXT_TYPE_INFO_SUB_2, /**< Box contents 2-1 */
+ NOTIFICATION_TEXT_TYPE_INFO_3, /**< Box contents 3 */
+ NOTIFICATION_TEXT_TYPE_INFO_SUB_3, /**< Box contents 3-1 */
+ NOTIFICATION_TEXT_TYPE_GROUP_TITLE, /**< Group title */
+ NOTIFICATION_TEXT_TYPE_GROUP_CONTENT, /**< Group content */
+ NOTIFICATION_TEXT_TYPE_GROUP_CONTENT_FOR_DISPLAY_OPTION_IS_OFF, /**< Group content for content display option is off of the Settings */
+ NOTIFICATION_TEXT_TYPE_MAX, /**< Max flag */
} notification_text_type_e;
/**
- * @brief Enumeration for image text type.
+ * @brief Enumeration for image type.
+ * @since_tizen 2.3
*/
typedef enum _notification_image_type {
- NOTIFICATION_IMAGE_TYPE_NONE = -1,
- /**< NONE */
- NOTIFICATION_IMAGE_TYPE_ICON = 0,
- /**< Icon */
- NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR,
- /**< Indicator icon */
- NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK,
- /**< Lock screen icon */
- NOTIFICATION_IMAGE_TYPE_THUMBNAIL,
- /**< Thumbnail */
- NOTIFICATION_IMAGE_TYPE_THUMBNAIL_FOR_LOCK,
- /**< Lock screen thumbnail */
- NOTIFICATION_IMAGE_TYPE_ICON_SUB,
- /**< Icon */
- NOTIFICATION_IMAGE_TYPE_BACKGROUND,
- /**< image displayed on background */
- NOTIFICATION_IMAGE_TYPE_LIST_1,
- /**< image for thumbnail list */
- NOTIFICATION_IMAGE_TYPE_LIST_2,
- /**< image for thumbnail list */
- NOTIFICATION_IMAGE_TYPE_LIST_3,
- /**< image for thumbnail list */
- NOTIFICATION_IMAGE_TYPE_LIST_4,
- /**< image for thumbnail list */
- NOTIFICATION_IMAGE_TYPE_LIST_5,
- /**< image for thumbnail list */
- NOTIFICATION_IMAGE_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_IMAGE_TYPE_NONE = -1, /**< NONE */
+ NOTIFICATION_IMAGE_TYPE_ICON = 0, /**< Icon */
+ NOTIFICATION_IMAGE_TYPE_ICON_FOR_INDICATOR, /**< Indicator icon */
+ NOTIFICATION_IMAGE_TYPE_ICON_FOR_LOCK, /**< Lock screen icon */
+ NOTIFICATION_IMAGE_TYPE_THUMBNAIL, /**< Thumbnail */
+ NOTIFICATION_IMAGE_TYPE_THUMBNAIL_FOR_LOCK, /**< Lock screen thumbnail */
+ NOTIFICATION_IMAGE_TYPE_ICON_SUB, /**< Icon */
+ NOTIFICATION_IMAGE_TYPE_BACKGROUND, /**< image displayed on background */
+ NOTIFICATION_IMAGE_TYPE_LIST_1, /**< Image for thumbnail list */
+ NOTIFICATION_IMAGE_TYPE_LIST_2, /**< Image for thumbnail list */
+ NOTIFICATION_IMAGE_TYPE_LIST_3, /**< Image for thumbnail list */
+ NOTIFICATION_IMAGE_TYPE_LIST_4, /**< Image for thumbnail list */
+ NOTIFICATION_IMAGE_TYPE_LIST_5, /**< Image for thumbnail list */
+ NOTIFICATION_IMAGE_TYPE_MAX, /**< Max flag */
} notification_image_type_e;
/*typedef enum _notification_button_type {
/**
* @brief Enumeration for application execution type.
+ * @since_tizen 2.3
*/
typedef enum _notification_execute_type {
- NOTIFICATION_EXECUTE_TYPE_NONE = -1,
- /**< No operation */
- NOTIFICATION_EXECUTE_TYPE_RESPONDING = 0,
- /**< Responding action*/
- NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,/**< Launching when notification data is single */
- NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH,
- /**< Launching when notification data is grouping(multi) */
- NOTIFICATION_EXECUTE_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_EXECUTE_TYPE_NONE = -1, /**< No operation */
+ NOTIFICATION_EXECUTE_TYPE_RESPONDING = 0, /**< Responding action*/
+ NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, /**< Launching when notification data is single */
+ NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH, /**< Launching when notification data is grouping(multi) */
+ NOTIFICATION_EXECUTE_TYPE_MAX, /**< Max flag */
} notification_execute_type_e;
/**
* @brief Enumeration for notification type.
+ * @since_tizen 2.3
*/
typedef enum _notification_type {
- NOTIFICATION_TYPE_NONE = -1,
- /**< None */
- NOTIFICATION_TYPE_NOTI = 0,
- /**< Notification type */
- NOTIFICATION_TYPE_ONGOING,
- /**< Ongoing type */
- NOTIFICATION_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_TYPE_NONE = -1, /**< None */
+ NOTIFICATION_TYPE_NOTI = 0, /**< Notification type */
+ NOTIFICATION_TYPE_ONGOING, /**< Ongoing type */
+ NOTIFICATION_TYPE_MAX, /**< Max flag */
} notification_type_e;
/**
* @brief Enumeration for Group ID.
+ * @since_tizen 2.3
*/
enum _notification_group_id {
- NOTIFICATION_GROUP_ID_NONE = -1,/**< Not Grouping */
- NOTIFICATION_GROUP_ID_DEFAULT = 0,
- /**< Notification that has same title is grouping */
+ NOTIFICATION_GROUP_ID_NONE = -1, /**< Not Grouping */
+ NOTIFICATION_GROUP_ID_DEFAULT = 0, /**< Notification that has same title is grouping */
};
/**
* @brief Enumeration for Private ID.
+ * @since_tizen 2.3
*/
enum _notification_priv_id {
- NOTIFICATION_PRIV_ID_NONE = -1,
- /**< Internally set priv_id */
+ NOTIFICATION_PRIV_ID_NONE = -1, /**< Internally set priv_id */
};
/**
- * @brief Enumeration for notification property
+ * @brief Enumeration for notification property.
+ * @since_tizen 2.3
*/
enum _notification_property {
- NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE = 0x00000001,
- /**< Display only SIM card inserted */
- NOTIFICATION_PROP_DISABLE_APP_LAUNCH = 0x00000002,
- /**< Disable application launch when it selected */
- NOTIFICATION_PROP_DISABLE_AUTO_DELETE = 0x00000004,
- /**< Disable auto delete when it selected */
- NOTIFICATION_PROP_LAUNCH_UG = 0x00000008,
- /**< Will be deprecated. Notification Tray should launch application using appsvc API */
- NOTIFICATION_PROP_DISABLE_TICKERNOTI = 0x00000010,
- /**< Will be deprecated. Use notification_set_display_applist API */
- NOTIFICATION_PROP_PERMANENT_DISPLAY = 0x00000020,
- /** < Will be deprecated. */
- NOTIFICATION_PROP_DISABLE_UPDATE_ON_INSERT = 0x00000040,/**< Disable update when it inserted. */
- NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE = 0x00000080,/**< Disable update when it deleted. */
- NOTIFICATION_PROP_VOLATILE_DISPLAY = 0x00000100,/**< Deleted when device is rebooted eventhough NOTIFICATION_TYPE_NOTI type */
+ NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE = 0x00000001, /**< Display only SIM card inserted */
+ NOTIFICATION_PROP_DISABLE_APP_LAUNCH = 0x00000002, /**< Disable application launch when it selected */
+ NOTIFICATION_PROP_DISABLE_AUTO_DELETE = 0x00000004, /**< Disable auto delete when it selected */
+ NOTIFICATION_PROP_LAUNCH_UG = 0x00000008, /**< Will be deprecated. Notification Tray should launch application using appsvc API */
+ NOTIFICATION_PROP_DISABLE_TICKERNOTI = 0x00000010, /**< Will be deprecated. Use notification_set_display_applist API */
+ NOTIFICATION_PROP_PERMANENT_DISPLAY = 0x00000020, /**< Will be deprecated. */
+ NOTIFICATION_PROP_DISABLE_UPDATE_ON_INSERT = 0x00000040, /**< Disable update when it inserted. */
+ NOTIFICATION_PROP_DISABLE_UPDATE_ON_DELETE = 0x00000080, /**< Disable update when it deleted. */
+ NOTIFICATION_PROP_VOLATILE_DISPLAY = 0x00000100, /**< Deleted when device is rebooted eventhough NOTIFICATION_TYPE_NOTI type */
};
/**
- * @brief Enumeration for display application list
+ * @brief Enumeration for display application list.
+ * @since_tizen 2.3
*/
enum _notificaton_display_applist {
NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY = 0x00000001,/**< Notification Tray(Quickpanel) */
- NOTIFICATION_DISPLAY_APP_TICKER = 0x00000002,
- /**< Ticker notification */
- NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004,
- /**< Lock screen */
+ NOTIFICATION_DISPLAY_APP_TICKER = 0x00000002,/**< Ticker notification */
+ NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004,/**< Lock screen */
NOTIFICATION_DISPLAY_APP_INDICATOR = 0x00000008,/**< Indicator */
- NOTIFICATION_DISPLAY_APP_ALL = 0xffffffff,
- /**< All display application */
+ NOTIFICATION_DISPLAY_APP_ALL = 0xffffffff,/**< All display application */
};
/**
- * @}
- */
-
-/**
- * @brief Enumeration for notification operation code
+ * @brief Enumeration for notification operation code.
+ * @since_tizen 2.3
*/
typedef enum _notification_op_type {
- NOTIFICATION_OP_NONE = 0,
- NOTIFICATION_OP_INSERT = 1,
- NOTIFICATION_OP_UPDATE,
- NOTIFICATION_OP_DELETE,
- NOTIFICATION_OP_DELETE_ALL,
- NOTIFICATION_OP_REFRESH,
- NOTIFICATION_OP_SERVICE_READY,
+ NOTIFICATION_OP_NONE = 0, /**< Default */
+ NOTIFICATION_OP_INSERT = 1, /**< Notification inserted */
+ NOTIFICATION_OP_UPDATE, /**< Notification updated */
+ NOTIFICATION_OP_DELETE, /**< Notification deleted */
+ NOTIFICATION_OP_DELETE_ALL, /**< Notifications deleted */
+ NOTIFICATION_OP_REFRESH, /**< Deprecated */
+ NOTIFICATION_OP_SERVICE_READY, /**< Notification service is ready */
} notification_op_type_e;
/**
* @brief Enumeration for notification operation data code
+ * @since_tizen 2.3
*/
typedef enum _notification_op_data_type {
- NOTIFICATION_OP_DATA_MIN = 0,
- NOTIFICATION_OP_DATA_TYPE,
- NOTIFICATION_OP_DATA_PRIV_ID,
- NOTIFICATION_OP_DATA_NOTI,
- NOTIFICATION_OP_DATA_EXTRA_INFO_1,
- NOTIFICATION_OP_DATA_EXTRA_INFO_2,
- NOTIFICATION_OP_DATA_MAX,
+ NOTIFICATION_OP_DATA_MIN = 0, /**< Default */
+ NOTIFICATION_OP_DATA_TYPE, /**< Operation type */
+ NOTIFICATION_OP_DATA_PRIV_ID, /**< Private ID */
+ NOTIFICATION_OP_DATA_NOTI, /**< Notification handler */
+ NOTIFICATION_OP_DATA_EXTRA_INFO_1, /**< Reserved */
+ NOTIFICATION_OP_DATA_EXTRA_INFO_2, /**< Reserved */
+ NOTIFICATION_OP_DATA_MAX, /**< Max flag */
} notification_op_data_type_e;
/**
* @brief Enumeration for notification count position in the text.
+ * @since_tizen 2.3
*/
typedef enum _notifcation_count_pos_type {
- NOTIFICATION_COUNT_POS_NONE = -1,
- /**< Count data is not displaying in the text */
- NOTIFICATION_COUNT_POS_LEFT = 0,/**< Count data is displaying at the left of the text */
- NOTIFICATION_COUNT_POS_IN,
- /**< Count data is displaying in the text */
- NOTIFICATION_COUNT_POS_RIGHT,
- /**< Count data is displaying at the right of the text */
- NOTIFICATION_COUNT_POS_MAX,
- /**< Max flag */
+ NOTIFICATION_COUNT_POS_NONE = -1, /**< Count data is not displaying in the text */
+ NOTIFICATION_COUNT_POS_LEFT = 0, /**< Count data is displaying at the left of the text */
+ NOTIFICATION_COUNT_POS_IN, /**< Count data is displaying in the text */
+ NOTIFICATION_COUNT_POS_RIGHT, /**< Count data is displaying at the right of the text */
+ NOTIFICATION_COUNT_POS_MAX, /**< Max flag */
} notification_count_pos_type_e;
/**
- * @brief Enumeration for notification variable parameter type
+ * @brief Enumeration for notification variable parameter type.
+ * @since_tizen 2.3
*/
typedef enum _notification_variable_type {
- NOTIFICATION_VARIABLE_TYPE_NONE = -1,
- /**< Variable parameter type is NONE */
- NOTIFICATION_VARIABLE_TYPE_INT = 0,
- /**< Variable parameter type is int */
- NOTIFICATION_VARIABLE_TYPE_DOUBLE,
- /**< Variable parameter type is double */
- NOTIFICATION_VARIABLE_TYPE_STRING,
- /**< Variable parameter type is string */
- NOTIFICATION_VARIABLE_TYPE_COUNT,
- /**< Variable parameter type is count */
- NOTIFICATION_VARIABLE_TYPE_MAX,
- /**< Max flag */
+ NOTIFICATION_VARIABLE_TYPE_NONE = -1, /**< Variable parameter type is NONE */
+ NOTIFICATION_VARIABLE_TYPE_INT = 0, /**< Variable parameter type is int */
+ NOTIFICATION_VARIABLE_TYPE_DOUBLE, /**< Variable parameter type is double */
+ NOTIFICATION_VARIABLE_TYPE_STRING, /**< Variable parameter type is string */
+ NOTIFICATION_VARIABLE_TYPE_COUNT, /**< Variable parameter type is count */
+ NOTIFICATION_VARIABLE_TYPE_MAX, /**< Max flag */
} notification_variable_type_e;
/**
- * @brief Notification handle
+ * @brief Notification handle.
+ * @since_tizen 2.3
*/
typedef struct _notification *notification_h;
/**
- * @brief Notification operation handle
+ * @brief The structure for notification operation.
+ * @since_tizen 2.3
*/
typedef struct _notification_op {
- notification_op_type_e type;
- int priv_id;
- int extra_info_1;
- int extra_info_2;
- notification_h noti;
+ notification_op_type_e type; /**< Notification operation type */
+ int priv_id; /**< private ID */
+ int extra_info_1; /**< Reserved */
+ int extra_info_2; /**< Reserved */
+ notification_h noti; /**< Notification handler */
} notification_op;
+/**
+ * @}
+ */
+
#ifdef __cplusplus
}
#endif
-#endif /* __NOTIFICATION_TYPE_H__ */
+
+#endif /* __NOTIFICATION_TYPE_H__ */
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(com-core)
+BuildRequires: pkgconfig(capi-appfw-application)
BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(eina)
BuildRequires: pkgconfig(libtzplatform-config)
#include <dbus/dbus.h>
#include <dbus/dbus-glib-lowlevel.h>
+#include <app_control.h>
+#include <app_control_internal.h>
#include <aul.h>
#include <ail.h>
#include <appsvc.h>
/* Check noti and image_path are valid data */
if (noti == NULL || image_path == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image type is valid type */
if (type <= NOTIFICATION_IMAGE_TYPE_NONE
|| type >= NOTIFICATION_IMAGE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image path bundle is exist */
/* Check noti and image_path is valid data */
if (noti == NULL || image_path == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image type is valid data */
if (type <= NOTIFICATION_IMAGE_TYPE_NONE
|| type >= NOTIFICATION_IMAGE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check image path bundle exist */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (input_time == 0) {
{
/* Check noti and time is valid data */
if (noti == NULL || ret_time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set time infomation */
{
/* Check noti and ret_time is valid data */
if (noti == NULL || ret_time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set insert time information */
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text type is valid type */
if (type <= NOTIFICATION_TEXT_TYPE_NONE
|| type >= NOTIFICATION_TEXT_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text bundle exist */
default:
NOTIFICATION_ERR("Error. invalid variable type. : %d",
var_type);
- noti_err = NOTIFICATION_ERROR_INVALID_DATA;
+ noti_err = NOTIFICATION_ERROR_INVALID_PARAMETER;
break;
}
/* Check noti is valid data */
if (noti == NULL || text == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check text type is valid type */
if (type <= NOTIFICATION_TEXT_TYPE_NONE
|| type >= NOTIFICATION_TEXT_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check key */
{
/* check noti and domain is valid data */
if (noti == NULL || domain == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check domain */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Get domain */
char buf_tag[512] = { 0, };
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (time <= 0) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
snprintf(buf, sizeof(buf), "%lu", time);
notification_error_e ret = NOTIFICATION_ERROR_NONE;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (time == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
char *ret_text = NULL;
ret = notification_get_text(noti, type, &ret_text);
if (ret != NOTIFICATION_ERROR_NONE || ret_text == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_noti_get_tag_type(ret_text) == TAG_TYPE_INVALID) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
char *tag_value = NULL;
tag_value = notification_noti_strip_tag(ret_text);
if (tag_value == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
*time = atol(tag_value);
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check type is valid */
if (type < NOTIFICATION_SOUND_TYPE_NONE
|| type >= NOTIFICATION_SOUND_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save sound type */
{
/* check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set sound type */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check type is valid */
if (type < NOTIFICATION_VIBRATION_TYPE_NONE
|| type >= NOTIFICATION_VIBRATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save vibration type */
{
/* check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set vibration type */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check operation is valid */
if (operation < NOTIFICATION_LED_OP_OFF
|| operation >= NOTIFICATION_LED_OP_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save led operation */
{
/* check noti and operation is valid data */
if (noti == NULL || operation == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set led operation */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save led operation */
{
/* check noti and operation is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (on_ms)
const char *pkgname)
{
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->launch_pkgname) {
char **pkgname)
{
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->launch_pkgname) {
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_set_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option)
+{
+ int ret = 0;
+ bundle *b = NULL;
+ app_control_h app_control = option;
+
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (app_control == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if ((ret = app_control_to_bundle(app_control, &b)) == APP_CONTROL_ERROR_NONE) {
+ return notification_set_execute_option(noti,
+ NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+ NULL, NULL,
+ b);
+ } else {
+ NOTIFICATION_ERR("Failed to convert appcontrol to bundle:%d", ret);
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+}
+
+EXPORT_API int notification_get_launch_option(notification_h noti,
+ notification_launch_option_type type, void *option)
+{
+ int ret = 0;
+ bundle *b = NULL;
+ app_control_h *app_control = (app_control_h *)option;
+ app_control_h app_control_new = NULL;
+
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (app_control == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+ if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = notification_get_execute_option(noti,
+ NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
+ NULL,
+ &b);
+ if (ret == NOTIFICATION_ERROR_NONE && b != NULL) {
+ ret = app_control_create(&app_control_new);
+ if (ret == APP_CONTROL_ERROR_NONE && app_control_new != NULL) {
+ ret = app_control_import_from_bundle(app_control_new, b);
+ if (ret == APP_CONTROL_ERROR_NONE) {
+ *app_control = app_control_new;
+ } else {
+ app_control_destroy(app_control_new);
+ NOTIFICATION_ERR("Failed to import app control from bundle:%d", ret);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+ } else {
+ NOTIFICATION_ERR("Failed to create app control:%d", ret);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+ } else {
+ NOTIFICATION_ERR("Failed to get execute option:%d", ret);
+ return ret;
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_set_execute_option(notification_h noti,
notification_execute_type_e type,
const char *text,
bundle *b = NULL;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
|| type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Create execute option bundle if does not exist */
bundle *b = NULL;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
|| type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
switch (type) {
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set flags */
{
/* Check noti and flags are valid data */
if (noti == NULL || flags == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set flags */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set app list */
{
/* Check noti and applist are valid data */
if (noti == NULL || applist == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set app list */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save progress size */
{
/* Check noti and size is valid data */
if (noti == NULL || size == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set progress size */
{
/* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save progress percentage */
{
/* Check noti and percentage are valid data */
if (noti == NULL || percentage == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set progress percentage */
{
/* check noti and pkgname are valid data */
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Remove previous caller pkgname */
{
/* Check noti and pkgname are valid data */
if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Get caller pkgname */
{
/* check noti and pkgname are valid data */
if (noti == NULL || (layout < NOTIFICATION_LY_NONE || layout >= NOTIFICATION_LY_MAX)) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
noti->layout = layout;
{
/* Check noti and pkgname are valid data */
if (noti == NULL || layout == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
*layout = noti->layout;
{
/* check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check group_id is valid data */
{
/* Check noti and type is valid data */
if (noti == NULL || type == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Set noti type */
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_post(notification_h noti)
+{
+ int ret = 0;
+ int id = 0;
+
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Check noti type is valid type */
+ if (noti->type <= NOTIFICATION_TYPE_NONE
+ || noti->type >= NOTIFICATION_TYPE_MAX) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Save insert time */
+ noti->insert_time = time(NULL);
+
+ ret = notification_ipc_request_insert(noti, &id);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ return ret;
+ }
+ noti->priv_id = id;
+ NOTIFICATION_DBG("from master:%d", id);
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_insert(notification_h noti,
int *priv_id)
{
int ret = 0;
int id = 0;
- /* Check noti is vaild data */
+ /* Check noti is valid data */
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Check noti type is valid type */
if (noti->type <= NOTIFICATION_TYPE_NONE
|| noti->type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Save insert time */
char *caller_pkgname = NULL;
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (pkgname == NULL) {
int ret = 0;
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_ipc_request_delete_single(NOTIFICATION_TYPE_NONE, noti->caller_pkgname, noti->priv_id);
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
input_priv_id = noti->priv_id;
}
return noti;
}
+EXPORT_API notification_h notification_load_by_tag(const char *tag)
+{
+ int ret = 0;
+ notification_h noti = NULL;
+ char *caller_pkgname = NULL;
+
+ if (tag == NULL) {
+ NOTIFICATION_ERR("Invalid parameter");
+ set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
+ return NULL;
+ }
+
+ caller_pkgname = _notification_get_pkgname_by_pid();
+ if (!caller_pkgname) {
+ NOTIFICATION_ERR("Failed to get a package name");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
+
+ return NULL;
+ }
+
+ noti = (notification_h) calloc(1, sizeof(struct _notification));
+ if (noti == NULL) {
+ NOTIFICATION_ERR("Failed to alloc a new notification");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
+ free(caller_pkgname);
+
+ return NULL;
+ }
+
+ ret = notification_ipc_request_load_noti_by_tag(noti, caller_pkgname, tag);
+
+ free(caller_pkgname);
+
+ set_last_result(ret);
+
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return NULL;
+ }
+
+ return noti;
+}
+
EXPORT_API notification_error_e notification_clone(notification_h noti, notification_h *clone)
{
notification_h new_noti = NULL;
if (noti == NULL || clone == NULL) {
NOTIFICATION_ERR("INVALID PARAMETER.");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
new_noti = (notification_h) calloc(1, sizeof(struct _notification));
if (new_noti == NULL) {
NOTIFICATION_ERR("NO MEMORY : noti == NULL");
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
new_noti->type = noti->type;
EXPORT_API notification_error_e notification_free(notification_h noti)
{
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->caller_pkgname) {
notification_cb_list_s *noti_cb_list = NULL;
if (changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
noti_cb_list_new =
noti_cb_list = g_notification_cb_list;
if (changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti_cb_list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
while (noti_cb_list->prev != NULL) {
noti_cb_list = noti_cb_list->next;
} while (noti_cb_list != NULL);
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
EXPORT_API notification_error_e
notification_cb_list_s *noti_cb_list = NULL;
if (detailed_changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
noti_cb_list_new =
noti_cb_list = g_notification_cb_list;
if (detailed_changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti_cb_list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
while (noti_cb_list->prev != NULL) {
noti_cb_list = noti_cb_list->next;
} while (noti_cb_list != NULL);
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
EXPORT_API notification_error_e notification_get_count(notification_type_e type,
int noti_count = 0;
if (count == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret =
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_noti_get_grouping_list(type, count, &get_list);
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = notification_noti_get_grouping_list(type, count, &get_list);
int ret = 0;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret =
notification_h noti = NULL;
if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
cur_list = notification_list_get_head(list);
void *data)
{
if (noti_op == NULL || data == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
switch (type) {
*((int*)data) = noti_op->extra_info_2;
break;
default:
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
break;
}
void (*deffered_task_cb)(void *data), void *user_data)
{
if (deffered_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
return notification_ipc_add_deffered_task(deffered_task_cb, user_data);
void (*deffered_task_cb)(void *data))
{
if (deffered_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
return notification_ipc_del_deffered_task(deffered_task_cb);
bundle * group_args)
{
if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->args) {
bundle ** group_args)
{
if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (noti->args) {
return NOTIFICATION_ERROR_NONE;
}
+EXPORT_API int notification_set_tag(notification_h noti, const char *tag)
+{
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if (tag != NULL) {
+ /* save input TAG */
+ if (noti->tag != NULL) {
+ free(noti->tag);
+ }
+ noti->tag = strdup(tag);
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+
+}
+
+EXPORT_API int notification_get_tag(notification_h noti, const char **tag)
+{
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ /* Set sound type */
+ *tag = noti->tag;
+ return NOTIFICATION_ERROR_NONE;
+}
+
EXPORT_API notification_error_e notification_wait_response(notification_h noti,
int timeout,
int *respi,
NULL, &b);
if (b == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid_c = bundle_get_val(b, "tid");
if (tid_c == NULL) {
sock_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (sock_fd == -1)
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
sock_addr.sun_family = AF_UNIX;
asprintf(&sock_path, "/tmp/.notification-%s", tid_c);
close(sock_fd);
free(sock_path);
free((char *)tid_c);
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
if (timeout > 0) {
NULL, &b);
if (b == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid_c = bundle_get_val(b, "tid");
if (tid_c == NULL)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
tid = atoi(tid_c);
sock_fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
if (sock_fd == -1)
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
sock_addr.sun_family = AF_UNIX;
asprintf(&sock_path, "/tmp/.notification-%d", tid);
if (connect(sock_fd, (struct sockaddr *)&sock_addr, sizeof(sock_addr)) == -1) {
close(sock_fd);
free(sock_path);
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
if (respc)
int ret = 0;
if (db == NULL || *db == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = db_util_close(*db);
sqlite3_stmt *stmt = NULL;
if (db == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (query == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = sqlite3_prepare_v2(db, query, strlen(query), &stmt, NULL);
#include <stdlib.h>
#include <errno.h>
+#include <vconf.h>
+
#include <packet.h>
#include <com-core.h>
#include <com-core_packet.h>
#define NOTIFICATION_IPC_TIMEOUT 0.0
+#if !defined(VCONFKEY_MASTER_STARTED)
+#define VCONFKEY_MASTER_STARTED "memory/data-provider-master/started"
+#endif
+
static struct info {
int server_fd;
int server_cl_fd;
* the task when the service is available)
*/
+int notification_ipc_is_master_ready(void)
+{
+ int ret = -1, is_master_started = 0;
+
+ ret = vconf_get_bool(VCONFKEY_MASTER_STARTED, &is_master_started);
+ if (ret == 0 && is_master_started == 1) {
+ NOTIFICATION_ERR("the master has been started");
+ } else {
+ is_master_started = 0;
+ NOTIFICATION_ERR("the master has been stopped");
+ }
+
+ return is_master_started;
+}
+
notification_error_e
notification_ipc_add_deffered_task(
void (*deffered_task_cb)(void *data),
(task_list *) malloc(sizeof(task_list));
if (list_new == NULL) {
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
list_new->next = NULL;
list_del = g_task_list;
if (list_del == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
while (list_del->prev != NULL) {
list_del = list_del->next;
} while (list_del != NULL);
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
static Eina_Bool _do_deffered_task(void *data) {
if (noti == NULL) {
NOTIFICATION_ERR("invalid data");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = packet_get(packet,
if (ret != 38) {
NOTIFICATION_ERR("failed to create a noti from packet");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/*!
if (!packet) {
NOTIFICATION_ERR("Packet is not valid\n");
- ret = NOTIFICATION_ERROR_INVALID_DATA;
+ ret = NOTIFICATION_ERROR_INVALID_PARAMETER;
} else if (packet_get(packet, "i", &ret) != 1) {
NOTIFICATION_ERR("Packet is not valid\n");
- ret = NOTIFICATION_ERROR_INVALID_DATA;
+ ret = NOTIFICATION_ERROR_INVALID_PARAMETER;
} else {
if (ret == 0) {
notification_op *noti_op = notification_ipc_create_op(NOTIFICATION_OP_SERVICE_READY, 1, NULL, 1, NULL);
s_info.server_fd = com_core_packet_client_init(s_info.socket_file, 0, service_table);
if (s_info.server_fd < 0) {
NOTIFICATION_ERR("Failed to make a connection to the master\n");
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
packet = packet_create("service_register", "");
if (!packet) {
NOTIFICATION_ERR("Failed to build a packet\n");
com_core_packet_client_fini(s_info.server_fd);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
ret = com_core_packet_async_send(s_info.server_fd, packet, 1.0, _handler_service_register, NULL);
packet_destroy(packet);
if (ret != 0) {
com_core_packet_client_fini(s_info.server_fd);
- s_info.server_fd = NOTIFICATION_ERROR_INVALID_DATA;
- ret = NOTIFICATION_ERROR_IO;
+ s_info.server_fd = NOTIFICATION_ERROR_INVALID_PARAMETER;
+ ret = NOTIFICATION_ERROR_IO_ERROR;
} else {
ret = NOTIFICATION_ERROR_NONE;
}
}
com_core_packet_client_fini(s_info.server_fd);
- s_info.server_fd = NOTIFICATION_ERROR_INVALID_DATA;
+ s_info.server_fd = NOTIFICATION_ERROR_INVALID_PARAMETER;
s_info.initialized = 0;
if (packet_get(result, "ii", &status, &id) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
if (status != NOTIFICATION_ERROR_NONE) {
if (packet_get(result, "ii", &status, &id) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
packet_unref(result);
} else {
if (packet_get(result, "ii", &status, &num_deleted) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
NOTIFICATION_ERR("num deleted:%d", num_deleted);
packet_unref(result);
if (packet_get(result, "ii", &status, &id) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
packet_unref(result);
} else {
if (cb_item == NULL) {
NOTIFICATION_ERR("Failed to get a callback item");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
s_info.server_cl_fd_ref_cnt = (s_info.server_cl_fd_ref_cnt <= 1) ? 0 : s_info.server_cl_fd_ref_cnt - 1;
if (s_info.server_cl_fd_ref_cnt <= 0) {
if (packet != NULL) {
if (packet_get(packet, "ii", &status, &id) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
- status = NOTIFICATION_ERROR_IO;
+ status = NOTIFICATION_ERROR_IO_ERROR;
}
}
packet = notification_ipc_make_packet_from_noti(noti, "update_noti", 1);
if (packet == NULL) {
- ret = NOTIFICATION_ERROR_INVALID_DATA;
+ ret = NOTIFICATION_ERROR_INVALID_PARAMETER;
goto fail;
}
cb_item = calloc(1, sizeof(result_cb_item));
if (cb_item == NULL) {
- ret = NOTIFICATION_ERROR_NO_MEMORY;
+ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto fail;
}
com_core_packet_client_fini(fd_temp);
NOTIFICATION_INFO("FD(%d) finalized", fd_temp);
}
- ret = NOTIFICATION_ERROR_IO;
+ ret = NOTIFICATION_ERROR_IO_ERROR;
goto fail;
} else {
ret = NOTIFICATION_ERROR_NONE;
if (packet_get(result, "i", &status) != 1) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
packet_unref(result);
} else {
if (packet_get(result, "ii", &status, &ret) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
packet_unref(result);
} else {
if (packet_get(result, "is", &status, &ret) != 2) {
NOTIFICATION_ERR("Failed to get a result packet");
packet_unref(result);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
if (status == NOTIFICATION_ERROR_NONE && ret != NULL) {
*value = strdup(ret);
return status;
}
+
+int notification_ipc_request_load_noti_by_tag(notification_h noti, const char *pkgname, const char *tag)
+{
+ struct packet *packet;
+ struct packet *result;
+
+ packet = packet_create("load_noti_by_tag", "ss", pkgname, tag);
+ result = com_core_packet_oneshot_send(NOTIFICATION_ADDR,
+ packet,
+ NOTIFICATION_IPC_TIMEOUT);
+ packet_destroy(packet);
+
+ if (result != NULL) {
+ if (notification_ipc_make_noti_from_packet(noti, result) != NOTIFICATION_ERROR_NONE) {
+ NOTIFICATION_ERR("Failed to get a result packet");
+ packet_unref(result);
+ return NOTIFICATION_ERROR_IO_ERROR;
+ }
+
+ packet_unref(result);
+ } else {
+ NOTIFICATION_ERR("failed to receive answer(load noti by tag)");
+ if (notification_ipc_is_master_ready() == 1)
+ return NOTIFICATION_ERROR_PERMISSION_DENIED;
+ else
+ return NOTIFICATION_ERROR_SERVICE_NOT_READY;
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
len_total += (strlen(tag) * 2) + 5 + strlen(value) + 1;
if (buf_len <= len_total)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
snprintf(buf, buf_len, "<%s>%s</%s>", tag, value, tag);
char query[128] = { 0, };
if (db == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
snprintf(query, sizeof(query), "update noti_list set "
int ret = 0;
if (priv_id < 0 || noti == NULL) {
- ret = NOTIFICATION_ERROR_INVALID_DATA;
+ ret = NOTIFICATION_ERROR_INVALID_PARAMETER;
goto err;
}
*/
free(*list_deleted_rowid);
*list_deleted_rowid = NULL;
- ret = NOTIFICATION_ERROR_NO_MEMORY;
+ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto err;
}
}
/* Check pkgname is valid */
if (pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
snprintf(query_where, sizeof(query_where),
} else {
free(*list_deleted_rowid);
*list_deleted_rowid = NULL;
- ret = NOTIFICATION_ERROR_NO_MEMORY;
+ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto err;
}
}
/* Check pkgname is valid */
if (pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Open DB */
/* Check pkgname is valid */
if (pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Open DB */
/* Check pkgname is valid */
if (pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
/* Open DB */
int sqlret;
if (!pkgname)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!db)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
sqlbuf = sqlite3_mprintf("SELECT count(*) FROM %s WHERE " \
"appid = %Q",
if (!sqlbuf) {
NOTIFICATION_ERR("fail to alloc sql query");
- return NOTIFICATION_ERROR_NO_MEMORY;
+ return NOTIFICATION_ERROR_OUT_OF_MEMORY;
}
sqlret = sqlite3_prepare_v2(db, sqlbuf, -1, &stmt, NULL);
const char *column = NULL;
if (!pkgname)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!property)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!value)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
column = _get_prop_column(property);
if (!column)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
sqlret = db_util_open(NOTIFICATION_SETTING_DB_PATH, &db, 0);
if (sqlret != SQLITE_OK || !db) {
NOTIFICATION_SETTING_DB, column, value, pkgname);
if (!sqlbuf) {
NOTIFICATION_ERR("fail to alloc query");
- result = NOTIFICATION_ERROR_NO_MEMORY;
+ result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto return_close_db;
}
const char *column = NULL;
if (!pkgname)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!property)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!value)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
column = _get_prop_column(property);
if (!column)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
sqlret = db_util_open(NOTIFICATION_SETTING_DB_PATH, &db, 0);
if (sqlret != SQLITE_OK || !db) {
column, NOTIFICATION_SETTING_DB, pkgname);
if (!sqlbuf) {
NOTIFICATION_ERR("fail to alloc query");
- result = NOTIFICATION_ERROR_NO_MEMORY;
+ result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto return_close_db;
}
*value = get_data;
} else {
NOTIFICATION_ERR("fail to alloc query");
- result = NOTIFICATION_ERROR_NO_MEMORY;
+ result = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto return_close_db;
}
}
int ret = 0;
if (!pkgname)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!property)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!value)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
ret = notification_ipc_noti_setting_property_set(pkgname, property, value);
if (ret != NOTIFICATION_ERROR_NONE) {
int ret = 0;
if (!pkgname)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!property)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
if (!value)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
ret = notification_ipc_noti_setting_property_get(pkgname, property, value);
if (ret != NOTIFICATION_ERROR_NONE) {
if (!message) {
NOTIFICATION_ERR("message is NULL");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
if (strlen(message) <= 0) {
NOTIFICATION_ERR("message has only NULL");
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
ret = vconf_set_str(NOTIFICATION_STATUS_MESSAGE_KEY, message);
if (ret) {
NOTIFICATION_ERR("fail to set message [%s]", message);
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
return NOTIFICATION_ERROR_NONE;
{
int ret = 0;
if (!callback)
- return NOTIFICATION_ERROR_INVALID_DATA;
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
ret = vconf_notify_key_changed(NOTIFICATION_STATUS_MESSAGE_KEY,
__notification_status_message_change_cb, NULL);
if (ret && errno != EALREADY) {
NOTIFICATION_ERR("fail to set message cb");
- return NOTIFICATION_ERROR_IO;
+ return NOTIFICATION_ERROR_IO_ERROR;
}
md.callback = callback;