Move notification_get_text_input_max_length to internal
[platform/core/api/notification.git] / src / notification_internal.c
index 8a463d1..d1b8344 100755 (executable)
@@ -1316,7 +1316,7 @@ EXPORT_API int notification_set_default_button(notification_h noti, notification
        if (noti == NULL)
                return NOTIFICATION_ERROR_INVALID_PARAMETER;
 
-       if (index < 0 && index > NOTIFICATION_BUTTON_6)
+       if (index < 0 || index > NOTIFICATION_BUTTON_6)
                return NOTIFICATION_ERROR_INVALID_PARAMETER;
 
        noti->default_button_index = index;
@@ -1346,7 +1346,10 @@ EXPORT_API int notification_get_ongoing_value_type(notification_h noti, notifica
 
 EXPORT_API int notification_set_ongoing_value_type(notification_h noti, notification_ongoing_value_type_e type)
 {
-       if (type < NOTIFICATION_ONGOING_VALUE_TYPE_PERCENT && type > NOTIFICATION_ONGOING_VALUE_TYPE_TIME)
+       if (noti == NULL)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+       if (type < NOTIFICATION_ONGOING_VALUE_TYPE_PERCENT || type > NOTIFICATION_ONGOING_VALUE_TYPE_TIME)
                return NOTIFICATION_ERROR_INVALID_PARAMETER;
 
        noti->ongoing_value_type = type;
@@ -1354,7 +1357,7 @@ EXPORT_API int notification_set_ongoing_value_type(notification_h noti, notifica
        return NOTIFICATION_ERROR_NONE;
 }
 
-EXPORT_API int nofication_get_ongoing_time(notification_h noti, int *current, int *duration)
+EXPORT_API int notification_get_ongoing_time(notification_h noti, int *current, int *duration)
 {
        if (noti == NULL || current == NULL || duration == NULL)
                return NOTIFICATION_ERROR_INVALID_PARAMETER;
@@ -1370,8 +1373,41 @@ EXPORT_API int notification_set_ongoing_time(notification_h noti, int current, i
        if (noti == NULL)
                return NOTIFICATION_ERROR_INVALID_PARAMETER;
 
+       if (current < 0 || duration < 0 || current > duration)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
        noti->ongoing_current = current;
        noti->ongoing_duration = duration;
 
        return NOTIFICATION_ERROR_NONE;
 }
+
+EXPORT_API int notification_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 notification_set_hide_timeout(notification_h noti, int timeout)
+{
+       if (noti == NULL || timeout < 0)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+       noti->timeout = timeout;
+
+       return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int notification_get_text_input_max_length(notification_h noti, int *text_input_max_length)
+{
+       if (noti == NULL || text_input_max_length == NULL)
+               return NOTIFICATION_ERROR_INVALID_PARAMETER;
+
+       *text_input_max_length = noti->text_input_max_length;
+
+       return NOTIFICATION_ERROR_NONE;
+}