NOTIFICATION_ONGOING_VALUE_TYPE_TIME,
} notification_ongoing_value_type_e;
+typedef enum _notification_event_type_extension {
+ NOTIFICATION_EVENT_TYPE_HIDDEN_BY_USER = 100,
+ NOTIFICATION_EVENT_TYPE_HIDDEN_BY_TIMEOUT = 101,
+} notification_event_type_extension_e;
+
/**
* @addtogroup NOTIFICATION_INTERNAL
* @{
}
* @endcode
*/
-EXPORT_API int nofication_get_ongoing_time(notification_h noti, int *current, int *duration);
+int nofication_get_ongoing_time(notification_h noti, int *current, int *duration);
/**
* @brief Sets the notification ongoing time when ongoint type value is set NOTIFICATION_ONGOING_VALUE_TYPE_TIME.
}
* @endcode
*/
-EXPORT_API int nofication_set_ongoing_time(notification_h noti, int current, int duration);
+int nofication_set_ongoing_time(notification_h noti, int current, int duration);
+
+/**
+ * @brief Gets the time that notification is hidden.
+ * @since_tizen 3.0
+ * @param[in] noti The notification handle
+ * @param[out] timeout The timeout time
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre Notification handle should be created by notification_create().
+ * @see #notification_event_type_extension_e
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ int timeout;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if (noti == NULL) {
+ return;
+ }
+
+ noti_err = notification_get_hide_timeout(noti, &timeout)
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+}
+ * @endcode
+ */
+int nofication_get_hide_timeout(notification_h noti, int *timeout);
+
+/**
+ * @brief Sets the time that notification is hidden.
+ * @since_tizen 3.0
+ * @param[in] noti The notification handle
+ * @param[in] timeout The timeout time
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @pre Notification handle should be created by notification_create().
+ * @see #notification_event_type_extension_e
+ * @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_hide_timeout(noti, 10)
+ if (noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+}
+ * @endcode
+ */
+int nofication_set_hide_timeout(notification_h noti, int timeout);
/**
* @brief This function translate localized texts
int ongoing_duration; /* Ongoing duration time */
bool auto_remove;
notification_button_index_e default_button_index;
+ int timeout;
uid_t uid;
};
NOTIFICATION_DATA_TYPE_ONGOING_DURATION,
NOTIFICATION_DATA_TYPE_AUTO_REMOVE,
NOTIFICATION_DATA_TYPE_DEFAULT_BUTTON,
+ NOTIFICATION_DATA_TYPE_TIMEOUT,
NOTIFICATION_DATA_TYPE_UID,
} notification_data_type_e;
noti->ongoing_flag = false;
noti->default_button_index = 0;
noti->type = NOTIFICATION_ONGOING_VALUE_TYPE_PERCENT;
+ noti->timeout = 0;
if (getuid() >= REGULAR_UID_MIN) {
noti->caller_pkgname = notification_get_pkgname_by_pid();
new_noti->ongoing_duration = noti->ongoing_duration;
new_noti->auto_remove = noti->auto_remove;
new_noti->default_button_index = noti->default_button_index;
+ new_noti->timeout = noti->timeout;
new_noti->uid = noti->uid;
ongoing_duration INTEGER default 0, \
auto_remove INTEGER default 1, \
default_button_index INTEGER default 0, \
+ timeout INTEGER default 0, \
uid INTEGER \
); \
create table if not exists noti_group_data ( \
ongoing_duration INTEGER default 0, \
auto_remove INTEGER default 1, \
default_button_index INTEGER default 0, \
+ timeout INTEGER default 0, \
uid INTEGER, \
template_name TEXT, \
UNIQUE (caller_pkgname, template_name) \
return NOTIFICATION_ERROR_NONE;
}
+
+EXPORT_API int nofication_get_hide_timeout(notification_h noti, int *timeout)
+{
+ if (noti == NULL || timeout == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+ *timeout = noti->timeout;
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int nofication_set_hide_timeout(notification_h noti, int timeout)
+{
+ if (noti == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+ noti->timeout = timeout;
+
+ return NOTIFICATION_ERROR_NONE;
+}
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_ONGOING_DURATION, g_variant_new_int32(noti->ongoing_duration));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_AUTO_REMOVE, g_variant_new_int32(noti->auto_remove));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_DEFAULT_BUTTON, g_variant_new_int32(noti->default_button_index));
+ g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_TIMEOUT, g_variant_new_int32(noti->timeout));
g_variant_builder_add(&builder, "{iv}", NOTIFICATION_DATA_TYPE_UID, g_variant_new_int32(noti->uid));
result_body = g_variant_builder_end(&builder);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_ONGOING_DURATION, "i", ¬i->ongoing_duration);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_AUTO_REMOVE, "i", ¬i->auto_remove);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_DEFAULT_BUTTON, "i", ¬i->default_button_index);
+ _variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_TIMEOUT, "i", ¬i->timeout);
_variant_dict_lookup(dict, NOTIFICATION_DATA_TYPE_UID, "i", ¬i->uid);
noti->caller_pkgname = _dup_string(caller_pkgname);
"flags_for_property, flag_simmode, display_applist, "
"progress_size, progress_percentage, "
"ongoing_flag, ongoing_value_type, ongoing_current, ongoing_duration, "
- "auto_remove, default_button_index, uid) values ("
+ "auto_remove, default_button_index, timeout, uid) values ("
"%d, "
"%d, "
"'%s', '%s', "
"%d, '%s', %d, '%s', %d, %d, %d, %d,"
"%d, %d, %d, "
"$progress_size, $progress_percentage, "
- "%d, %d, %d, %d, %d, %d, %d)",
+ "%d, %d, %d, %d, %d, %d, %d, %d)",
noti->type,
noti->layout,
NOTIFICATION_CHECK_STR(noti->caller_pkgname),
noti->ongoing_duration,
noti->auto_remove,
noti->default_button_index,
+ noti->timeout,
noti->uid);
/* Free decoded data */
"display_applist = %d, "
"progress_size = $progress_size, progress_percentage = $progress_percentage, "
"ongoing_flag = %d, ongoing_value_type = %d, ongoing_current = %d, ongoing_duration = %d, "
- "auto_remove = %d, default_button_index = %d "
+ "auto_remove = %d, default_button_index = %d, timeout = %d "
"where priv_id = %d ",
noti->type,
noti->layout,
noti->flags_for_property, flag_simmode, noti->display_applist,
noti->ongoing_flag, noti->ongoing_value_type,
noti->ongoing_current, noti->ongoing_duration,
- noti->auto_remove, noti->default_button_index, noti->priv_id);
+ noti->auto_remove, noti->default_button_index,
+ noti->timeout, noti->priv_id);
/* Free decoded data */
if (args)
noti->ongoing_duration = sqlite3_column_int(stmt, col++);
noti->auto_remove = sqlite3_column_int(stmt, col++);
noti->default_button_index = sqlite3_column_int(stmt, col++);
+ noti->timeout = sqlite3_column_int(stmt, col++);
noti->app_icon_path = NULL;
noti->app_name = NULL;