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>
32 #include <notification_setting.h>
39 * @file notification.h
40 * @brief This file contains the notification APIs
44 * @addtogroup NOTIFICATION_MODULE
49 * @brief Set absolute path for image file to display on notification view
52 * @param[in] noti notification handle
53 * @param[in] type notification image type
54 * @param[in] image_path image file full path
55 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
56 * @retval NOTIFICATION_ERROR_NONE - success
57 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
58 * @pre Notification handle should be created by notification_new()
60 * @see #notification_image_type_e
61 * @see notification_new()
64 #include <notification.h>
67 notification_h noti = NULL;
68 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
70 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
75 noti_err = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, APP_IMAGE_FULL_PATH);
76 if(noti_err != NOTIFICATION_ERROR_NONE) {
77 notification_free(noti);
83 notification_error_e notification_set_image(notification_h noti,
84 notification_image_type_e type,
85 const char *image_path);
88 * @brief Get absolute path for image file
90 * @remarks Do not free image_path. It will be freed when notification_free() or notification_free_list().
91 * @param[in] noti notification handle
92 * @param[in] type notification image type
93 * @param[out] image_path image file full path
94 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
95 * @retval NOTIFICATION_ERROR_NONE - success
96 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
97 * @pre Notification handle should be created by notification_new()
99 * @see #notification_image_type_e
100 * @see notification_new()
103 #include <notification.h>
106 char *image_path = NULL;
107 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
109 noti_err = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
110 if(noti_err != NOTIFICATION_ERROR_NONE) {
116 notification_error_e notification_get_image(notification_h noti,
117 notification_image_type_e type,
121 * @brief Set a timestamp
122 * @details If input_time is 0, time information is set by current time.
124 * @param[in] noti notification handle
125 * @param[in] input_time input time
126 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
127 * @retval NOTIFICATION_ERROR_NONE - success
128 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
129 * @pre Notification handle should be created by notification_new()
131 * @see notification_new()
134 #include <notification.h>
137 notification_h noti = NULL;
138 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
140 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
145 noti_err = notification_set_time(noti, time(NULL));
146 if(noti_err != NOTIFICATION_ERROR_NONE) {
147 notification_free(noti);
153 notification_error_e notification_set_time(notification_h noti,
157 * @brief Get a timestamp
158 * @details If ret_time is 0, time information is not set before.
160 * @param[in] noti notification handle
161 * @param[out] ret_time return time value
162 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
163 * @retval NOTIFICATION_ERROR_NONE - success
164 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
165 * @pre Notification handle should be created by notification_new()
167 * @see notification_new()
170 #include <notification.h>
174 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
176 noti_err = notification_get_time(noti, &ret_time);
177 if(noti_err != NOTIFICATION_ERROR_NONE) {
183 notification_error_e notification_get_time(notification_h noti,
187 * @brief Get timestamp that the notification is inserted
188 * @details If ret_time is 0, this notification data is not inserted before.
190 * @param[in] noti notification handle
191 * @param[out] ret_time return time value
192 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
193 * @retval NOTIFICATION_ERROR_NONE - success
194 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
200 #include <notification.h>
204 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
206 noti_err = notification_get_insert_time(noti, &ret_time);
207 if(noti_err != NOTIFICATION_ERROR_NONE) {
213 notification_error_e notification_get_insert_time(notification_h noti,
217 * @brief Set text to display on the notification view
218 * @details Set title, content string. If text is formated data(only support %d, %f, %s), type - value pair should be set.
219 * If %d, type NOTIFICATION_VARIABLE_TYPE_INT and value is integer value.
220 * If %f, type NOTIFICATION_VARIABLE_TYPE_DOUBLE and value is double value.
221 * If %s, type NOTIFICATION_VARIABLE_TYPE_STRING and value is character string.
222 * If type is NOTIFICATION_VARIABLE_TYPE_COUNT, notification count is displaying with text.
223 * If value is NOTIFICATION_COUNT_POS_LEFT, count is displaying at the left of the text.
224 * If value is NOTIFICATION_COUNT_POS_IN, count is displaying in the text that text has %d format.
225 * If value is NOTIFICATION_COUNT_POS_RIGHT, count is displaying at the right of the text.
226 * Variable parameter should be terminated NOTIFICATION_VARIABLE_TYPE_NONE.
228 * @param[in] noti notification handle
229 * @param[in] type notification text type
230 * @param[in] text basic text
231 * @param[in] key text key for localization
232 * @param[in] args_type variable parameter that type - value pair.
233 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
234 * @retval NOTIFICATION_ERROR_NONE - success
235 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
236 * @pre notification handle should be created by notification_new().
241 #include <notification.h>
244 notification_h noti = NULL;
245 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
247 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
252 noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "I'm Title", "IDS_APP_BODY_IM_TITLE", NOTIFICATION_VARIABLE_TYPE_NONE);
253 if(noti_err != NOTIFICATION_ERROR_NONE) {
254 notification_free(noti);
260 notification_error_e notification_set_text(notification_h noti,
261 notification_text_type_e type,
267 * @brief Get the text from the notification handle
270 * @param[in] noti notification handle
271 * @param[in] type notification text type.
272 * @param[out] text text
273 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
274 * @retval NOTIFICATION_ERROR_NONE - success
275 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
281 #include <notification.h>
284 notification_h noti = NULL;
285 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
288 noti_err = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
289 if(noti_err != NOTIFICATION_ERROR_NONE) {
295 notification_error_e notification_get_text(notification_h noti,
296 notification_text_type_e type,
300 * @brief Set a timestamp to display on the notification view
301 * @details the timestamp will be converted to formatted string and it will be displayed on the setted text area
303 * @param[in] noti notification handle
304 * @param[in] type notification text type
305 * @param[in] time time stamp
306 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
307 * @retval NOTIFICATION_ERROR_NONE - success
308 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
309 * @pre notification handle should be created by notification_new().
313 notification_error_e notification_set_time_to_text(notification_h noti, notification_text_type_e type,
317 * @brief Get a timestamp from the notification handle
320 * @param[in] noti notification handle
321 * @param[in] type notification text type
322 * @param[in] time pointer of time stamp
323 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
324 * @retval NOTIFICATION_ERROR_NONE - success
325 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
326 * @pre notification handle should be created by notification_new().
330 notification_error_e notification_get_time_from_text(notification_h noti, notification_text_type_e type,
334 * @brief Set text domain to localize the notification
337 * @param[in] noti notification handle
338 * @param[in] domain text domain
339 * @param[in] dir text dir
340 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
341 * @retval NOTIFICATION_ERROR_NONE - success
342 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
348 #include <notification.h>
351 notification_h noti = NULL;
352 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
354 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
359 noti_err = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
360 if(noti_err != NOTIFICATION_ERROR_NONE) {
361 notification_free(noti);
367 notification_error_e notification_set_text_domain(notification_h noti,
372 * @brief Get text domain from the notification handle
374 * @remarks Do not free returned domain and dir. These are freed when notification_free or notification_free_list.
375 * @param[in] noti notification handle
376 * @param[out] domain domain
377 * @param[out] dir locale dir
378 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
379 * @retval NOTIFICATION_ERROR_NONE - success
380 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
386 #include <notification.h>
389 notification_h noti = NULL;
390 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
394 noti_err = notification_get_text_domain(noti, &domain, &dir);
395 if(noti_err != NOTIFICATION_ERROR_NONE) {
401 notification_error_e notification_get_text_domain(notification_h noti,
406 * @brief Set sound option for the notification
409 * @param[in] noti notification handle
410 * @param[in] type notification sound type
411 * @param[in] path user sound file path
412 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
413 * @retval NOTIFICATION_ERROR_NONE - success
414 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
420 #include <notification.h>
423 notification_h noti = NULL;
424 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
426 noti_err = notification_set_sound(noti, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL);
427 if(noti_err != NOTIFICATION_ERROR_NONE) {
433 notification_error_e notification_set_sound(notification_h noti,
434 notification_sound_type_e type,
438 * @brief Get sound option from the notification handle
441 * @param[in] noti notification handle
442 * @param[out] type notification sound type
443 * @param[out] path user sound file path
444 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
445 * @retval NOTIFICATION_ERROR_NONE - success
446 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
452 #include <notification.h>
455 notification_h noti = NULL;
456 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
457 notification_sound_type_e type = NOTIFICATION_SOUND_TYPE_NONE;
459 noti_err = notification_get_sound(noti, &type, NULL);
460 if(noti_err != NOTIFICATION_ERROR_NONE) {
466 notification_error_e notification_get_sound(notification_h noti,
467 notification_sound_type_e *type,
471 * @brief Set vibrate option for the notification
474 * @param[in] noti notification handle
475 * @param[in] type notification vibration type
476 * @param[in] path user vibration file path
477 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
478 * @retval NOTIFICATION_ERROR_NONE - success
479 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
485 #include <notification.h>
488 notification_h noti = NULL;
489 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
491 noti_err = notification_set_vibration(noti, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
492 if(noti_err != NOTIFICATION_ERROR_NONE) {
498 notification_error_e notification_set_vibration(notification_h noti,
499 notification_vibration_type_e type,
503 * @brief Get vibrate option from the notification handle
506 * @param[in] noti notification handle
507 * @param[out] type notification sound type
508 * @param[out] path user vibration file path
509 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
510 * @retval NOTIFICATION_ERROR_NONE - success
511 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
517 #include <notification.h>
520 notification_h noti = NULL;
521 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
522 notification_vibration_type_e type = NOTIFICATION_VIBRATION_TYPE_NONE;
524 noti_err = notification_get_vibration(noti, &type, NULL);
525 if(noti_err != NOTIFICATION_ERROR_NONE) {
531 notification_error_e notification_get_vibration(notification_h noti,
532 notification_vibration_type_e *type,
536 * @brief Set option of displaying the LED
539 * @param[in] noti notification handle
540 * @param[in] operation led notification operation
541 * @param[in] led_argb notification led color
542 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
543 * @retval NOTIFICATION_ERROR_NONE - success
544 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
550 #include <notification.h>
553 notification_h noti = NULL;
554 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
556 noti_err = notification_set_led(noti, NOTIFICATION_LED_TYPE_DEFAULT, NULL);
557 if(noti_err != NOTIFICATION_ERROR_NONE) {
563 notification_error_e notification_set_led(notification_h noti,
564 notification_led_op_e operation,
568 * @brief Get option of displaying the LED from the notification handle
571 * @param[in] noti notification handle
572 * @param[out] operation led notification operation
573 * @param[out] led_argb notification led color
574 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
575 * @retval NOTIFICATION_ERROR_NONE - success
576 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
582 #include <notification.h>
585 notification_h noti = NULL;
586 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
587 notification_led_type_e type = NOTIFICATION_LED_TYPE_NONE;
589 noti_err = notification_get_led(noti, &type, NULL);
590 if(noti_err != NOTIFICATION_ERROR_NONE) {
596 notification_error_e notification_get_led(notification_h noti,
597 notification_led_op_e *operation,
601 * @brief Set time period of flashing the LED
604 * @param[in] noti notification handle
605 * @param[in] on_ms time for turning on the LED
606 * @param[in] off_ms time for turning on the LED
607 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
608 * @retval NOTIFICATION_ERROR_NONE - success
609 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
615 #include <notification.h>
618 notification_h noti = NULL;
619 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
621 noti_err = notification_set_led_time_period(noti, 100, 100);
622 if(noti_err != NOTIFICATION_ERROR_NONE) {
628 notification_error_e notification_set_led_time_period(notification_h noti,
629 int on_ms, int off_ms);
632 * @brief Get time period of flashing the LED from the notification handle
635 * @param[in] noti notification handle
636 * @param[out] on_ms time for turning on the LED
637 * @param[out] off_ms time for turning on the LED
638 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
639 * @retval NOTIFICATION_ERROR_NONE - success
640 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
646 #include <notification.h>
649 notification_h noti = NULL;
650 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
654 noti_err = notification_get_led_time_period(noti, &led_on_ms, &led_off_ms);
655 if(noti_err != NOTIFICATION_ERROR_NONE) {
661 notification_error_e notification_get_led_time_period(notification_h noti,
662 int *on_ms, int *off_ms);
665 * @brief Sets the launch option for a notification.
666 * @details When notification data selected in display application, application launched by app_control_send_launch_request with app_control handle.
668 * @param[in] noti The notification handle
669 * @param[in] type Launching option type
670 * @param[in] option App Control handler
671 * @return #NOTIFICATION_ERROR_NONE on success,
672 * otherwise any other value on failure
673 * @retval #NOTIFICATION_ERROR_NONE Success
674 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
677 #include <notification.h>
680 notification_h noti = NULL;
681 app_control_h app_control = NULL;
682 int noti_err = NOTIFICATION_ERROR_NONE;
686 app_control_create(&app_control);
687 app_control_set_app_id(app_control, "org.tizen.app");
691 noti_err = notification_set_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)app_control);
692 if(noti_err != NOTIFICATION_ERROR_NONE) {
693 notification_free(noti);
697 app_control_destroy(app_control);
701 int notification_set_launch_option(notification_h noti,
702 notification_launch_option_type type, void *option);
705 * @brief Gets the launch option from the notification handle.
707 * @remarks You must release @a app_control using app_control_destroy().
708 * @param[in] noti The notification handle
709 * @param[in] type Launching option type
710 * @param[out] option The pointer of App Control handler
711 * @return #NOTIFICATION_ERROR_NONE on success,
712 * otherwise any other value on failure
713 * @retval #NOTIFICATION_ERROR_NONE Success
714 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
717 #include <notification.h>
720 app_control_h app_control = NULL;
721 app_control_create(&app_control);
725 noti_err = notification_get_launch_option(noti, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, (void *)&app_control);
726 if(noti_err != NOTIFICATION_ERROR_NONE) {
727 notification_free(noti);
733 int notification_get_launch_option(notification_h noti,
734 notification_launch_option_type type, void *option);
737 * @brief Set execution option for a notification
738 * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
740 * @param[in] noti notification handle
741 * @param[in] type notification execute type
742 * @param[in] text basic text for button
743 * @param[in] key value for localizaed text
744 * @param[in] service_handle appsvc bundle data
745 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
746 * @retval NOTIFICATION_ERROR_NONE - success
747 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
753 #include <notification.h>
756 notification_h noti = NULL;
757 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
763 appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
764 appsvc_set_uri(b,"http://www.samsung.com");
766 noti_err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
767 if(noti_err != NOTIFICATION_ERROR_NONE) {
768 notification_free(noti);
776 notification_error_e notification_set_execute_option(notification_h noti,
777 notification_execute_type_e type,
780 bundle *service_handle);
783 * @brief Get execution option from the notification handle
786 * @param[in] noti notification handle
787 * @param[in] type notification execute type
788 * @param[out] text text for button
789 * @param[out] service_handle appsvc bundle data
790 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
791 * @retval NOTIFICATION_ERROR_NONE - success
792 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
798 #include <notification.h>
801 notification_h noti = NULL;
802 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
807 noti_err = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
808 if(noti_err != NOTIFICATION_ERROR_NONE) {
809 notification_free(noti);
815 notification_error_e notification_get_execute_option(notification_h noti,
816 notification_execute_type_e type,
818 bundle **service_handle);
821 * @brief Set the property of the notification
824 * @param[in] noti notification handle
825 * @param[in] flags property with | operation
826 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
827 * @retval NOTIFICATION_ERROR_NONE - success
828 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
834 #include <notification.h>
837 notification_h noti = NULL;
838 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
841 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
846 noti_err = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
847 if(noti_err != NOTIFICATION_ERROR_NONE) {
848 notification_free(noti);
854 notification_error_e notification_set_property(notification_h noti,
858 * @brief Get the property of the notification from the notification handle
861 * @param[in] noti notification handle
862 * @param[out] flags notification property
863 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
864 * @retval NOTIFICATION_ERROR_NONE - success
865 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
871 #include <notification.h>
874 notification_h noti = NULL;
875 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
878 noti_err = notification_get_property(noti, &flags);
879 if(noti_err != NOTIFICATION_ERROR_NONE) {
885 notification_error_e notification_get_property(notification_h noti,
889 * @brief Set applications to display the notification
890 * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
892 * @param[in] noti notification handle
893 * @param[in] applist with | operation
894 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
895 * @retval NOTIFICATION_ERROR_NONE - success
896 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
902 #include <notification.h>
905 notification_h noti = NULL;
906 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
909 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
914 noti_err = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
915 if(noti_err != NOTIFICATION_ERROR_NONE) {
916 notification_free(noti);
923 notification_error_e notification_set_display_applist(notification_h noti,
927 * @brief Get application list to display the notification from the notification handle
930 * @param[in] noti notification handle
931 * @param[out] applist display application list.
932 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
933 * @retval NOTIFICATION_ERROR_NONE - success
934 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
940 #include <notification.h>
943 notification_h noti = NULL;
944 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
947 noti_err = notification_get_display_applist(noti, &applist);
948 if(noti_err != NOTIFICATION_ERROR_NONE) {
954 notification_error_e notification_get_display_applist(notification_h noti,
958 * @brief Set initial size for ongoing type.
959 * @details After notification_insert, it does not upate size. If you want to update size, please call notification_update_size().
961 * @param[in] noti notification handle
962 * @param[in] size double type size.
963 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
964 * @retval NOTIFICATION_ERROR_NONE - success
965 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
971 #include <notification.h>
974 notification_h noti = NULL;
975 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
977 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
982 noti_err = notification_set_size(noti, 0.0);
983 if(noti_err != NOTIFICATION_ERROR_NONE) {
984 notification_free(noti);
990 notification_error_e notification_set_size(notification_h noti,
994 * @brief Get progress size.
997 * @param[in] noti notification handle
998 * @param[out] size progress size
999 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1000 * @retval NOTIFICATION_ERROR_NONE - success
1001 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1007 #include <notification.h>
1010 notification_h noti = NULL;
1011 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1014 noti_err = notification_get_size(noti, &size);
1015 if(noti_err != NOTIFICATION_ERROR_NONE) {
1021 notification_error_e notification_get_size(notification_h noti,
1025 * @brief Set initial progress for ongoing type.
1026 * @details After notification_insert, it does not upate progress. If you want to update progress, please call notification_update_progress().
1028 * @param[in] noti notification handle
1029 * @param[in] percentage progress percentage
1030 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1031 * @retval NOTIFICATION_ERROR_NONE - success
1032 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1038 #include <notification.h>
1041 notification_h noti = NULL;
1042 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1044 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1049 noti_err = notification_set_progress(noti, 0.0);
1050 if(noti_err != NOTIFICATION_ERROR_NONE) {
1051 notification_free(noti);
1057 notification_error_e notification_set_progress(notification_h noti,
1061 * @brief Get progress from the notification handle
1063 * @remarks At the end of the operation, progress should be 1.0
1064 * @param[in] noti notification handle
1065 * @param[out] percentage progress percentage
1066 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1067 * @retval NOTIFICATION_ERROR_NONE - success
1068 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1074 #include <notification.h>
1077 notification_h noti = NULL;
1078 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1079 double percentage = 0.0;
1081 noti_err = notification_get_progress(noti, &percentage);
1082 if(noti_err != NOTIFICATION_ERROR_NONE) {
1088 notification_error_e notification_get_progress(notification_h noti,
1089 double *percentage);
1092 * @brief Set the package name of caller
1093 * @details caller_pkgname is set automatically when notification_new. We are not recommend to use this API.
1095 * @param[in] noti notification handle
1096 * @param[in] pkgname caller package name
1097 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1098 * @retval NOTIFICATION_ERROR_NONE - success
1099 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1105 #include <notification.h>
1108 notification_h noti = NULL;
1109 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1111 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1116 noti_err = notification_set_pkgname(noti, "com.samsung.phone");
1117 if(noti_err != NOTIFICATION_ERROR_NONE) {
1118 notification_free(noti);
1124 notification_error_e notification_set_pkgname(notification_h noti,
1125 const char *pkgname);
1128 * @brief Get the package name of caller from the notification handle
1131 * @param[in] noti notification handle
1132 * @param[out] pkgname caller package name
1133 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1134 * @retval NOTIFICATION_ERROR_NONE - success
1135 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1141 #include <notification.h>
1144 notification_h noti = NULL;
1145 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1146 char *pkgname = NULL;
1148 noti_err = notification_get_pkgname(noti, &pkgname);
1149 if(noti_err != NOTIFICATION_ERROR_NONE) {
1155 notification_error_e notification_get_pkgname(notification_h noti,
1159 * @brief Set the layout of the notification view
1160 * @details caller can set displaying layout of notification
1162 * @param[in] noti notification handle
1163 * @param[in] type of layout
1164 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1165 * @retval NOTIFICATION_ERROR_NONE - success
1166 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1169 * @see #notification_ly_type_e
1171 notification_error_e notification_set_layout(notification_h noti,
1172 notification_ly_type_e layout);
1175 * @brief Get the layout of the notification view from the notification handle
1178 * @param[in] noti notification handle
1179 * @param[out] type of layout
1180 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1181 * @retval NOTIFICATION_ERROR_NONE - success
1182 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1185 * @see #notification_ly_type_e
1187 notification_error_e notification_get_layout(notification_h noti,
1188 notification_ly_type_e *layout);
1191 * @brief Get Group ID and Private ID
1193 * @remarks ID is valid only after inserting the notification
1194 * @param[in] noti notification handle
1195 * @param[out] group_id Group ID
1196 * @param[out] priv_id Private ID
1197 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1198 * @retval NOTIFICATION_ERROR_NONE - success
1199 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
1205 #include <notification.h>
1208 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1209 int group_id, priv_id;
1211 noti_err = notification_get_id(noti, &group_id, &priv_id);
1212 if(noti_err != NOTIFICATION_ERROR_NONE) {
1218 notification_error_e notification_get_id(notification_h noti,
1219 int *group_id, int *priv_id);
1222 * @brief Get the type of notification
1225 * @param[in] noti notification handle
1226 * @param[out] type notification type
1227 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1228 * @retval NOTIFICATION_ERROR_NONE - success
1229 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid parameter
1235 #include <notification.h>
1238 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1239 notification_type_e type;
1241 noti_err = notification_get_type(noti, &type);
1242 if(noti_err != NOTIFICATION_ERROR_NONE) {
1248 notification_error_e notification_get_type(notification_h noti,
1249 notification_type_e * type);
1252 * @brief Insert a notification
1253 * @details A notification will be inserted to DB and then it will be appeared on the notification area
1254 * When notification_new() call, if priv_id is NOTIFICATION_PRIV_ID_NONE, priv_id is return internally set priv_id.
1256 * @param[in] noti notification handle
1257 * @param[out] priv_id private ID
1258 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1259 * @retval NOTIFICATION_ERROR_NONE - success
1260 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1261 * @pre notification_new()
1262 * @post notification_free()
1263 * @see #notification_h
1266 #include <notification.h>
1269 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1271 noti_err = notification_insert(noti, NULL);
1272 if(noti_err != NOTIFICATION_ERROR_NONE) {
1278 notification_error_e notification_insert(notification_h noti,
1282 * @brief Update notification data.
1283 * @details The updated notification will be appeared on the notification area
1285 * @param[in] noti notification handle that is created by notification_new().
1286 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1287 * @retval NOTIFICATION_ERROR_NONE - success
1288 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1289 * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1292 * @see #notification_h
1295 #include <notification.h>
1298 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1300 noti_err = notification_update(NULL);
1301 if(noti_err != NOTIFICATION_ERROR_NONE) {
1307 notification_error_e notification_update(notification_h noti);
1310 * @brief Update a notification
1311 * @details The updated notification will be appeared on the notification area
1312 * @remarks This function update a notification in async manner
1313 * @param[in] noti notification handle that is created by notification_new().
1314 * @param[in] result_cb callback called when update completed
1315 * @param[in] user_data user data which you want to use in callback
1316 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1317 * @retval NOTIFICATION_ERROR_NONE - success
1318 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1319 * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1322 * @see #notification_h
1325 #include <notification.h>
1328 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1330 noti_err = notification_update_async(NULL, result_cb, data);
1331 if(noti_err != NOTIFICATION_ERROR_NONE) {
1337 notification_error_e notification_update_async(notification_h noti,
1338 void (*result_cb)(int priv_id, int result, void *data), void *user_data);
1341 * @brief This function clear all notification of type.
1342 * @details Not recommand API. Only for notification tray's clear button operation.
1344 * @param[in] type notification type
1345 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1346 * @retval NOTIFICATION_ERROR_NONE - success
1347 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1350 * @see #notification_type_e
1353 #include <notification.h>
1356 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1358 noti_err = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1359 if(noti_err != NOTIFICATION_ERROR_NONE) {
1365 notification_error_e notifiation_clear(notification_type_e type);
1368 * @brief Delete all the notifications of the type.
1369 * @details If pkgname is NULL, caller_pkgname is set internally.
1371 * @param[in] pkgname caller application package name or NULL
1372 * @param[in] type notification type
1373 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1374 * @retval NOTIFICATION_ERROR_NONE - success
1375 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1381 #include <notification.h>
1384 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1386 noti_err = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1387 if(noti_err != NOTIFICATION_ERROR_NONE) {
1393 notification_error_e notification_delete_all_by_type(const char *pkgname,
1394 notification_type_e type);
1397 * @brief Delete a notification by priv_id.
1398 * @details If pkgname is NULL, caller_pkgname is set internally.
1400 * @param[in] pkgname caller application package name or NULL
1401 * @param[in] type notification type
1402 * @param[in] priv_id priv ID
1403 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1404 * @retval NOTIFICATION_ERROR_NONE - success
1405 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1411 #include <notification.h>
1414 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1416 noti_err = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1417 if(noti_err != NOTIFICATION_ERROR_NONE) {
1423 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1424 notification_type_e type,
1428 * @brief Delete a notification with the given handle
1429 * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1431 * @param[in] noti notification handle
1432 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1433 * @retval NOTIFICATION_ERROR_NONE - success
1434 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1437 * @see #notification_h
1440 #include <notification.h>
1443 notificaton_h noti = NULL;
1444 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1448 noti_err = notification_delete(noti);
1449 if(noti_err != NOTIFICATION_ERROR_NONE) {
1456 notification_error_e notification_delete(notification_h noti);
1459 * @brief Update progress of inserted notification. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1460 * @details notification view on notification area could be updated
1462 * @param[in] noti notification handle or NULL if priv_id is valid
1463 * @param[in] priv_id private ID
1464 * @param[in] progress % value of progressive data
1465 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1466 * @retval NOTIFICATION_ERROR_NONE - success
1467 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1472 #include <notification.h>
1475 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1477 noti_err = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1478 if(noti_err != NOTIFICATION_ERROR_NONE) {
1484 notification_error_e notification_update_progress(notification_h noti,
1489 * @brief Update size of inserted notification data. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1490 * @details notification view on notification area could be updated
1492 * @param[in] noti notification handle or NULL if priv_id is valid
1493 * @param[in] priv_id private ID
1494 * @param[in] size bytes of progressive data
1495 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1496 * @retval NOTIFICATION_ERROR_NONE - success
1497 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1502 #include <notification.h>
1505 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1507 noti_err = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1508 if(noti_err != NOTIFICATION_ERROR_NONE) {
1514 notification_error_e notification_update_size(notification_h noti,
1515 int priv_id, double size);
1518 * @brief Update content of inserted notification data. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1519 * @details notification view on notification area could be updated
1521 * @param[in] noti notification handle or NULL if priv_id is valid
1522 * @param[in] priv_id private ID
1523 * @param[in] content text to update
1524 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1525 * @retval NOTIFICATION_ERROR_NONE - success
1526 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - Invalid input value
1531 #include <notification.h>
1534 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1536 noti_err = notification_update_content(NULL, APP_NOTI_PRIV_ID, "updated string");
1537 if(noti_err != NOTIFICATION_ERROR_NONE) {
1543 notification_error_e notification_update_content(notification_h noti,
1545 const char *content);
1548 * @brief Create internal structure data and return notification handle.
1549 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1550 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1551 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1552 * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1553 * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1554 * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1555 * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1557 * @param[in] type notification type
1558 * @param[in] group_id Group ID
1559 * @param[in] priv_id Priv ID
1560 * @return notification handle(#notification_h) if success, NULL if failure.
1561 * @retval #notification_h - success
1562 * @retval NULL - failure
1565 * @see #notification_type_e
1566 * @see #notification_h
1569 #include <notification.h>
1572 notification_h noti = NULL;
1574 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1582 notification_h notification_new(notification_type_e type, int group_id,
1586 * @brief This function create internal structure data and return notification handle.
1587 * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1588 * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1589 * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1591 * @param[in] type notification type
1592 * @return notification handle(#notification_h) if success, NULL if failure.
1593 * @retval #notification_h - success
1594 * @retval NULL - failure
1597 * @see #notification_type_e
1598 * @see #notification_h
1601 #include <notification.h>
1604 notification_h noti = NULL;
1606 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1614 notification_h notification_create(notification_type_e type);
1617 * @brief load a notification from the notification DB with private id
1620 * @param[in] type notification type
1621 * @param[in] group_id Group ID
1622 * @param[in] priv_id Priv ID
1623 * @return notification handle(#notification_h) if success, NULL if failure.
1624 * @retval #notification_h - success
1625 * @retval NULL - failure
1628 * @see #notification_type_e
1629 * @see #notification_h
1632 #include <notification.h>
1635 notification_h noti = NULL;
1637 noti = notification_load("org.tizen.app", priv_id);
1645 notification_h notification_load(char *pkgname,
1649 * @brief Create a notification clone
1650 * @details Newly created notification handle is returned.
1651 * @remarks This clone notification handle should be call notification_free().
1652 * @param[in] noti notification handle
1653 * @param[out] clone newly created notification handle that has same with input noti.
1654 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1655 * @retval NOTIFICATION_ERROR_NONE - success
1656 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1659 * @see #notification_type_e
1660 * @see #notification_h
1663 #include <notification.h>
1666 notification_h noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1667 notification_h clone = NULL;
1669 notification_clone(noti, &clone);
1674 notification_error_e notification_clone(notification_h noti, notification_h *clone);
1677 * @brief Free internal structure data of notification handle.
1678 * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1680 * @param[in] noti notification handle
1681 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1682 * @retval NOTIFICATION_ERROR_NONE - success
1683 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1684 * @pre notification_new()
1686 * @see #notification_h
1689 #include <notification.h>
1692 notification_h noti = NULL;
1693 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1695 noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1701 noti_err = notification_free(noti);
1702 if(noti_err != NOTIFICATION_ERROR_NONE) {
1708 notification_error_e notification_free(notification_h noti);
1715 * @addtogroup NOTIFICATION_LIST
1720 * @brief This function return notification list handle.
1721 * @details If count is -1, all of notification list is returned.
1723 * @param[in] type notification type
1724 * @param[in] count returned notification data number
1725 * @param[out] NOTIFICATION_ERROR_NONE if success, other value if failure.
1726 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1727 * @retval NOTIFICATION_ERROR_NONE - success
1728 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1731 * @see #notification_list_h
1734 #include <notification.h>
1737 notification_list_h noti_list = NULL;
1738 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1740 noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
1741 if(noti_err != NOTIFICATION_ERROR_NONE) {
1747 notification_error_e notification_get_list(notification_type_e type,
1749 notification_list_h * list);
1752 * @brief This function will be deprecated.
1753 * @see notification_get_grouping_list()
1756 notification_error_e notification_get_grouping_list(notification_type_e type,
1758 notification_list_h *list);
1761 * @brief This function return notification detail list handle of grouping data.
1762 * @details If count is -1, all of notification list is returned.
1764 * @param[in] pkgname caller application package name
1765 * @param[in] group_id group id
1766 * @param[in] priv_id private id
1767 * @param[in] count returned notification data number
1768 * @param[out] list notification list handle
1769 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1770 * @retval NOTIFICATION_ERROR_NONE - success
1771 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1774 * @see #notification_list_h
1777 #include <notification.h>
1780 notification_list_h noti_list = NULL;
1781 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1783 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
1784 if(noti_err != NOTIFICATION_ERROR_NONE) {
1790 notification_error_e notification_get_detail_list(const char *pkgname,
1794 notification_list_h *list);
1797 * @brief Free notification list
1800 * @param[in] list notification list handle
1801 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1802 * @retval NOTIFICATION_ERROR_NONE - success
1803 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1804 * @pre notification_get_grouping_list() or notification_get_detail_list ()
1806 * @see #notification_list_h
1809 #include <notification.h>
1812 notification_list_h noti_list = NULL;
1813 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1817 noti_err = notification_free_list(noti_list);
1818 if(noti_err != NOTIFICATION_ERROR_NONE) {
1824 notification_error_e notification_free_list(notification_list_h list);
1831 * @brief Register a callback for all notification events
1832 * @details The registered callback could be called for all notification events
1834 * @param[in] changed_cb callback function
1835 * @param[in] user_data user data
1836 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1837 * @retval NOTIFICATION_ERROR_NONE - success
1838 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1839 * @pre notification_new()
1841 * @see notification_unresister_changed_cb()
1844 #include <notification.h>
1847 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1848 if(noti_err != NOTIFICATION_ERROR_NONE) {
1854 notification_error_e
1855 notification_resister_changed_cb(
1856 void (*changed_cb)(void *data, notification_type_e type),
1860 * @brief Unregister a callback for all notification events
1863 * @param[in] changed_cb callback function
1864 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1865 * @retval NOTIFICATION_ERROR_NONE - success
1866 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1869 * @see notification_resister_changed_cb()
1872 #include <notification.h>
1875 noti_err = notification_unresister_changed_cb(app_changed_cb);
1876 if(noti_err != NOTIFICATION_ERROR_NONE) {
1882 notification_error_e
1883 notification_unresister_changed_cb(
1884 void (*changed_cb)(void *data, notification_type_e type));
1887 * @brief Register a callback for all notification events
1888 * @details The registered callback could be called for all notification events
1890 * @param[in] changed_cb callback function
1891 * @param[in] user_data user data
1892 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1893 * @retval NOTIFICATION_ERROR_NONE - success
1894 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1897 * @see notification_unregister_detailed_changed_cb()
1900 #include <notification.h>
1903 noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1904 if(noti_err != NOTIFICATION_ERROR_NONE) {
1910 notification_error_e
1911 notification_register_detailed_changed_cb(
1912 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1916 * @brief Unregister a callback for all notification events
1919 * @param[in] changed_cb callback function
1920 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1921 * @retval NOTIFICATION_ERROR_NONE - success
1922 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
1925 * @see notification_register_detailed_changed_cb()
1928 #include <notification.h>
1931 noti_err = notification_unresister_changed_cb(app_changed_cb);
1932 if(noti_err != NOTIFICATION_ERROR_NONE) {
1938 notification_error_e
1939 notification_unregister_detailed_changed_cb(
1940 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1944 * @brief Sets the tag of the notification handle.
1946 * @param[in] noti Notification handle
1947 * @param[in] tag tag for loading notification handle
1948 * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
1949 * @retval #NOTIFICATION_ERROR_NONE Success
1950 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1951 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1952 * @see notification_get_tag()
1955 #include <notification.h>
1958 notification_h noti = NULL;
1959 int noti_err = NOTIFICATION_ERROR_NONE;
1961 noti = notification_create(NOTIFICATION_TYPE_NOTI);
1967 noti_err = notification_set_tag(noti, tag);
1968 if(noti_err != NOTIFICATION_ERROR_NONE) {
1974 int notification_set_tag(notification_h noti, const char *tag);
1977 * @brief Gets the tag of the notification handle.
1979 * @param[in] noti Notification handle
1980 * @param[out] tag tag for loading notification handle
1981 * @return #NOTIFICATION_ERROR_NONE on success, other value on failure
1982 * @retval #NOTIFICATION_ERROR_NONE Success
1983 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
1984 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
1985 * @see notification_set_tag()
1988 #include <notification.h>
1991 int noti_err = NOTIFICATION_ERROR_NONE;
1992 const char *tag = NULL;
1996 noti_err = notification_get_tag(noti, &tag);
1997 if(noti_err != NOTIFICATION_ERROR_NONE) {
2003 int notification_get_tag(notification_h noti, const char **tag);
2006 * @brief Loads a notification from the notification's database with the tag.
2009 * @privilege %http://tizen.org/privilege/notification
2010 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
2011 * @param[in] tag tag for loading notification handle
2012 * @return Notification handle(notification_h) on success, NULL on failure
2013 * @retval notification_h Success
2014 * @retval NULL Failure
2015 * @exception #NOTIFICATION_ERROR_NONE Success
2016 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
2017 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
2018 * @exception #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
2019 * @see #notification_type_e
2022 #include <notification.h>
2025 notification_h noti = NULL;
2027 noti = notification_load_by_tag(tag);
2035 notification_h notification_load_by_tag(const char *tag);
2038 * @brief Posts a notification.
2041 * @privilege %http://tizen.org/privilege/notification
2042 * @param[in] noti Notification handle
2043 * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
2044 * @retval #NOTIFICATION_ERROR_NONE Success
2045 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
2046 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
2047 * @pre Notification handle should be created by notification_create().
2048 * @post notification_free().
2051 #include <notification.h>
2054 int noti_err = NOTIFICATION_ERROR_NONE;
2056 noti_err = notification_post(noti);
2057 if(noti_err != NOTIFICATION_ERROR_NONE) {
2063 int notification_post(notification_h noti);
2066 * @brief Get the information of notification event
2069 * @param[in] list notification list handle
2070 * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
2071 * @retval NOTIFICATION_ERROR_NONE - success
2072 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
2073 * @pre notification_get_grouping_list() or notification_get_detail_list ()
2075 * @see #notification_op
2077 notification_error_e notification_op_get_data(notification_op *noti_op,
2078 notification_op_data_type_e type,
2082 * @brief Wait for a response coming for this notification
2083 * @details The notification should have the EXECUTE_TYPE_RESPONDING flag
2085 * @param[in] noti notification handle
2086 * @param[in] timeout in seconds - 0 for infinite
2087 * @param[out] integer response
2088 * @param[out] text response
2089 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
2090 * @retval NOTIFICATION_ERROR_NONE - success
2091 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
2092 * @retval NOTIFICATION_ERROR_OUT_OF_MEMORY - not enough memory
2093 * @pre notification handle should be created by notification_new().
2097 notification_error_e notification_wait_response(notification_h noti,
2103 * @brief Send a response for a waiting notification
2106 * @param[in] noti notification handle
2107 * @param[in] integer response
2108 * @param[in] text response
2109 * @return NOTIFICATION_ERROR_NONE if success, other value if failure
2110 * @retval NOTIFICATION_ERROR_NONE - success
2111 * @retval NOTIFICATION_ERROR_INVALID_PARAMETER - invalid parameter
2112 * @retval NOTIFICATION_ERROR_OUT_OF_MEMORY - not enough memory
2113 * @pre notification handle should be created by notification_new().
2117 notification_error_e notification_send_response(notification_h noti,
2125 void notification_call_changed_cb(notification_op *op_list, int op_num);
2127 int notification_is_service_ready(void);
2129 notification_error_e notification_add_deffered_task(
2130 void (*deffered_task_cb)(void *data), void *user_data);
2132 notification_error_e notification_del_deffered_task(
2133 void (*deffered_task_cb)(void *data));
2136 * @addtogroup NOTIFICATION_DEPRECATED
2141 * @brief This function will be deprecated.
2142 * @see notification_set_image()
2145 notification_error_e notification_set_icon(notification_h noti,
2146 const char *icon_path);
2149 * @brief This function will be deprecated.
2150 * @see notification_get_image()
2153 notification_error_e notification_get_icon(notification_h noti,
2157 * @brief This function will be deprecated.
2158 * @see notification_set_text()
2161 notification_error_e notification_set_title(notification_h noti,
2163 const char *loc_title);
2166 * @brief This function will be deprecated.
2167 * @see notification_get_text()
2170 notification_error_e notification_get_title(notification_h noti,
2175 * @brief This function will be deprecated.
2176 * @see notification_set_text()
2179 notification_error_e notification_set_content(notification_h noti,
2180 const char *content,
2181 const char *loc_content);
2184 * @brief This function will be deprecated.
2185 * @see notification_get_text()
2188 notification_error_e notification_get_content(notification_h noti,
2190 char **loc_content);
2193 * @brief This function will be deprecated.
2194 * @see notification_set_execute_option()
2197 notification_error_e notification_set_application(notification_h noti, const char *pkgname); /* Do not use this */
2200 * @brief This function will be deprecated.
2201 * @see notification_get_execute_option()
2204 notification_error_e notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
2207 * @brief This function will be deprecated.
2208 * @see notification_set_execute_option()
2211 notification_error_e notification_set_args(notification_h noti, bundle * args, bundle * group_args); /* Do not use this */
2214 * @brief This function will be deprecated.
2215 * @see notification_get_execute_option()
2218 notification_error_e notification_get_args(notification_h noti, bundle ** args, bundle ** group_args); /* Do not use this */
2221 * @brief This function will be deprecated.
2222 * @see notification_delete_by_priv_id()
2225 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
2226 notification_type_e type,
2230 * @brief This function will be deprecated.
2231 * @see notification_delete_by_priv_id()
2234 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
2235 notification_type_e type,
2238 * @brief This function will be deprecated.
2241 notification_error_e notification_get_count(notification_type_e type,
2242 const char *pkgname,
2243 int group_id, int priv_id,
2253 #endif /* __NOTIFICATION_H__ */