#include <time.h>
#include <bundle.h>
+#include <app.h>
#include <notification_error.h>
#include <notification_type.h>
/**
* @brief Sets an absolute path for an image file to display on the notification view.
* @since_tizen 2.3
+ * @privlevel N/P
+ * @feature http://tizen.org/feature/notification
* @param[in] noti The notification handle
* @param[in] type The notification image type
* @param[in] image_path The image file full path
int notification_get_launch_option(notification_h noti,
notification_launch_option_type type, void *option);
+
+/**
+ * @brief Sets the handler for a specific event.
+ * @details When some event occurs on notification, application launched by app_control_send_launch_request with app_control handle.\n
+ * Setting event handler of a button means that the notification will show the button.
+ * @since_tizen 2.4
+ * @privlevel N/P
+ * @feature http://tizen.org/feature/notification
+ * @param[in] noti The notification handle
+ * @param[in] event_type event type
+ * @param[in] event_handler app control handle
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see #notification_event_type_e
+ * @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_event_handler(noti, NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1, app_control);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+
+ app_control_destroy(app_control);
+}
+ * @endcode
+ */
+int notification_set_event_handler(notification_h noti, notification_event_type_e event_type, app_control_h event_handler);
+
+/**
+ * @brief Gets the event handler of a specific event.
+ * @remarks You must release @a app_control using app_control_destroy().
+ * @since_tizen 2.4
+ * @privlevel N/P
+ * @feature http://tizen.org/feature/notification
+ * @param[in] noti The notification handle
+ * @param[in] event_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
+ * @see #notification_event_type_e
+ * @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_EVENT_TYPE_CLICK_ON_BUTTON_1, (void *)&app_control);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_event_handler(notification_h noti, notification_event_type_e event_type, app_control_h *event_handler);
+
/**
* @brief Sets the property of the notification.
* @since_tizen 2.3
*/
int notification_get_tag(notification_h noti, const char **tag);
+/**
+ * @brief Gets the package name of the notification
+ * @since_tizen 2.4
+ * @privlevel NP
+ * @param[in] noti Notification handle
+ * @param[out] pkgname package name of the notification
+ * @return NOTIFICATION_ERROR_NONE on success, other value on failure
+ * @retval NOTIFICATION_ERROR_NONE Success
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ char *pkgname = NULL;
+
+ noti_err = notification_get_pkgname(noti, &pkgname);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_pkgname(notification_h noti, char **pkgname);
+
/**
* @brief Loads a notification from the notification's database with the tag.
* @since_tizen 2.3
NOTIFICATION_DEPRECATED_API int notification_set_pkgname(notification_h noti,
const char *pkgname);
-/**
- * @internal
- * @brief This function will be deprecated.
- * @param[in] noti Notification handle
- * @param[out] pkgname Caller package name
- * @return NOTIFICATION_ERROR_NONE on success, other value on failure
- * @retval NOTIFICATION_ERROR_NONE Success
- * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
- * @par Sample code:
- * @code
-#include <notification.h>
-...
-{
- notification_h noti = NULL;
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *pkgname = NULL;
-
- noti_err = notification_get_pkgname(noti, &pkgname);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-NOTIFICATION_DEPRECATED_API int notification_get_pkgname(notification_h noti,
- char **pkgname);
-
/**
* @internal
* @brief This function will be deprecated.
/**< launching with app control */
} notification_launch_option_type;
+/**
+ * @brief Enumeration for event type on notification.
+ * @since_tizen 2.4
+ */
+typedef enum _notification_event_type {
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1 = 1, /** < Event type : Click on button 1 */
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_2 = 2, /** < Event type : Click on button 2 */
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_3 = 3, /** < Event type : Click on button 3 */
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_4 = 4, /** < Event type : Click on button 4 */
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_ICON = 5, /** < Event type : Click on icon */
+ NOTIFICATION_EVENT_TYPE_CLICK_ON_THUMBNAIL = 6, /** < Event type : Click on thumbnail */
+} notification_event_type_e;
+
/**
* @brief Enumeration for notification sound type.
* @since_tizen 2.3
NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004,
/**< Lock screen */
NOTIFICATION_DISPLAY_APP_INDICATOR = 0x00000008,/**< Indicator */
+ NOTIFICATION_DISPLAY_APP_HEADS_UP = 0x00000010,/**< Heads-up notification */
NOTIFICATION_DISPLAY_APP_ALL = 0xffffffff,
/**< All display application */
};