Move notification_get_text_input_max_length to internal
[platform/core/api/notification.git] / src / notification.c
index 03c94d6..b1d84fd 100755 (executable)
@@ -1154,7 +1154,7 @@ EXPORT_API int notification_set_event_handler(notification_h noti, notification_
        }
 
        if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1
-               || event_type > NOTIFICATION_EVENT_TYPE_CLICK_ON_THUMBNAIL) {
+               || event_type >= NOTIFICATION_EVENT_TYPE_MAX) {
                NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
                err = NOTIFICATION_ERROR_INVALID_PARAMETER;
                goto out;
@@ -1193,7 +1193,7 @@ EXPORT_API int notification_get_event_handler(notification_h noti, notification_
        }
 
        if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1
-               || event_type > NOTIFICATION_EVENT_TYPE_CLICK_ON_THUMBNAIL) {
+               || event_type >= NOTIFICATION_EVENT_TYPE_MAX) {
                NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
                err = NOTIFICATION_ERROR_INVALID_PARAMETER;
                goto out;
@@ -1407,7 +1407,7 @@ static notification_h _notification_create(notification_type_e type)
                return NULL;
        }
 
-       noti = (notification_h) calloc(1, sizeof(struct _notification));
+       noti = (notification_h)calloc(1, sizeof(struct _notification));
        if (noti == NULL) {
                NOTIFICATION_ERR("NO MEMORY : noti == NULL");
                set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
@@ -1430,6 +1430,7 @@ static notification_h _notification_create(notification_type_e type)
        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();
@@ -1451,7 +1452,6 @@ static notification_h _notification_create(notification_type_e type)
                        goto out;
                }
 
-
                err_app_manager = package_info_create(noti->caller_pkgname, &package_info);
 
                if (err_app_manager != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
@@ -1644,7 +1644,8 @@ EXPORT_API int notification_clone(notification_h noti, notification_h *clone)
        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->text_input_max_length = noti->text_input_max_length;
        new_noti->uid = noti->uid;
 
        new_noti->app_icon_path = NULL;
@@ -1905,3 +1906,13 @@ EXPORT_API int notification_get_noti_block_state(notification_block_state_e *sta
 
        return ret;
 }
+
+EXPORT_API int notification_set_text_input(notification_h noti, int text_input_max_length)
+{
+       if (noti == NULL)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+       noti->text_input_max_length = text_input_max_length;
+
+       return NOTIFICATION_ERROR_NONE;
+}