2 * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __NOTIFICATION_INTERNAL_H__
18 #define __NOTIFICATION_INTERNAL_H__
20 #include <sys/types.h>
22 #include <notification_error.h>
23 #include <notification_type.h>
24 #include <notification_list.h>
31 * @addtogroup NOTIFICATION_INTERNAL
34 #define NOTIFICATION_GLOBAL_UID -1
35 #define NOTIFICATION_DISPLAY_APP_HEADS_UP NOTIFICATION_DISPLAY_APP_ACTIVE /* To avoid build error */
36 #define NOTIFICATION_ERROR (notification_error_quark())
39 * @brief Enumeration for notification ongoing value type.
42 typedef enum _notification_ongoing_value_type {
43 NOTIFICATION_ONGOING_VALUE_TYPE_PERCENT = 0,
44 NOTIFICATION_ONGOING_VALUE_TYPE_TIME,
45 } notification_ongoing_value_type_e;
48 * @brief Enumeration for extension event type on notification.
50 * @see #notification_event_type_e
52 typedef enum _notification_event_type_extension {
53 NOTIFICATION_EVENT_TYPE_HIDDEN_BY_USER = 100,
54 NOTIFICATION_EVENT_TYPE_HIDDEN_BY_TIMEOUT = 101,
55 } notification_event_type_extension_e;
57 GQuark notification_error_quark(void);
60 * @brief This function add deferred task. the registered task will be executed when notification service become ready
61 * @param[in] deferred_task_cb The callback function
62 * @param[in] user_data The user data to be passed to the callback function
63 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
64 * @see #notification_error_e
65 * @see notification_is_service_ready()
67 int notification_add_deferred_task(
68 void (*deferred_task_cb)(void *data), void *user_data);
71 * @brief This function remove deferred task.
72 * @param[in] deferred_task_cb The callback function
73 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
74 * @see #notification_error_e
75 * @see notification_is_service_ready()
77 int notification_del_deferred_task(
78 void (*deferred_task_cb)(void *data));
82 * @brief This function will be removed.
83 * @see notification_unresister_changed_cb()
86 notification_resister_changed_cb(
87 void (*changed_cb)(void *data, notification_type_e type),
91 notification_resister_changed_cb_for_uid(
92 void (*changed_cb)(void *data, notification_type_e type),
93 void *user_data, uid_t uid);
95 * @brief This function will be removed.
96 * @see notification_resister_changed_cb()
99 notification_unresister_changed_cb(
100 void (*changed_cb)(void *data, notification_type_e type));
102 notification_unresister_changed_cb_for_uid(
103 void (*changed_cb)(void *data, notification_type_e type), uid_t uid);
106 * @brief Updates the progress of the inserted notification. This only works for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
107 * @details The Notification view on the notification area could be updated.
108 * @param[in] noti Notification handle or NULL if priv_id is valid
109 * @param[in] priv_id Private ID
110 * @param[in] progress Percentage value of progressive data
111 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
112 * @retval NOTIFICATION_ERROR_NONE Success
113 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
116 #include <notification.h>
119 int noti_err = NOTIFICATION_ERROR_NONE;
121 noti_err = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
122 if (noti_err != NOTIFICATION_ERROR_NONE) {
128 int notification_update_progress(notification_h noti,
133 * @brief Updates the size of inserted notification data. This only works for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
134 * @details Notification view on notification area could be updated.
135 * @param[in] noti Notification handle or NULL if priv_id is valid
136 * @param[in] priv_id Private ID
137 * @param[in] size Bytes of progressive data
138 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
139 * @retval NOTIFICATION_ERROR_NONE Success
140 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
143 #include <notification.h>
146 int noti_err = NOTIFICATION_ERROR_NONE;
148 noti_err = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
149 if (noti_err != NOTIFICATION_ERROR_NONE) {
155 int notification_update_size(notification_h noti,
156 int priv_id, double size);
159 * @brief Updates the content of the inserted notification data. This is only for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
160 * @details Notification view on notification area could be updated.
161 * @param[in] noti Notification handle or NULL if priv_id is valid
162 * @param[in] priv_id Private ID
163 * @param[in] content Text to update
164 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
165 * @retval NOTIFICATION_ERROR_NONE Success
166 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
169 #include <notification.h>
172 int noti_err = NOTIFICATION_ERROR_NONE;
174 noti_err = notification_update_content(NULL, APP_NOTI_PRIV_ID, "updated string");
175 if (noti_err != NOTIFICATION_ERROR_NONE) {
181 int notification_update_content(notification_h noti,
183 const char *content);
186 * @brief This function will be deprecated.
187 * @see notification_set_image()
190 NOTIFICATION_DEPRECATED_API int notification_set_icon(notification_h noti,
191 const char *icon_path);
194 * @brief This function will be deprecated.
195 * @see notification_get_image()
198 NOTIFICATION_DEPRECATED_API int notification_get_icon(notification_h noti,
202 * @brief This function will be deprecated.
203 * @see notification_set_text()
206 NOTIFICATION_DEPRECATED_API int notification_set_title(notification_h noti,
208 const char *loc_title);
211 * @brief This function will be deprecated.
212 * @see notification_get_text()
215 NOTIFICATION_DEPRECATED_API int notification_get_title(notification_h noti,
220 * @brief This function will be deprecated.
221 * @see notification_set_text()
224 NOTIFICATION_DEPRECATED_API int notification_set_content(notification_h noti,
226 const char *loc_content);
229 * @brief This function will be deprecated.
230 * @see notification_get_text()
233 NOTIFICATION_DEPRECATED_API int notification_get_content(notification_h noti,
238 * @brief This function will be removed.
239 * @see notification_set_execute_option()
242 NOTIFICATION_DEPRECATED_API int notification_set_application(notification_h noti, const char *pkgname); /* Do not use this */
245 * @brief This function will be removed.
246 * @see notification_get_execute_option()
249 NOTIFICATION_DEPRECATED_API int notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
252 * @brief This function will be deprecated.
253 * @see notification_set_execute_option()
256 NOTIFICATION_DEPRECATED_API int notification_set_args(notification_h noti, bundle *args, bundle *group_args); /* Do not use this */
259 * @brief This function will be deprecated.
260 * @see notification_get_execute_option()
263 NOTIFICATION_DEPRECATED_API int notification_get_args(notification_h noti, bundle **args, bundle **group_args); /* Do not use this */
266 * @brief This function is deprecated.
267 * @see notification_get_grouping_list()
270 NOTIFICATION_DEPRECATED_API int notification_get_grouping_list(notification_type_e type,
272 notification_list_h *list);
275 * @brief This function will be deprecated.
276 * @see notification_delete_by_priv_id()
279 NOTIFICATION_DEPRECATED_API int notification_delete_group_by_group_id(const char *pkgname,
280 notification_type_e type,
284 * @brief This function will be deprecated.
285 * @see notification_delete_by_priv_id()
288 NOTIFICATION_DEPRECATED_API int notification_delete_group_by_priv_id(const char *pkgname,
289 notification_type_e type,
292 * @brief This function will be deprecated.
295 NOTIFICATION_DEPRECATED_API int notification_get_count(notification_type_e type,
297 int group_id, int priv_id,
301 * @brief This function will be deprecated.
304 NOTIFICATION_DEPRECATED_API int notifiation_clear(notification_type_e type);
308 * @brief This function will be deprecated.
309 * @details Use only for the notification tray's clear button operation.
310 * @param[in] type Notification type
311 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
312 * @retval NOTIFICATION_ERROR_NONE Success
313 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
314 * @see #notification_type_e
317 #include <notification.h>
320 int noti_err = NOTIFICATION_ERROR_NONE;
322 noti_err = notification_clear(NOTIFICATION_TYPE_NOTI);
323 if (noti_err != NOTIFICATION_ERROR_NONE) {
329 NOTIFICATION_DEPRECATED_API int notification_clear(notification_type_e type);
333 * @brief This function will be deprecated.
334 * @return 1 on ready, other value on not ready
336 NOTIFICATION_DEPRECATED_API int notification_is_service_ready(void);
340 * @brief This function will be deprecated.
341 * @param[in] list Notification list handle
342 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
343 * @retval NOTIFICATION_ERROR_NONE Success
344 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
345 * @pre notification_get_grouping_list() or notification_get_detail_list().
346 * @see #notification_op
348 NOTIFICATION_DEPRECATED_API int notification_op_get_data(notification_op *noti_op,
349 notification_op_data_type_e type,
354 * @brief This function will be deprecated.
355 * @details Caller_pkgname is set automatically when notification_new() is called. We do not recommend to use this API.
356 * @param[in] noti Notification handle
357 * @param[in] pkgname Caller package name
358 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
359 * @retval NOTIFICATION_ERROR_NONE Success
360 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
363 #include <notification.h>
366 notification_h noti = NULL;
367 int noti_err = NOTIFICATION_ERROR_NONE;
369 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
374 noti_err = notification_set_pkgname(noti, "org.tizen.phone");
375 if (noti_err != NOTIFICATION_ERROR_NONE) {
376 notification_free(noti);
382 NOTIFICATION_DEPRECATED_API int notification_set_pkgname(notification_h noti,
383 const char *pkgname);
387 * @brief This function will be deprecated.
388 * @details If @a pkgname is NULL, caller_pkgname is set internally.
389 * @param[in] pkgname Caller application package name or NULL
390 * @param[in] type Notification type
391 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
392 * @retval NOTIFICATION_ERROR_NONE Success
393 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
396 #include <notification.h>
399 int noti_err = NOTIFICATION_ERROR_NONE;
401 noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
402 if (noti_err != NOTIFICATION_ERROR_NONE) {
408 NOTIFICATION_DEPRECATED_API int notification_delete_all_by_type(const char *pkgname,
409 notification_type_e type);
413 * @brief This function will be deprecated.
414 * @details If @a pkgname is NULL, caller_pkgname is set internally.
415 * @param[in] pkgname Caller application package name or NULL
416 * @param[in] type Notification type
417 * @param[in] priv_id Priv ID
418 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
419 * @retval NOTIFICATION_ERROR_NONE Success
420 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
423 #include <notification.h>
426 int noti_err = NOTIFICATION_ERROR_NONE;
428 noti_err = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
429 if (noti_err != NOTIFICATION_ERROR_NONE) {
435 NOTIFICATION_DEPRECATED_API int notification_delete_by_priv_id(const char *pkgname,
436 notification_type_e type,
441 * @brief This function will be deprecated.
442 * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
443 * @param[in] noti Notification handle
444 * @param[in] type Notification execute type
445 * @param[in] text Basic text for button
446 * @param[in] key Value for localized text
447 * @param[in] service_handle Appsvc bundle data
448 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
449 * @retval NOTIFICATION_ERROR_NONE Success
450 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
453 #include <notification.h>
456 notification_h noti = NULL;
457 int noti_err = NOTIFICATION_ERROR_NONE;
463 appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
464 appsvc_set_uri(b,"http://www.samsung.com");
466 noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
467 if (noti_err != NOTIFICATION_ERROR_NONE) {
468 notification_free(noti);
476 NOTIFICATION_DEPRECATED_API int notification_set_execute_option(notification_h noti,
477 notification_execute_type_e type,
480 bundle *service_handle);
484 * @brief This function will be deprecated.
485 * @remarks ID is valid only after inserting the notification.
486 * @param[in] noti Notification handle
487 * @param[out] group_id Group ID
488 * @param[out] priv_id Private ID
489 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
490 * @retval NOTIFICATION_ERROR_NONE Success
491 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
494 #include <notification.h>
497 int noti_err = NOTIFICATION_ERROR_NONE;
498 int group_id, priv_id;
500 noti_err = notification_get_id(noti, &group_id, &priv_id);
501 if (noti_err != NOTIFICATION_ERROR_NONE) {
507 NOTIFICATION_DEPRECATED_API int notification_get_id(notification_h noti,
508 int *group_id, int *priv_id);
512 * @brief This function will be deprecated.
513 * @param[in] type Notification type
514 * @param[in] group_id Group ID
515 * @param[in] priv_id Priv ID
516 * @return Notification handle(#notification_h) on success, NULL on failure
517 * @retval #notification_h Success
518 * @retval NULL Failure
519 * @see #notification_type_e
520 * @see #notification_h
523 #include <notification.h>
526 notification_h noti = NULL;
528 noti = notification_load("org.tizen.app", priv_id);
536 NOTIFICATION_DEPRECATED_API notification_h notification_load(char *pkgname,
541 * @brief This function will be deprecated.
542 * @details Available types are #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
543 * #NOTIFICATION_TYPE_NOTI is remaining notification data even if device is restarted.
544 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
545 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouped. #NOTIFICATION_GROUP_ID_DEFAULT,
546 * notification data is grouped with same title. Positive number ( > 0 ) is grouped with same number.
547 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
548 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
549 * @param[in] type Notification type
550 * @param[in] group_id Group ID
551 * @param[in] priv_id Priv ID
552 * @return Notification handle(#notification_h) on success, NULL on failure
553 * @retval #notification_h Success
554 * @retval NULL Failure
555 * @see #notification_type_e
556 * @see #notification_h
559 #include <notification.h>
562 notification_h noti = NULL;
564 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
572 NOTIFICATION_DEPRECATED_API notification_h notification_new(notification_type_e type, int group_id,
577 * @brief This function will be deprecated.
578 * @param[in] noti Notification handle
579 * @param[in] type Notification execute type
580 * @param[out] text Text for button
581 * @param[out] service_handle Appsvc bundle data
582 * @return NOTIFICATION_ERROR_NONE on success, other value on failure
583 * @retval NOTIFICATION_ERROR_NONE Success
584 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
587 #include <notification.h>
590 notification_h noti = NULL;
591 int noti_err = NOTIFICATION_ERROR_NONE;
596 noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
597 if (noti_err != NOTIFICATION_ERROR_NONE) {
598 notification_free(noti);
604 NOTIFICATION_DEPRECATED_API int notification_get_execute_option(notification_h noti,
605 notification_execute_type_e type,
607 bundle **service_handle);
611 * @brief Inserts a notification.
612 * @details The notification will be inserted to the database and then it will appear in the notification area.
613 * When notification_create() is called, if priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id returns the internally set priv_id.
614 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
616 * @privilege %http://tizen.org/privilege/notification
617 * @param[in] noti The notification handle
618 * @param[out] priv_id The private ID
619 * @return #NOTIFICATION_ERROR_NONE on success,
620 * otherwise any other value on failure
621 * @retval #NOTIFICATION_ERROR_NONE Success
622 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
623 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
624 * @pre Notification handle should be created by notification_create().
625 * @post notification_free().
628 #include <notification.h>
631 int noti_err = NOTIFICATION_ERROR_NONE;
633 noti_err = notification_insert(noti, NULL);
634 if (noti_err != NOTIFICATION_ERROR_NONE) {
640 int notification_insert(notification_h noti,
643 int notification_insert_for_uid(notification_h noti,
644 int *priv_id, uid_t uid);
648 * @brief Updates a notification, asynchronously.
649 * @details The updated notification will appear in the notification area.
650 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
652 * @privilege %http://tizen.org/privilege/notification
653 * @remarks This function updates the notification asynchronously.
654 * @param[in] noti The notification handle that is created by notification_create()
655 * @param[in] result_cb The callback called when an update completed
656 * @param[in] user_data The user data which you want to use in callback
657 * @return #NOTIFICATION_ERROR_NONE on success,
658 * otherwise any other value on failure
659 * @retval #NOTIFICATION_ERROR_NONE Success
660 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
661 * @retval #NOTIFICATION_ERROR_NOT_EXIST_ID Priv ID does not exist
662 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
665 #include <notification.h>
668 int noti_err = NOTIFICATION_ERROR_NONE;
670 noti_err = notification_update_async(NULL, result_cb, data);
671 if (noti_err != NOTIFICATION_ERROR_NONE) {
677 int notification_update_async(notification_h noti,
678 void (*result_cb)(int priv_id, int result, void *data), void *user_data);
679 int notification_update_async_for_uid(notification_h noti,
680 void (*result_cb)(int priv_id, int result, void *data), void *user_data, uid_t uid);
684 * @brief Registers a callback for all notification events.
685 * @details The registered callback could be called for all notification events.
686 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
688 * @privilege %http://tizen.org/privilege/notification
689 * @param[in] changed_cb The callback function
690 * @param[in] user_data The user data
691 * @return #NOTIFICATION_ERROR_NONE on success,
692 * otherwise any other value on failure
693 * @retval #NOTIFICATION_ERROR_NONE Success
694 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
695 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
696 * @see notification_unregister_detailed_changed_cb()
699 #include <notification.h>
702 noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
703 if (noti_err != NOTIFICATION_ERROR_NONE) {
709 int notification_register_detailed_changed_cb(
710 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
712 int notification_register_detailed_changed_cb_for_uid(
713 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
714 void *user_data, uid_t uid);
718 * @brief Unregisters a callback for all notification events.
719 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
721 * @privilege %http://tizen.org/privilege/notification
722 * @param[in] changed_cb The callback function
723 * @return #NOTIFICATION_ERROR_NONE on success,
724 * otherwise any other value on failure
725 * @retval #NOTIFICATION_ERROR_NONE Success
726 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
727 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
728 * @see notification_register_detailed_changed_cb()
731 #include <notification.h>
734 noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
735 if (noti_err != NOTIFICATION_ERROR_NONE) {
741 int notification_unregister_detailed_changed_cb(
742 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
744 int notification_unregister_detailed_changed_cb_for_uid(
745 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
746 void *user_data, uid_t uid);
748 * @brief Sets the default button to display highlight on the notification.
750 * @remarks If you want to default button is off, you set that index is zero
751 * @param[in] noti The notification handle
752 * @param[in] index The notification button index
753 * @return #NOTIFICATION_ERROR_NONE on success,
754 * otherwise any other value on failure
755 * @retval #NOTIFICATION_ERROR_NONE Success
756 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
757 * @pre Notification handle should be created by notification_create().
758 * @see #notification_button_index_e
761 #include <notification.h>
764 notification_h noti = NULL;
765 int noti_err = NOTIFICATION_ERROR_NONE;
767 noti = notification_create(NOTIFICATION_TYPE_NOTI);
772 noti_err = notification_set_default_button(noti, NOTIFICATION_BUTTON_1);
773 if(noti_err != NOTIFICATION_ERROR_NONE) {
774 notification_free(noti);
783 int notification_set_default_button(notification_h noti, notification_button_index_e index);
786 * @brief Gets the default button to display highlight on the notification.
788 * @param[in] noti The notification handle
789 * @param[out] index The notification button index
790 * @return #NOTIFICATION_ERROR_NONE on success,
791 * otherwise any other value on failure
792 * @retval #NOTIFICATION_ERROR_NONE Success
793 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
794 * @pre Notification handle should be created by notification_create().
795 * @see #notification_button_index_e
798 #include <notification.h>
801 notification_h noti = NULL;
802 notification_button_index_e index;
803 int noti_err = NOTIFICATION_ERROR_NONE;
805 noti = notification_create(NOTIFICATION_TYPE_NOTI);
810 noti_err = notification_set_default_button(noti, &index);
811 if(noti_err != NOTIFICATION_ERROR_NONE) {
812 notification_free(noti);
821 int notification_get_default_button(notification_h noti, notification_button_index_e *index);
824 * @brief Gets the notification ongoing value type.
826 * @param[in] noti The notification handle
827 * @param[out] type The notification ongoing value type
828 * @return #NOTIFICATION_ERROR_NONE on success,
829 * otherwise any other value on failure
830 * @retval #NOTIFICATION_ERROR_NONE Success
831 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
832 * @pre Notification handle should be created by notification_create().
833 * @see #notification_ongoing_value_type_e
836 #include <notification.h>
839 notification_h noti = NULL;
840 notification_ongoing_value_type_e type;
841 int noti_err = NOTIFICATION_ERROR_NONE;
843 noti = notification_create(NOTIFICATION_TYPE_NOTI);
848 noti_err = notification_get_ongoing_value_type(noti, &type);
849 if (noti_err != NOTIFICATION_ERROR_NONE) {
850 notification_free(noti);
856 int notification_get_ongoing_value_type(notification_h noti, notification_ongoing_value_type_e *type);
859 * @brief Sets the notification ongoing value type.
861 * @param[in] noti The notification handle
862 * @param[in] type The notification ongoing value type
863 * @return #NOTIFICATION_ERROR_NONE on success,
864 * otherwise any other value on failure
865 * @retval #NOTIFICATION_ERROR_NONE Success
866 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
867 * @pre Notification handle should be created by notification_create().
868 * @see #notification_ongoing_value_type_e
871 #include <notification.h>
874 notification_h noti = NULL;
875 notification_ongoing_value_type_e type;
876 int noti_err = NOTIFICATION_ERROR_NONE;
878 noti = notification_create(NOTIFICATION_TYPE_NOTI);
883 type = NOTIFICATION_ONGOING_VALUE_TYPE_TIME;
885 noti_err = notification_set_ongoing_value_type(noti, type);
886 if (noti_err != NOTIFICATION_ERROR_NONE) {
887 notification_free(noti);
893 int notification_set_ongoing_value_type(notification_h noti, notification_ongoing_value_type_e type);
896 * @brief Gets the notification ongoing time when ongoint type value is set NOTIFICATION_ONGOING_VALUE_TYPE_TIME.
898 * @param[in] noti The notification handle
899 * @param[out] current The ongoing current time
900 * @param[out] duration The ongoing duration time
901 * @return #NOTIFICATION_ERROR_NONE on success,
902 * otherwise any other value on failure
903 * @retval #NOTIFICATION_ERROR_NONE Success
904 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
905 * @pre Notification handle should be created by notification_create().
906 * @see #notification_ongoing_value_type_e
909 #include <notification.h>
912 notification_h noti = NULL;
913 int noti_err = NOTIFICATION_ERROR_NONE;
917 noti = notification_create(NOTIFICATION_TYPE_NOTI);
922 noti_err = notification_get_ongoing_time(noti, ¤t, &duration);
923 if (noti_err != NOTIFICATION_ERROR_NONE) {
924 notification_free(noti);
930 int notification_get_ongoing_time(notification_h noti, int *current, int *duration);
933 * @brief Sets the notification ongoing time when ongoint type value is set NOTIFICATION_ONGOING_VALUE_TYPE_TIME.
935 * @param[in] noti The notification handle
936 * @param[in] current The ongoing current time
937 * @param[in] duration The ongoing duration time
938 * @return #NOTIFICATION_ERROR_NONE on success,
939 * otherwise any other value on failure
940 * @retval #NOTIFICATION_ERROR_NONE Success
941 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
942 * @pre Notification handle should be created by notification_create().
943 * @see #notification_ongoing_value_type_e
946 #include <notification.h>
949 notification_h noti = NULL;
950 int noti_err = NOTIFICATION_ERROR_NONE;
954 noti = notification_create(NOTIFICATION_TYPE_NOTI);
962 noti_err = notification_set_ongoing_time(noti, current, duration)
963 if (noti_err != NOTIFICATION_ERROR_NONE) {
964 notification_free(noti);
970 int notification_set_ongoing_time(notification_h noti, int current, int duration);
973 * @brief Gets the time that notification is hidden.
975 * @param[in] noti The notification handle
976 * @param[out] timeout The timeout time
977 * @return #NOTIFICATION_ERROR_NONE on success,
978 * otherwise any other value on failure
979 * @retval #NOTIFICATION_ERROR_NONE Success
980 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
981 * @pre Notification handle should be created by notification_create().
982 * @see #notification_event_type_extension_e
985 #include <notification.h>
988 notification_h noti = NULL;
989 int noti_err = NOTIFICATION_ERROR_NONE;
992 noti = notification_create(NOTIFICATION_TYPE_NOTI);
997 noti_err = notification_get_hide_timeout(noti, &timeout)
998 if (noti_err != NOTIFICATION_ERROR_NONE) {
999 notification_free(noti);
1005 int notification_get_hide_timeout(notification_h noti, int *timeout);
1008 * @brief Sets the time that notification is hidden.
1010 * @param[in] noti The notification handle
1011 * @param[in] timeout The timeout time
1012 * @return #NOTIFICATION_ERROR_NONE on success,
1013 * otherwise any other value on failure
1014 * @retval #NOTIFICATION_ERROR_NONE Success
1015 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1016 * @pre Notification handle should be created by notification_create().
1017 * @see #notification_event_type_extension_e
1020 #include <notification.h>
1023 notification_h noti = NULL;
1024 int noti_err = NOTIFICATION_ERROR_NONE;
1026 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1031 noti_err = notification_set_hide_timeout(noti, 10)
1032 if (noti_err != NOTIFICATION_ERROR_NONE) {
1033 notification_free(noti);
1039 int notification_set_hide_timeout(notification_h noti, int timeout);
1042 * @brief This function translate localized texts
1043 * @param[in] noti The notification handle that is created by notification_create()
1044 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
1045 * @see notification_create()
1047 int notification_translate_localized_text(notification_h noti);
1048 int notification_set_uid(notification_h noti, uid_t uid);
1049 int notification_get_uid(notification_h noti, uid_t *uid);
1050 int notification_post_for_uid(notification_h noti, uid_t uid);
1051 int notification_update_for_uid(notification_h noti, uid_t uid);
1052 int notification_delete_for_uid(notification_h noti, uid_t uid);
1053 int notification_delete_all_for_uid(notification_type_e type, uid_t uid);
1054 notification_h notification_load_by_tag_for_uid(const char *tag, uid_t uid);
1055 notification_h notification_create_from_package_template(const char *pkgname,
1056 const char *template_name);
1058 * @brief Gets a max length of text input.
1060 * @return #NOTIFICATION_ERROR_NONE on success,
1061 * otherwise any other value on failure
1062 * @retval #NOTIFICATION_ERROR_NONE Success
1063 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1066 #include <notification.h>
1069 int noti_err = NOTIFICATION_ERROR_NONE;
1070 int text_input_max_length;
1072 noti_err = notification_get_text_input_max_length(noti, &text_input_max_length);
1073 if (noti_err != NOTIFICATION_ERROR_NONE) {
1080 int notification_get_text_input_max_length(notification_h noti, int *text_input_max_length);