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 clear all notification of type.
1383 * @details Not recommand API. Only for notification tray's clear button operation.
1385 * @param[in] type notification type
1386 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1387 * @retval NOTIFICATION_ERROR_NONE - success
1388 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1391 * @see #notification_type_e
1394 #include <notification.h>
1397 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1399 noti_err = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1400 if(noti_err != NOTIFICATION_ERROR_NONE) {
1406 notification_error_e notifiation_clear(notification_type_e type);
1409 * @brief This function delete notification by type.
1410 * @details If pkgname is NULL, caller_pkgname is set internally.
1412 * @param[in] pkgname caller application package name or NULL
1413 * @param[in] type notification type
1414 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1415 * @retval NOTIFICATION_ERROR_NONE - success
1416 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1422 #include <notification.h>
1425 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1427 noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1428 if(noti_err != NOTIFICATION_ERROR_NONE) {
1434 notification_error_e notification_delete_all_by_type(const char *pkgname,
1435 notification_type_e type);
1438 * @brief This function delete group notification data by group ID.
1439 * @details If pkgname is NULL, caller_pkgname is set internally.
1441 * @param[in] pkgname caller application package name or NULL
1442 * @param[in] type notification type
1443 * @param[in] group_id group ID
1444 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1445 * @retval NOTIFICATION_ERROR_NONE - success
1446 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1452 #include <notification.h>
1455 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1457 noti_err = notification_delete_group_by_group_id(NULL, NOTIFICATION_TYPE_NOTI, APP_GROUP_ID);
1458 if(noti_err != NOTIFICATION_ERROR_NONE) {
1464 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
1465 notification_type_e type,
1469 * @brief This function delete group notification data that include priv_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] priv_id priv 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_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1489 if(noti_err != NOTIFICATION_ERROR_NONE) {
1495 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
1496 notification_type_e type,
1500 * @brief This function delete notification data that private ID is 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_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1520 if(noti_err != NOTIFICATION_ERROR_NONE) {
1526 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1527 notification_type_e type,
1531 * @brief This function delete notification data from DB
1532 * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1534 * @param[in] noti notification handle
1535 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1536 * @retval NOTIFICATION_ERROR_NONE - success
1537 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1540 * @see #notification_h
1543 #include <notification.h>
1546 notificaton_h noti = NULL;
1547 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1551 noti_err = notification_delete(noti);
1552 if(noti_err != NOTIFICATION_ERROR_NONE) {
1559 notification_error_e notification_delete(notification_h noti);
1562 * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1563 * @details Display application update UI.
1565 * @param[in] noti notification handle or NULL if priv_id is valid
1566 * @param[in] priv_id private ID
1567 * @param[in] progress % value of progressive data
1568 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1569 * @retval NOTIFICATION_ERROR_NONE - success
1570 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1575 #include <notification.h>
1578 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1580 noti_err = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1581 if(noti_err != NOTIFICATION_ERROR_NONE) {
1587 notification_error_e notification_update_progress(notification_h noti,
1592 * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1593 * @details Display application update UI.
1595 * @param[in] noti notification handle or NULL if priv_id is valid
1596 * @param[in] priv_id private ID
1597 * @param[in] size bytes of progressive data
1598 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1599 * @retval NOTIFICATION_ERROR_NONE - success
1600 * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1605 #include <notification.h>
1608 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1610 noti_err = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1611 if(noti_err != NOTIFICATION_ERROR_NONE) {
1617 notification_error_e notification_update_size(notification_h noti,
1618 int priv_id, double size);
1620 notification_error_e notification_update_content(notification_h noti,
1622 const char *content);
1625 * @brief This function create internal structure data and return notification handle.
1626 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1627 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1628 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1629 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1630 * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1631 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1632 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1634 * @param[in] type notification type
1635 * @param[in] group_id Group ID
1636 * @param[in] priv_id Priv ID
1637 * @return notification handle(#notification_h) if success, NULL if failure.
1638 * @retval #notification_h - success
1639 * @retval NULL - failure
1642 * @see #notification_type_e
1643 * @see #notification_h
1646 #include <notification.h>
1649 notification_h noti = NULL;
1651 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1659 notification_h notification_new(notification_type_e type, int group_id,
1663 * @brief This function create internal structure data and return notification handle.
1664 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1665 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1666 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1668 * @param[in] type notification type
1669 * @return notification handle(#notification_h) if success, NULL if failure.
1670 * @retval #notification_h - success
1671 * @retval NULL - failure
1674 * @see #notification_type_e
1675 * @see #notification_h
1678 #include <notification.h>
1681 notification_h noti = NULL;
1683 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1691 notification_h notification_create(notification_type_e type);
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.
1698 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1699 * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1700 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1701 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1703 * @param[in] type notification type
1704 * @param[in] group_id Group ID
1705 * @param[in] priv_id Priv ID
1706 * @return notification handle(#notification_h) if success, NULL if failure.
1707 * @retval #notification_h - success
1708 * @retval NULL - failure
1711 * @see #notification_type_e
1712 * @see #notification_h
1715 #include <notification.h>
1718 notification_h noti = NULL;
1720 noti = notification_load(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1728 notification_h notification_load(char *pkgname,
1732 * @brief This function create notification clone.
1733 * @details Newly created notification handle is returned.
1734 * @remarks This clone notification handle should be call notification_free().
1735 * @param[in] noti notification handle
1736 * @param[out] clone newly created notification handle that has same with input noti.
1737 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1738 * @retval NOTIFICATION_ERROR_NONE - success
1739 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1742 * @see #notification_type_e
1743 * @see #notification_h
1746 #include <notification.h>
1749 notification_h noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1750 notification_h clone = NULL;
1752 notification_clone(noti, &clone);
1757 notification_error_e notification_clone(notification_h noti, notification_h *clone);
1760 * @brief This function free internal structure data of notification handle.
1761 * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1763 * @param[in] noti notification handle
1764 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1765 * @retval NOTIFICATION_ERROR_NONE - success
1766 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1767 * @pre notification_new()
1769 * @see #notification_h
1772 #include <notification.h>
1775 notification_h noti = NULL;
1776 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1778 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1784 noti_err = notification_free(noti);
1785 if(noti_err != NOTIFICATION_ERROR_NONE) {
1791 notification_error_e notification_free(notification_h noti);
1794 * @brief This function register notification chagned callback.
1797 * @param[in] changed_cb callback function
1798 * @param[in] user_data user data
1799 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1800 * @retval NOTIFICATION_ERROR_NONE - success
1801 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1802 * @pre notification_new()
1804 * @see notification_unresister_changed_cb()
1807 #include <notification.h>
1810 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1811 if(noti_err != NOTIFICATION_ERROR_NONE) {
1817 notification_error_e
1818 notification_resister_changed_cb(
1819 void (*changed_cb)(void *data, notification_type_e type),
1823 * @brief This function unregister notification chagned callback.
1826 * @param[in] changed_cb callback function
1827 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1828 * @retval NOTIFICATION_ERROR_NONE - success
1829 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1830 * @pre notification_new()
1832 * @see notification_resister_changed_cb()
1835 #include <notification.h>
1838 noti_err = notification_unresister_changed_cb(app_changed_cb);
1839 if(noti_err != NOTIFICATION_ERROR_NONE) {
1845 notification_error_e
1846 notification_unresister_changed_cb(
1847 void (*changed_cb)(void *data, notification_type_e type));
1850 * @brief This function register notification chagned callback.
1853 * @param[in] changed_cb callback function
1854 * @param[in] user_data user data
1855 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1856 * @retval NOTIFICATION_ERROR_NONE - success
1857 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1858 * @pre notification_new()
1860 * @see notification_unresister_changed_cb()
1863 #include <notification.h>
1866 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1867 if(noti_err != NOTIFICATION_ERROR_NONE) {
1873 notification_error_e
1874 notification_register_detailed_changed_cb(
1875 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1879 * @brief This function unregister notification chagned callback.
1882 * @param[in] changed_cb callback function
1883 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1884 * @retval NOTIFICATION_ERROR_NONE - success
1885 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1886 * @pre notification_new()
1888 * @see notification_resister_changed_cb()
1891 #include <notification.h>
1894 noti_err = notification_unresister_changed_cb(app_changed_cb);
1895 if(noti_err != NOTIFICATION_ERROR_NONE) {
1901 notification_error_e
1902 notification_unregister_detailed_changed_cb(
1903 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1907 * @brief This function get notification data count.
1908 * @details Count is the result of the conditions that type, pkgname, group_id, priv_id.
1910 * @param[in] type notification type
1911 * @param[in] pkgname caller application package name
1912 * @param[in] group_id group id
1913 * @param[in] priv_id private id
1914 * @param[out] count notification data number
1915 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1916 * @retval NOTIFICATION_ERROR_NONE - success
1917 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1920 * @see #notification_type_e
1923 #include <notification.h>
1926 notification_list_h noti_list = NULL;
1927 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1930 noti_err = notification_get_count(NOTIFICATION_TYPE_NONE, NULL, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE, &count);
1931 if(noti_err != NOTIFICATION_ERROR_NONE) {
1937 notification_error_e notification_get_count(notification_type_e type,
1938 const char *pkgname,
1939 int group_id, int priv_id,
1943 * @brief This function will be deprecated.
1944 * @see notification_get_grouping_list()
1947 notification_error_e notification_get_list(notification_type_e type,
1949 notification_list_h * list);
1952 * @brief This function return notification grouping list handle.
1953 * @details If count is -1, all of notification list is returned.
1955 * @param[in] type notification type
1956 * @param[in] count returned notification data number
1957 * @param[out] list notification list handle
1958 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1959 * @retval NOTIFICATION_ERROR_NONE - success
1960 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1963 * @see #notification_list_h
1966 #include <notification.h>
1969 notification_list_h noti_list = NULL;
1970 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1972 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
1973 if(noti_err != NOTIFICATION_ERROR_NONE) {
1979 notification_error_e notification_get_grouping_list(notification_type_e type,
1981 notification_list_h *list);
1984 * @brief This function return notification detail list handle of grouping data.
1985 * @details If count is -1, all of notification list is returned.
1987 * @param[in] pkgname caller application package name
1988 * @param[in] group_id group id
1989 * @param[in] priv_id private id
1990 * @param[in] count returned notification data number
1991 * @param[out] list notification list handle
1992 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1993 * @retval NOTIFICATION_ERROR_NONE - success
1994 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1997 * @see #notification_list_h
2000 #include <notification.h>
2003 notification_list_h noti_list = NULL;
2004 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
2006 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
2007 if(noti_err != NOTIFICATION_ERROR_NONE) {
2013 notification_error_e notification_get_detail_list(const char *pkgname,
2017 notification_list_h *list);
2020 * @brief This function release notification list.
2023 * @param[in] list notification list handle
2024 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2025 * @retval NOTIFICATION_ERROR_NONE - success
2026 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
2027 * @pre notification_get_grouping_list() or notification_get_detail_list ()
2029 * @see #notification_list_h
2032 #include <notification.h>
2035 notification_list_h noti_list = NULL;
2036 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
2040 noti_err = notification_free_list(noti_list);
2041 if(noti_err != NOTIFICATION_ERROR_NONE) {
2047 notification_error_e notification_free_list(notification_list_h list);
2054 * @brief You can get the information about notification operation using this function
2057 * @param[in] list notification list handle
2058 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2059 * @retval NOTIFICATION_ERROR_NONE - success
2060 * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
2061 * @pre notification_get_grouping_list() or notification_get_detail_list ()
2063 * @see #notification_op
2065 notification_error_e notification_op_get_data(notification_op *noti_op,
2066 notification_op_data_type_e type,
2073 void notification_call_changed_cb(notification_op *op_list, int op_num);
2075 int notification_is_service_ready(void);
2077 notification_error_e notification_add_deffered_task(
2078 void (*deffered_task_cb)(void *data), void *user_data);
2080 notification_error_e notification_del_deffered_task(
2081 void (*deffered_task_cb)(void *data));
2086 #endif /* __NOTIFICATION_H__ */