4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>, Youngsub Ko <ys4610.ko@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
22 #ifndef __NOTIFICATION_H__
23 #define __NOTIFICATION_H__
28 #include <notification_error.h>
29 #include <notification_type.h>
30 #include <notification_list.h>
31 #include <notification_status.h>
38 * @defgroup NOTIFICATION_LIBRARY Notification Library
39 * @brief This notification library provides UI notification event. Inserted notification event is displaying Notification Tray, Indicator, etc.
43 * @ingroup NOTIFICATION_LIBRARY
44 * @defgroup NOTIFICATION notification core API
45 * @brief Notification core API
49 * @addtogroup NOTIFICATION
54 * @brief This function will be deprecated.
55 * @see notification_set_image()
58 notification_error_e notification_set_icon(notification_h noti,
59 const char *icon_path);
62 * @brief This function will be deprecated.
63 * @see notification_get_image()
66 notification_error_e notification_get_icon(notification_h noti,
70 * @brief This function set image path according to type.
73 * @param[in] noti notification handle
74 * @param[in] type notification image type
75 * @param[in] image_path image file full path
76 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
77 * @retval NOTIFICATION_ERROR_NONE - success
78 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
79 * @pre Notification handle should be created by notification_new()
81 * @see #notification_image_type_e
82 * @see notification_new()
85 #include <notification.h>
88 notification_h noti = NULL;
89 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
91 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
96 noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, APP_IMAGE_FULL_PATH);
97 if(noti_err != NOTIFICATION_ERROR_NONE) {
98 notification_free(noti);
104 notification_error_e notification_set_image(notification_h noti,
105 notification_image_type_e type,
106 const char *image_path);
109 * @brief This function get image path according to type.
111 * @remarks Do not free image_path. It will be freed when notification_free() or notification_free_list().
112 * @param[in] noti notification handle
113 * @param[in] type notification image type
114 * @param[out] image_path image file full path
115 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
116 * @retval NOTIFICATION_ERROR_NONE - success
117 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
118 * @pre Notification handle should be created by notification_new()
120 * @see #notification_image_type_e
121 * @see notification_new()
124 #include <notification.h>
127 char *image_path = NULL;
128 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
130 noti_err = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
131 if(noti_err != NOTIFICATION_ERROR_NONE) {
137 notification_error_e notification_get_image(notification_h noti,
138 notification_image_type_e type,
142 * @brief This function set time infomation.
143 * @details If input_time is 0, time information is set by current time.
145 * @param[in] noti notification handle
146 * @param[in] input_time input time
147 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
148 * @retval NOTIFICATION_ERROR_NONE - success
149 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
150 * @pre Notification handle should be created by notification_new()
152 * @see notification_new()
155 #include <notification.h>
158 notification_h noti = NULL;
159 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
161 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
166 noti_err = notification_set_time(noti, time(NULL));
167 if(noti_err != NOTIFICATION_ERROR_NONE) {
168 notification_free(noti);
174 notification_error_e notification_set_time(notification_h noti,
178 * @brief This function get time information.
179 * @details If ret_time is 0, time information is not set before.
181 * @param[in] noti notification handle
182 * @param[out] ret_time return time value
183 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
184 * @retval NOTIFICATION_ERROR_NONE - success
185 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
186 * @pre Notification handle should be created by notification_new()
188 * @see notification_new()
191 #include <notification.h>
195 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
197 noti_err = notification_get_time(noti, &ret_time);
198 if(noti_err != NOTIFICATION_ERROR_NONE) {
204 notification_error_e notification_get_time(notification_h noti,
208 * @brief This function get insert time information.
209 * @details If ret_time is 0, this notification data is not inserted before.
211 * @param[in] noti notification handle
212 * @param[out] ret_time return time value
213 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
214 * @retval NOTIFICATION_ERROR_NONE - success
215 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
221 #include <notification.h>
225 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
227 noti_err = notification_get_insert_time(noti, &ret_time);
228 if(noti_err != NOTIFICATION_ERROR_NONE) {
234 notification_error_e notification_get_insert_time(notification_h noti,
238 * @brief This function will be deprecated.
239 * @see notification_set_text()
242 notification_error_e notification_set_title(notification_h noti,
244 const char *loc_title);
247 * @brief This function will be deprecated.
248 * @see notification_get_text()
251 notification_error_e notification_get_title(notification_h noti,
256 * @brief This function will be deprecated.
257 * @see notification_set_text()
260 notification_error_e notification_set_content(notification_h noti,
262 const char *loc_content);
265 * @brief This function will be deprecated.
266 * @see notification_get_text()
269 notification_error_e notification_get_content(notification_h noti,
274 * @brief This function set text.
275 * @details Set title, content string. If text is formated data(only support %d, %f, %s), type - value pair should be set.
276 * If %d, type NOTIFICATION_VARIABLE_TYPE_INT and value is integer value.
277 * If %f, type NOTIFICATION_VARIABLE_TYPE_DOUBLE and value is double value.
278 * If %s, type NOTIFICATION_VARIABLE_TYPE_STRING and value is character string.
279 * If type is NOTIFICATION_VARIABLE_TYPE_COUNT, notification count is displaying with text.
280 * If value is NOTIFICATION_COUNT_POS_LEFT, count is displaying at the left of the text.
281 * If value is NOTIFICATION_COUNT_POS_IN, count is displaying in the text that text has %d format.
282 * If value is NOTIFICATION_COUNT_POS_RIGHT, count is displaying at the right of the text.
283 * Variable parameter should be terminated NOTIFICATION_VARIABLE_TYPE_NONE.
285 * @param[in] noti notification handle
286 * @param[in] type notification text type
287 * @param[in] text basic text
288 * @param[in] key text key for localization
289 * @param[in] args_type variable parameter that type - value pair.
290 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
291 * @retval NOTIFICATION_ERROR_NONE - success
292 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
293 * @pre notification handle should be created by notification_new().
298 #include <notification.h>
301 notification_h noti = NULL;
302 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
304 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
309 noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "I'm Title", "IDS_APP_BODY_IM_TITLE", NOTIFICATION_VARIABLE_TYPE_NONE);
310 if(noti_err != NOTIFICATION_ERROR_NONE) {
311 notification_free(noti);
317 notification_error_e notification_set_text(notification_h noti,
318 notification_text_type_e type,
324 * @brief This function get text.
327 * @param[in] noti notification handle
328 * @param[in] type notification text type.
329 * @param[out] text text
330 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
331 * @retval NOTIFICATION_ERROR_NONE - success
332 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
338 #include <notification.h>
341 notification_h noti = NULL;
342 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
345 noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
346 if(noti_err != NOTIFICATION_ERROR_NONE) {
352 notification_error_e notification_get_text(notification_h noti,
353 notification_text_type_e type,
357 * @brief This function set timestamp to text. the timestamp value will be converted to string
360 * @param[in] noti notification handle
361 * @param[in] type notification text type
362 * @param[in] time time stamp
363 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
364 * @retval NOTIFICATION_ERROR_NONE - success
365 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
366 * @pre notification handle should be created by notification_new().
370 notification_error_e notification_set_time_to_text(notification_h noti, notification_text_type_e type,
374 * @brief This function get timestamp from text
377 * @param[in] noti notification handle
378 * @param[in] type notification text type
379 * @param[in] time pointer of time stamp
380 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
381 * @retval NOTIFICATION_ERROR_NONE - success
382 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
383 * @pre notification handle should be created by notification_new().
387 notification_error_e notification_get_time_from_text(notification_h noti, notification_text_type_e type,
391 * @brief This function set text domain.
394 * @param[in] noti notification handle
395 * @param[in] domain text domain
396 * @param[in] dir text dir
397 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
398 * @retval NOTIFICATION_ERROR_NONE - success
399 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
405 #include <notification.h>
408 notification_h noti = NULL;
409 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
411 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
416 noti_err = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
417 if(noti_err != NOTIFICATION_ERROR_NONE) {
418 notification_free(noti);
424 notification_error_e notification_set_text_domain(notification_h noti,
429 * @brief This function get text domain.
431 * @remarks Do not free returned domain and dir. These are freed when notification_free or notification_free_list.
432 * @param[in] noti notification handle
433 * @param[out] domain domain
434 * @param[out] dir locale dir
435 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
436 * @retval NOTIFICATION_ERROR_NONE - success
437 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
443 #include <notification.h>
446 notification_h noti = NULL;
447 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
451 noti_err = notification_get_text_domain(noti, &domain, &dir);
452 if(noti_err != NOTIFICATION_ERROR_NONE) {
458 notification_error_e notification_get_text_domain(notification_h noti,
463 * @brief This function set notification sound.
466 * @param[in] noti notification handle
467 * @param[in] type notification sound type
468 * @param[in] path user sound file path
469 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
470 * @retval NOTIFICATION_ERROR_NONE - success
471 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
477 #include <notification.h>
480 notification_h noti = NULL;
481 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
483 noti_err = notification_set_sound(noti, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL);
484 if(noti_err != NOTIFICATION_ERROR_NONE) {
490 notification_error_e notification_set_sound(notification_h noti,
491 notification_sound_type_e type,
495 * @brief This function get notification sound.
498 * @param[in] noti notification handle
499 * @param[out] type notification sound type
500 * @param[out] path user sound file path
501 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
502 * @retval NOTIFICATION_ERROR_NONE - success
503 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
509 #include <notification.h>
512 notification_h noti = NULL;
513 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
514 notification_sound_type_e type = NOTIFICATION_SOUND_TYPE_NONE;
516 noti_err = notification_get_sound(noti, &type, NULL);
517 if(noti_err != NOTIFICATION_ERROR_NONE) {
523 notification_error_e notification_get_sound(notification_h noti,
524 notification_sound_type_e *type,
528 * @brief This function set notification vibration.
531 * @param[in] noti notification handle
532 * @param[in] type notification vibration type
533 * @param[in] path user vibration file path
534 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
535 * @retval NOTIFICATION_ERROR_NONE - success
536 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
542 #include <notification.h>
545 notification_h noti = NULL;
546 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
548 noti_err = notification_set_vibration(noti, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
549 if(noti_err != NOTIFICATION_ERROR_NONE) {
555 notification_error_e notification_set_vibration(notification_h noti,
556 notification_vibration_type_e type,
560 * @brief This function get notification vibration.
563 * @param[in] noti notification handle
564 * @param[out] type notification sound type
565 * @param[out] path user vibration file path
566 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
567 * @retval NOTIFICATION_ERROR_NONE - success
568 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
574 #include <notification.h>
577 notification_h noti = NULL;
578 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
579 notification_vibration_type_e type = NOTIFICATION_VIBRATION_TYPE_NONE;
581 noti_err = notification_get_vibration(noti, &type, NULL);
582 if(noti_err != NOTIFICATION_ERROR_NONE) {
588 notification_error_e notification_get_vibration(notification_h noti,
589 notification_vibration_type_e *type,
593 * @brief This function set led notification.
596 * @param[in] noti notification handle
597 * @param[in] operation led notification operation
598 * @param[in] led_argb notification led color
599 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
600 * @retval NOTIFICATION_ERROR_NONE - success
601 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
607 #include <notification.h>
610 notification_h noti = NULL;
611 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
613 noti_err = notification_set_led(noti, NOTIFICATION_LED_TYPE_DEFAULT, NULL);
614 if(noti_err != NOTIFICATION_ERROR_NONE) {
620 notification_error_e notification_set_led(notification_h noti,
621 notification_led_op_e operation,
625 * @brief This function get notification led.
628 * @param[in] noti notification handle
629 * @param[out] operation led notification operation
630 * @param[out] led_argb notification led color
631 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
632 * @retval NOTIFICATION_ERROR_NONE - success
633 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
639 #include <notification.h>
642 notification_h noti = NULL;
643 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
644 notification_led_type_e type = NOTIFICATION_LED_TYPE_NONE;
646 noti_err = notification_get_led(noti, &type, NULL);
647 if(noti_err != NOTIFICATION_ERROR_NONE) {
653 notification_error_e notification_get_led(notification_h noti,
654 notification_led_op_e *operation,
658 * @brief This function set time period of flashing LED
661 * @param[in] noti notification handle
662 * @param[in] on_ms time for turning on the LED
663 * @param[in] off_ms time for turning on the LED
664 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
665 * @retval NOTIFICATION_ERROR_NONE - success
666 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
672 #include <notification.h>
675 notification_h noti = NULL;
676 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
678 noti_err = notification_set_led_time_period(noti, 100, 100);
679 if(noti_err != NOTIFICATION_ERROR_NONE) {
685 notification_error_e notification_set_led_time_period(notification_h noti,
686 int on_ms, int off_ms);
689 * @brief This function get time period of flashing LED
692 * @param[in] noti notification handle
693 * @param[out] on_ms time for turning on the LED
694 * @param[out] off_ms time for turning on the LED
695 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
696 * @retval NOTIFICATION_ERROR_NONE - success
697 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
703 #include <notification.h>
706 notification_h noti = NULL;
707 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
711 noti_err = notification_get_led_time_period(noti, &led_on_ms, &led_off_ms);
712 if(noti_err != NOTIFICATION_ERROR_NONE) {
718 notification_error_e notification_get_led_time_period(notification_h noti,
719 int *on_ms, int *off_ms);
722 * @brief This function will be deprecated.
723 * @see notification_set_execute_option()
726 notification_error_e notification_set_application(notification_h noti, const char *pkgname); /* Do not use this */
729 * @brief This function will be deprecated.
730 * @see notification_get_execute_option()
733 notification_error_e notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
736 * @brief This function will be deprecated.
737 * @see notification_set_execute_option()
740 notification_error_e notification_set_args(notification_h noti, bundle * args, bundle * group_args); /* Do not use this */
743 * @brief This function will be deprecated.
744 * @see notification_get_execute_option()
747 notification_error_e notification_get_args(notification_h noti, bundle ** args, bundle ** group_args); /* Do not use this */
750 * @brief This function set execute option.
751 * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
753 * @param[in] noti notification handle
754 * @param[in] type notification execute type
755 * @param[in] text basic text for button
756 * @param[in] key value for localizaed text
757 * @param[in] service_handle appsvc bundle data
758 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
759 * @retval NOTIFICATION_ERROR_NONE - success
760 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
766 #include <notification.h>
769 notification_h noti = NULL;
770 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
776 appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
777 appsvc_set_uri(b,"http://www.samsung.com");
779 noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
780 if(noti_err != NOTIFICATION_ERROR_NONE) {
781 notification_free(noti);
789 notification_error_e notification_set_execute_option(notification_h noti,
790 notification_execute_type_e type,
793 bundle *service_handle);
796 * @brief This function get execute option.
799 * @param[in] noti notification handle
800 * @param[in] type notification execute type
801 * @param[out] text text for button
802 * @param[out] service_handle appsvc bundle data
803 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
804 * @retval NOTIFICATION_ERROR_NONE - success
805 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
811 #include <notification.h>
814 notification_h noti = NULL;
815 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
820 noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
821 if(noti_err != NOTIFICATION_ERROR_NONE) {
822 notification_free(noti);
828 notification_error_e notification_get_execute_option(notification_h noti,
829 notification_execute_type_e type,
831 bundle **service_handle);
834 * @brief This function set notification property.
837 * @param[in] noti notification handle
838 * @param[in] flags property with | operation
839 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
840 * @retval NOTIFICATION_ERROR_NONE - success
841 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
847 #include <notification.h>
850 notification_h noti = NULL;
851 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
854 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
859 noti_err = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
860 if(noti_err != NOTIFICATION_ERROR_NONE) {
861 notification_free(noti);
867 notification_error_e notification_set_property(notification_h noti,
871 * @brief This function get notification property.
874 * @param[in] noti notification handle
875 * @param[out] flags notification property
876 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
877 * @retval NOTIFICATION_ERROR_NONE - success
878 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
884 #include <notification.h>
887 notification_h noti = NULL;
888 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
891 noti_err = notification_get_property(noti, &flags);
892 if(noti_err != NOTIFICATION_ERROR_NONE) {
898 notification_error_e notification_get_property(notification_h noti,
902 * @brief This function set display application list.
903 * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
905 * @param[in] noti notification handle
906 * @param[in] applist with | operation
907 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
908 * @retval NOTIFICATION_ERROR_NONE - success
909 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
915 #include <notification.h>
918 notification_h noti = NULL;
919 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
922 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
927 noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
928 if(noti_err != NOTIFICATION_ERROR_NONE) {
929 notification_free(noti);
936 notification_error_e notification_set_display_applist(notification_h noti,
940 * @brief This function get display application list.
943 * @param[in] noti notification handle
944 * @param[out] applist display application list.
945 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
946 * @retval NOTIFICATION_ERROR_NONE - success
947 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
953 #include <notification.h>
956 notification_h noti = NULL;
957 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
960 noti_err = notification_get_display_applist(noti, &applist);
961 if(noti_err != NOTIFICATION_ERROR_NONE) {
967 notification_error_e notification_get_display_applist(notification_h noti,
971 * @brief This function set initial size for ongoing type.
972 * @details After notification_insert, it does not upate size. If you want to update size, please call notification_update_size().
974 * @param[in] noti notification handle
975 * @param[in] size double type size.
976 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
977 * @retval NOTIFICATION_ERROR_NONE - success
978 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
984 #include <notification.h>
987 notification_h noti = NULL;
988 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
990 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
995 noti_err = notification_set_size(noti, 0.0);
996 if(noti_err != NOTIFICATION_ERROR_NONE) {
997 notification_free(noti);
1003 notification_error_e notification_set_size(notification_h noti,
1007 * @brief This function get progress size.
1010 * @param[in] noti notification handle
1011 * @param[out] size progress size
1012 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1013 * @retval NOTIFICATION_ERROR_NONE - success
1014 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1020 #include <notification.h>
1023 notification_h noti = NULL;
1024 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1027 noti_err = notification_get_size(noti, &size);
1028 if(noti_err != NOTIFICATION_ERROR_NONE) {
1034 notification_error_e notification_get_size(notification_h noti,
1038 * @brief This function set initial progress for ongoing type.
1039 * @details After notification_insert, it does not upate progress. If you want to update progress, please call notification_update_progress().
1041 * @param[in] noti notification handle
1042 * @param[in] percentage progress percentage
1043 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1044 * @retval NOTIFICATION_ERROR_NONE - success
1045 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1051 #include <notification.h>
1054 notification_h noti = NULL;
1055 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1057 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1062 noti_err = notification_set_progress(noti, 0.0);
1063 if(noti_err != NOTIFICATION_ERROR_NONE) {
1064 notification_free(noti);
1070 notification_error_e notification_set_progress(notification_h noti,
1074 * @brief This function get progress percentage.
1077 * @param[in] noti notification handle
1078 * @param[out] percentage progress percentage
1079 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1080 * @retval NOTIFICATION_ERROR_NONE - success
1081 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1087 #include <notification.h>
1090 notification_h noti = NULL;
1091 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1092 double percentage = 0.0;
1094 noti_err = notification_get_progress(noti, &percentage);
1095 if(noti_err != NOTIFICATION_ERROR_NONE) {
1101 notification_error_e notification_get_progress(notification_h noti,
1102 double *percentage);
1105 * @brief This function set caller_pkgname.
1106 * @details caller_pkgname is set automatically when notification_new. We are not recommend to use this API.
1108 * @param[in] noti notification handle
1109 * @param[in] pkgname caller package name
1110 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1111 * @retval NOTIFICATION_ERROR_NONE - success
1112 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1118 #include <notification.h>
1121 notification_h noti = NULL;
1122 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1124 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1129 noti_err = notification_set_pkgname(noti, "org.tizen.phone");
1130 if(noti_err != NOTIFICATION_ERROR_NONE) {
1131 notification_free(noti);
1137 notification_error_e notification_set_pkgname(notification_h noti,
1138 const char *pkgname);
1141 * @brief This function get caller pkgname.
1144 * @param[in] noti notification handle
1145 * @param[out] pkgname caller package name
1146 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1147 * @retval NOTIFICATION_ERROR_NONE - success
1148 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1154 #include <notification.h>
1157 notification_h noti = NULL;
1158 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1159 char *pkgname = NULL;
1161 noti_err = notification_get_pkgname(noti, &pkgname);
1162 if(noti_err != NOTIFICATION_ERROR_NONE) {
1168 notification_error_e notification_get_pkgname(notification_h noti,
1172 * @brief This function set layout type of notification
1173 * @details caller can set displaying layout of notification with this API
1175 * @param[in] noti notification handle
1176 * @param[in] layout type
1177 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1178 * @retval NOTIFICATION_ERROR_NONE - success
1179 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1182 * @see #notification_ly_type_e
1184 notification_error_e notification_set_layout(notification_h noti,
1185 notification_ly_type_e layout);
1188 * @brief This function get layout type of notification
1191 * @param[in] noti notification handle
1192 * @param[out] layout type of notification
1193 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1194 * @retval NOTIFICATION_ERROR_NONE - success
1195 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1198 * @see #notification_ly_type_e
1200 notification_error_e notification_get_layout(notification_h noti,
1201 notification_ly_type_e *layout);
1204 * @brief This function set application badge count.
1207 * @param[in] pkgname If NULL, caller pkgname is set internally.
1208 * @param[in] group_id group id
1209 * @param[in] count badge count
1210 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1211 * @retval NOTIFICATION_ERROR_NONE - success
1212 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1217 #include <notification.h>
1220 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1222 noti_err = notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, 5);
1223 if(noti_err != NOTIFICATION_ERROR_NONE) {
1229 notification_error_e notification_set_badge(const char *pkgname,
1230 int group_id, int count);
1233 * @brief This function get application badge count.
1236 * @param[in] pkgname If NULL, caller pkgname is set internally.
1237 * @param[in] group_id group id
1238 * @param[out] count badge count
1239 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1240 * @retval NOTIFICATION_ERROR_NONE - success
1241 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1246 #include <notification.h>
1249 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1252 noti_err = notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
1253 if(noti_err != NOTIFICATION_ERROR_NONE) {
1259 notification_error_e notification_get_badge(const char *pkgname,
1260 int group_id, int *count);
1263 * @brief This function get Group ID and Private ID
1266 * @param[in] noti notification handle
1267 * @param[out] group_id Group ID
1268 * @param[out] priv_id Private ID
1269 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1270 * @retval NOTIFICATION_ERROR_NONE - success
1271 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1277 #include <notification.h>
1280 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1281 int group_id, priv_id;
1283 noti_err = notification_get_id(noti, &group_id, &priv_id);
1284 if(noti_err != NOTIFICATION_ERROR_NONE) {
1290 notification_error_e notification_get_id(notification_h noti,
1291 int *group_id, int *priv_id);
1294 * @brief This function get notification type
1297 * @param[in] noti notification handle
1298 * @param[out] type notification type
1299 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1300 * @retval NOTIFICATION_ERROR_NONE - success
1301 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1307 #include <notification.h>
1310 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1311 notification_type_e type;
1313 noti_err = notification_get_type(noti, &type);
1314 if(noti_err != NOTIFICATION_ERROR_NONE) {
1320 notification_error_e notification_get_type(notification_h noti,
1321 notification_type_e * type);
1324 * @brief This function insert notification data.
1325 * @details Notification data is inserted to DB and then notification data is displaying display application.
1326 * When notification_new() call, if priv_id is NOTIFICATION_PRIV_ID_NONE, priv_id is return internally set priv_id.
1328 * @param[in] noti notification handle
1329 * @param[out] priv_id private ID
1330 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1331 * @retval NOTIFICATION_ERROR_NONE - success
1332 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1333 * @pre notification_new()
1334 * @post notification_free()
1335 * @see #notification_h
1338 #include <notification.h>
1341 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1343 noti_err = notification_insert(noti, NULL);
1344 if(noti_err != NOTIFICATION_ERROR_NONE) {
1350 notification_error_e notification_insert(notification_h noti,
1354 * @brief This function update notification data.
1355 * @details Display application update UI.
1357 * @param[in] noti notification handle that is created by notification_new().
1358 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1359 * @retval NOTIFICATION_ERROR_NONE - success
1360 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1361 * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1364 * @see #notification_h
1367 #include <notification.h>
1370 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1372 noti_err = notification_update(NULL);
1373 if(noti_err != NOTIFICATION_ERROR_NONE) {
1379 notification_error_e notification_update(notification_h noti);
1382 * @brief This function updates notification data.
1383 * @details Display application update UI.
1385 * @param[in] noti notification handle that is created by notification_new().
1386 * @param[in] result_cb callback called when update completed
1387 * @param[in] user_data user data which you want to use in callback
1388 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1389 * @retval NOTIFICATION_ERROR_NONE - success
1390 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1391 * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1394 * @see #notification_h
1397 #include <notification.h>
1400 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1402 noti_err = notification_update_async(NULL, result_cb, data);
1403 if(noti_err != NOTIFICATION_ERROR_NONE) {
1409 notification_error_e notification_update_async(notification_h noti,
1410 void (*result_cb)(int priv_id, int result, void *data), void *user_data);
1413 * @brief This function clear all notification of type.
1414 * @details Not recommand API. Only for notification tray's clear button operation.
1416 * @param[in] type notification type
1417 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1418 * @retval NOTIFICATION_ERROR_NONE - success
1419 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1422 * @see #notification_type_e
1425 #include <notification.h>
1428 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1430 noti_err = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1431 if(noti_err != NOTIFICATION_ERROR_NONE) {
1437 notification_error_e notifiation_clear(notification_type_e type);
1440 * @brief This function delete notification by type.
1441 * @details If pkgname is NULL, caller_pkgname is set internally.
1443 * @param[in] pkgname caller application package name or NULL
1444 * @param[in] type notification type
1445 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1446 * @retval NOTIFICATION_ERROR_NONE - success
1447 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1453 #include <notification.h>
1456 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1458 noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1459 if(noti_err != NOTIFICATION_ERROR_NONE) {
1465 notification_error_e notification_delete_all_by_type(const char *pkgname,
1466 notification_type_e type);
1469 * @brief This function delete group notification data by group ID.
1470 * @details If pkgname is NULL, caller_pkgname is set internally.
1472 * @param[in] pkgname caller application package name or NULL
1473 * @param[in] type notification type
1474 * @param[in] group_id group ID
1475 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1476 * @retval NOTIFICATION_ERROR_NONE - success
1477 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1483 #include <notification.h>
1486 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1488 noti_err = notification_delete_group_by_group_id(NULL, NOTIFICATION_TYPE_NOTI, APP_GROUP_ID);
1489 if(noti_err != NOTIFICATION_ERROR_NONE) {
1495 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
1496 notification_type_e type,
1500 * @brief This function delete group notification data that include priv_id.
1501 * @details If pkgname is NULL, caller_pkgname is set internally.
1503 * @param[in] pkgname caller application package name or NULL
1504 * @param[in] type notification type
1505 * @param[in] priv_id priv ID
1506 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1507 * @retval NOTIFICATION_ERROR_NONE - success
1508 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1514 #include <notification.h>
1517 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1519 noti_err = notification_delete_group_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1520 if(noti_err != NOTIFICATION_ERROR_NONE) {
1526 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
1527 notification_type_e type,
1531 * @brief This function delete notification data that private ID is priv_id.
1532 * @details If pkgname is NULL, caller_pkgname is set internally.
1534 * @param[in] pkgname caller application package name or NULL
1535 * @param[in] type notification type
1536 * @param[in] priv_id priv ID
1537 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1538 * @retval NOTIFICATION_ERROR_NONE - success
1539 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1545 #include <notification.h>
1548 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1550 noti_err = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1551 if(noti_err != NOTIFICATION_ERROR_NONE) {
1557 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1558 notification_type_e type,
1562 * @brief This function delete notification data from DB
1563 * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1565 * @param[in] noti notification handle
1566 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1567 * @retval NOTIFICATION_ERROR_NONE - success
1568 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1571 * @see #notification_h
1574 #include <notification.h>
1577 notificaton_h noti = NULL;
1578 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1582 noti_err = notification_delete(noti);
1583 if(noti_err != NOTIFICATION_ERROR_NONE) {
1590 notification_error_e notification_delete(notification_h noti);
1593 * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1594 * @details Display application update UI.
1596 * @param[in] noti notification handle or NULL if priv_id is valid
1597 * @param[in] priv_id private ID
1598 * @param[in] progress % value of progressive data
1599 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1600 * @retval NOTIFICATION_ERROR_NONE - success
1601 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1606 #include <notification.h>
1609 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1611 noti_err = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1612 if(noti_err != NOTIFICATION_ERROR_NONE) {
1618 notification_error_e notification_update_progress(notification_h noti,
1623 * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1624 * @details Display application update UI.
1626 * @param[in] noti notification handle or NULL if priv_id is valid
1627 * @param[in] priv_id private ID
1628 * @param[in] size bytes of progressive data
1629 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1630 * @retval NOTIFICATION_ERROR_NONE - success
1631 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1636 #include <notification.h>
1639 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1641 noti_err = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1642 if(noti_err != NOTIFICATION_ERROR_NONE) {
1648 notification_error_e notification_update_size(notification_h noti,
1649 int priv_id, double size);
1651 notification_error_e notification_update_content(notification_h noti,
1653 const char *content);
1656 * @brief This function create internal structure data and return notification handle.
1657 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1658 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1659 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1660 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1661 * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1662 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1663 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1665 * @param[in] type notification type
1666 * @param[in] group_id Group ID
1667 * @param[in] priv_id Priv ID
1668 * @return notification handle(#notification_h) if success, NULL if failure.
1669 * @retval #notification_h - success
1670 * @retval NULL - failure
1673 * @see #notification_type_e
1674 * @see #notification_h
1677 #include <notification.h>
1680 notification_h noti = NULL;
1682 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1690 notification_h notification_new(notification_type_e type, int group_id,
1694 * @brief This function create internal structure data and return notification handle.
1695 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1696 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1697 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1699 * @param[in] type notification type
1700 * @return notification handle(#notification_h) if success, NULL if failure.
1701 * @retval #notification_h - success
1702 * @retval NULL - failure
1705 * @see #notification_type_e
1706 * @see #notification_h
1709 #include <notification.h>
1712 notification_h noti = NULL;
1714 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1722 notification_h notification_create(notification_type_e type);
1725 * @brief This function create internal structure data and return notification handle.
1726 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1727 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1728 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1729 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1730 * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1731 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1732 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1734 * @param[in] type notification type
1735 * @param[in] group_id Group ID
1736 * @param[in] priv_id Priv ID
1737 * @return notification handle(#notification_h) if success, NULL if failure.
1738 * @retval #notification_h - success
1739 * @retval NULL - failure
1742 * @see #notification_type_e
1743 * @see #notification_h
1746 #include <notification.h>
1749 notification_h noti = NULL;
1751 noti = notification_load(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1759 notification_h notification_load(char *pkgname,
1763 * @brief This function create notification clone.
1764 * @details Newly created notification handle is returned.
1765 * @remarks This clone notification handle should be call notification_free().
1766 * @param[in] noti notification handle
1767 * @param[out] clone newly created notification handle that has same with input noti.
1768 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1769 * @retval NOTIFICATION_ERROR_NONE - success
1770 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1773 * @see #notification_type_e
1774 * @see #notification_h
1777 #include <notification.h>
1780 notification_h noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1781 notification_h clone = NULL;
1783 notification_clone(noti, &clone);
1788 notification_error_e notification_clone(notification_h noti, notification_h *clone);
1791 * @brief This function free internal structure data of notification handle.
1792 * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1794 * @param[in] noti notification handle
1795 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1796 * @retval NOTIFICATION_ERROR_NONE - success
1797 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1798 * @pre notification_new()
1800 * @see #notification_h
1803 #include <notification.h>
1806 notification_h noti = NULL;
1807 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1809 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1815 noti_err = notification_free(noti);
1816 if(noti_err != NOTIFICATION_ERROR_NONE) {
1822 notification_error_e notification_free(notification_h noti);
1825 * @brief This function register notification chagned callback.
1828 * @param[in] changed_cb callback function
1829 * @param[in] user_data user data
1830 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1831 * @retval NOTIFICATION_ERROR_NONE - success
1832 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1833 * @pre notification_new()
1835 * @see notification_unresister_changed_cb()
1838 #include <notification.h>
1841 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1842 if(noti_err != NOTIFICATION_ERROR_NONE) {
1848 notification_error_e
1849 notification_resister_changed_cb(
1850 void (*changed_cb)(void *data, notification_type_e type),
1854 * @brief This function unregister notification chagned callback.
1857 * @param[in] changed_cb callback function
1858 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1859 * @retval NOTIFICATION_ERROR_NONE - success
1860 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1861 * @pre notification_new()
1863 * @see notification_resister_changed_cb()
1866 #include <notification.h>
1869 noti_err = notification_unresister_changed_cb(app_changed_cb);
1870 if(noti_err != NOTIFICATION_ERROR_NONE) {
1876 notification_error_e
1877 notification_unresister_changed_cb(
1878 void (*changed_cb)(void *data, notification_type_e type));
1881 * @brief This function register notification chagned callback.
1884 * @param[in] changed_cb callback function
1885 * @param[in] user_data user data
1886 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1887 * @retval NOTIFICATION_ERROR_NONE - success
1888 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1889 * @pre notification_new()
1891 * @see notification_unresister_changed_cb()
1894 #include <notification.h>
1897 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1898 if(noti_err != NOTIFICATION_ERROR_NONE) {
1904 notification_error_e
1905 notification_register_detailed_changed_cb(
1906 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1910 * @brief This function unregister notification chagned callback.
1913 * @param[in] changed_cb callback function
1914 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1915 * @retval NOTIFICATION_ERROR_NONE - success
1916 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1917 * @pre notification_new()
1919 * @see notification_resister_changed_cb()
1922 #include <notification.h>
1925 noti_err = notification_unresister_changed_cb(app_changed_cb);
1926 if(noti_err != NOTIFICATION_ERROR_NONE) {
1932 notification_error_e
1933 notification_unregister_detailed_changed_cb(
1934 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1938 * @brief This function get notification data count.
1939 * @details Count is the result of the conditions that type, pkgname, group_id, priv_id.
1941 * @param[in] type notification type
1942 * @param[in] pkgname caller application package name
1943 * @param[in] group_id group id
1944 * @param[in] priv_id private id
1945 * @param[out] count notification data number
1946 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1947 * @retval NOTIFICATION_ERROR_NONE - success
1948 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1951 * @see #notification_type_e
1954 #include <notification.h>
1957 notification_list_h noti_list = NULL;
1958 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1961 noti_err = notification_get_count(NOTIFICATION_TYPE_NONE, NULL, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE, &count);
1962 if(noti_err != NOTIFICATION_ERROR_NONE) {
1968 notification_error_e notification_get_count(notification_type_e type,
1969 const char *pkgname,
1970 int group_id, int priv_id,
1974 * @brief This function will be deprecated.
1975 * @see notification_get_grouping_list()
1978 notification_error_e notification_get_list(notification_type_e type,
1980 notification_list_h * list);
1983 * @brief This function return notification grouping list handle.
1984 * @details If count is -1, all of notification list is returned.
1986 * @param[in] type notification type
1987 * @param[in] count returned notification data number
1988 * @param[out] list notification list handle
1989 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1990 * @retval NOTIFICATION_ERROR_NONE - success
1991 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1994 * @see #notification_list_h
1997 #include <notification.h>
2000 notification_list_h noti_list = NULL;
2001 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
2003 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
2004 if(noti_err != NOTIFICATION_ERROR_NONE) {
2010 notification_error_e notification_get_grouping_list(notification_type_e type,
2012 notification_list_h *list);
2015 * @brief This function return notification detail list handle of grouping data.
2016 * @details If count is -1, all of notification list is returned.
2018 * @param[in] pkgname caller application package name
2019 * @param[in] group_id group id
2020 * @param[in] priv_id private id
2021 * @param[in] count returned notification data number
2022 * @param[out] list notification list handle
2023 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2024 * @retval NOTIFICATION_ERROR_NONE - success
2025 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
2028 * @see #notification_list_h
2031 #include <notification.h>
2034 notification_list_h noti_list = NULL;
2035 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
2037 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
2038 if(noti_err != NOTIFICATION_ERROR_NONE) {
2044 notification_error_e notification_get_detail_list(const char *pkgname,
2048 notification_list_h *list);
2051 * @brief This function release notification list.
2054 * @param[in] list notification list handle
2055 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2056 * @retval NOTIFICATION_ERROR_NONE - success
2057 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
2058 * @pre notification_get_grouping_list() or notification_get_detail_list ()
2060 * @see #notification_list_h
2063 #include <notification.h>
2066 notification_list_h noti_list = NULL;
2067 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
2071 noti_err = notification_free_list(noti_list);
2072 if(noti_err != NOTIFICATION_ERROR_NONE) {
2078 notification_error_e notification_free_list(notification_list_h list);
2085 * @brief You can get the information about notification operation using this function
2088 * @param[in] list notification list handle
2089 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2090 * @retval NOTIFICATION_ERROR_NONE - success
2091 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
2092 * @pre notification_get_grouping_list() or notification_get_detail_list ()
2094 * @see #notification_op
2096 notification_error_e notification_op_get_data(notification_op *noti_op,
2097 notification_op_data_type_e type,
2104 void notification_call_changed_cb(notification_op *op_list, int op_num);
2106 int notification_is_service_ready(void);
2108 notification_error_e notification_add_deffered_task(
2109 void (*deffered_task_cb)(void *data), void *user_data);
2111 notification_error_e notification_del_deffered_task(
2112 void (*deffered_task_cb)(void *data));
2117 #endif /* __NOTIFICATION_H__ */