Release version 0.7.18
[platform/core/api/notification.git] / include / notification.h
1 /*
2  *  libnotification
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
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>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 #ifndef __NOTIFICATION_H__
23 #define __NOTIFICATION_H__
24
25 #include <time.h>
26 #include <bundle.h>
27
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>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 /**
39  * @file notification.h
40  * @brief This file contains the notification APIs
41  */
42
43 /**
44  * @addtogroup NOTIFICATION_MODULE
45  * @{
46  */
47
48 /**
49  * @brief Set absolute path for image file to display on notification view
50  * @details 
51  * @remarks
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_DATA - Invalide parameter
58  * @pre Notification handle should be created by notification_new()
59  * @post
60  * @see #notification_image_type_e
61  * @see notification_new()
62  * @par Sample code:
63  * @code
64 #include <notification.h>
65 ...
66 {
67         notification_h noti = NULL;
68         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
69
70         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
71         if(noti == NULL) {
72                 return;
73         }
74
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);
78                 return;
79         }
80 }
81  * @endcode
82  */
83 notification_error_e notification_set_image(notification_h noti,
84                                             notification_image_type_e type,
85                                             const char *image_path);
86
87 /**
88  * @brief Get absolute path for image file
89  * @details 
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_DATA - Invalide parameter
97  * @pre Notification handle should be created by notification_new()
98  * @post
99  * @see #notification_image_type_e
100  * @see notification_new()
101  * @par Sample code:
102  * @code
103  #include <notification.h>
104  ...
105  {
106         char *image_path = NULL;
107         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
108         
109         noti_err  = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
110         if(noti_err != NOTIFICATION_ERROR_NONE) {
111                 return;
112         }
113 }
114  * @endcode
115  */
116 notification_error_e notification_get_image(notification_h noti,
117                                             notification_image_type_e type,
118                                             char **image_path);
119
120 /**
121  * @brief Set a timestamp
122  * @details If input_time is 0, time information is set by current time.
123  * @remarks
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_DATA - Invalide parameter
129  * @pre Notification handle should be created by notification_new()
130  * @post
131  * @see notification_new()
132  * @par Sample code:
133  * @code
134 #include <notification.h>
135  ...
136   {
137          notification_h noti = NULL;
138          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
139          
140          noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
141          if(noti == NULL) {
142                  return;
143          }
144  
145          noti_err  = notification_set_time(noti, time(NULL));
146          if(noti_err != NOTIFICATION_ERROR_NONE) {
147                 notification_free(noti);
148                  return;
149          }
150  }
151  * @endcode
152  */
153 notification_error_e notification_set_time(notification_h noti,
154                                            time_t input_time);
155
156 /**
157  * @brief Get a timestamp
158  * @details If ret_time is 0, time information is not set before.
159  * @remarks
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_DATA - Invalide parameter
165  * @pre Notification handle should be created by notification_new()
166  * @post
167  * @see notification_new()
168  * @par Sample code:
169  * @code
170  #include <notification.h>
171  ...
172  {
173         time_t ret_time;
174         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
175         
176         noti_err  = notification_get_time(noti, &ret_time);
177         if(noti_err != NOTIFICATION_ERROR_NONE) {
178                 return;
179         }
180 }
181  * @endcode
182  */
183 notification_error_e notification_get_time(notification_h noti,
184                                            time_t * ret_time);
185
186 /**
187  * @brief Get timestamp that the notification is inserted
188  * @details If ret_time is 0, this notification data is not inserted before.
189  * @remarks
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_DATA - Invalide parameter
195  * @pre 
196  * @post
197  * @see 
198  * @par Sample code:
199  * @code
200  #include <notification.h>
201   ...
202   {
203          time_t ret_time;
204          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
205          
206          noti_err  = notification_get_insert_time(noti, &ret_time);
207          if(noti_err != NOTIFICATION_ERROR_NONE) {
208                  return;
209          }
210  }
211  * @endcode
212  */
213 notification_error_e notification_get_insert_time(notification_h noti,
214                                                   time_t * ret_time);
215
216 /**
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.
227  * @remarks
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_DATA - Invalide parameter
236  * @pre notification handle should be created by notification_new().
237  * @post
238  * @see
239  * @par Sample code:
240  * @code
241 #include <notification.h>
242 ...
243 {
244         notification_h noti = NULL;
245         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
246
247         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
248         if(noti == NULL) {
249                 return;
250         }
251
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);
255                 return;
256         }
257 }
258  * @endcode
259  */
260 notification_error_e notification_set_text(notification_h noti,
261                                            notification_text_type_e type,
262                                            const char *text,
263                                            const char *key,
264                                            int args_type, ...);
265
266 /**
267  * @brief Get the text from the notification handle
268  * @details
269  * @remarks
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_DATA - Invalide parameter
276  * @pre
277  * @post
278  * @see
279  * @par Sample code:
280  * @code
281 #include <notification.h>
282 ...
283 {
284         notification_h noti = NULL;
285         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
286         char *text = NULL;
287
288         noti_err  = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
289         if(noti_err != NOTIFICATION_ERROR_NONE) {
290                 return;
291         }
292 }
293  * @endcode
294  */
295 notification_error_e notification_get_text(notification_h noti,
296                                            notification_text_type_e type,
297                                            char **text);
298
299 /**
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
302  * @remarks
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_DATA - Invalide parameter
309  * @pre notification handle should be created by notification_new().
310  * @post
311  * @see
312  */
313 notification_error_e notification_set_time_to_text(notification_h noti, notification_text_type_e type,
314                                                                 time_t time);
315
316 /**
317  * @brief Get a timestamp from the notification handle
318  * @details
319  * @remarks
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_DATA - Invalide parameter
326  * @pre notification handle should be created by notification_new().
327  * @post
328  * @see
329  */
330 notification_error_e notification_get_time_from_text(notification_h noti, notification_text_type_e type,
331                                                                 time_t *time);
332
333 /**
334  * @brief Set text domain to localize the notification
335  * @details
336  * @remarks
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_DATA - Invalide parameter
343  * @pre
344  * @post
345  * @see
346  * @par Sample code:
347  * @code
348 #include <notification.h>
349 ...
350 {
351         notification_h noti = NULL;
352         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
353
354         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
355         if(noti == NULL) {
356                 return;
357         }
358
359         noti_err  = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
360         if(noti_err != NOTIFICATION_ERROR_NONE) {
361                 notification_free(noti);
362                 return;
363         }
364 }
365  * @endcode
366  */
367 notification_error_e notification_set_text_domain(notification_h noti,
368                                                   const char *domain,
369                                                   const char *dir);
370
371 /**
372  * @brief Get text domain from the notification handle
373  * @details
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_DATA - Invalide parameter
381  * @pre
382  * @post
383  * @see
384  * @par Sample code:
385  * @code
386 #include <notification.h>
387 ...
388 {
389         notification_h noti = NULL;
390         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
391         char *domain = NULL;
392         char *dir = NULL;
393
394         noti_err  = notification_get_text_domain(noti, &domain, &dir);
395         if(noti_err != NOTIFICATION_ERROR_NONE) {
396                 return;
397         }
398 }
399  * @endcode
400  */
401 notification_error_e notification_get_text_domain(notification_h noti,
402                                                   char **domain,
403                                                   char **dir);
404
405 /**
406  * @brief Set sound option for the notification
407  * @details
408  * @remarks
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_DATA - Invalide parameter
415  * @pre
416  * @post
417  * @see
418  * @par Sample code:
419  * @code
420 #include <notification.h>
421 ...
422 {
423         notification_h noti = NULL;
424         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
425
426         noti_err  = notification_set_sound(noti, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL);
427         if(noti_err != NOTIFICATION_ERROR_NONE) {
428                 return;
429         }
430 }
431  * @endcode
432  */
433 notification_error_e notification_set_sound(notification_h noti,
434                                             notification_sound_type_e type,
435                                             const char *path);
436
437 /**
438  * @brief Get sound option from the notification handle
439  * @details
440  * @remarks
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_DATA - Invalide parameter
447  * @pre
448  * @post
449  * @see
450  * @par Sample code:
451  * @code
452 #include <notification.h>
453 ...
454 {
455         notification_h noti = NULL;
456         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
457         notification_sound_type_e type = NOTIFICATION_SOUND_TYPE_NONE;
458
459         noti_err  = notification_get_sound(noti, &type, NULL);
460         if(noti_err != NOTIFICATION_ERROR_NONE) {
461                 return;
462         }
463 }
464  * @endcode
465  */
466 notification_error_e notification_get_sound(notification_h noti,
467                                             notification_sound_type_e *type,
468                                             const char **path);
469
470 /**
471  * @brief Set vibrate option for the notification
472  * @details
473  * @remarks
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_DATA - Invalide parameter
480  * @pre
481  * @post
482  * @see
483  * @par Sample code:
484  * @code
485 #include <notification.h>
486 ...
487 {
488         notification_h noti = NULL;
489         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
490
491         noti_err  = notification_set_vibration(noti, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
492         if(noti_err != NOTIFICATION_ERROR_NONE) {
493                 return;
494         }
495 }
496  * @endcode
497  */
498 notification_error_e notification_set_vibration(notification_h noti,
499                                                 notification_vibration_type_e type,
500                                                 const char *path);
501
502 /**
503   * @brief Get vibrate option from the notification handle
504   * @details
505   * @remarks
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_DATA - Invalide parameter
512   * @pre
513   * @post
514   * @see 
515   * @par Sample code:
516   * @code
517 #include <notification.h>
518 ...
519  {
520         notification_h noti = NULL;
521         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
522         notification_vibration_type_e type = NOTIFICATION_VIBRATION_TYPE_NONE;
523
524         noti_err  = notification_get_vibration(noti, &type, NULL);
525         if(noti_err != NOTIFICATION_ERROR_NONE) {
526                 return;
527         }
528 }
529   * @endcode
530   */
531 notification_error_e notification_get_vibration(notification_h noti,
532                                                 notification_vibration_type_e *type,
533                                                 const char **path);
534
535 /**
536  * @brief Set option of displaying the LED
537  * @details
538  * @remarks
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_DATA - Invalide parameter
545  * @pre
546  * @post
547  * @see
548  * @par Sample code:
549  * @code
550 #include <notification.h>
551 ...
552 {
553         notification_h noti = NULL;
554         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
555
556         noti_err  = notification_set_led(noti, NOTIFICATION_LED_TYPE_DEFAULT, NULL);
557         if(noti_err != NOTIFICATION_ERROR_NONE) {
558                 return;
559         }
560 }
561  * @endcode
562  */
563 notification_error_e notification_set_led(notification_h noti,
564                                                 notification_led_op_e operation,
565                                                 int led_argb);
566
567 /**
568   * @brief Get option of displaying the LED from the notification handle
569   * @details
570   * @remarks
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_DATA - Invalide parameter
577   * @pre
578   * @post
579   * @see
580   * @par Sample code:
581   * @code
582 #include <notification.h>
583 ...
584  {
585         notification_h noti = NULL;
586         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
587         notification_led_type_e type = NOTIFICATION_LED_TYPE_NONE;
588
589         noti_err  = notification_get_led(noti, &type, NULL);
590         if(noti_err != NOTIFICATION_ERROR_NONE) {
591                 return;
592         }
593 }
594   * @endcode
595   */
596 notification_error_e notification_get_led(notification_h noti,
597                                                 notification_led_op_e *operation,
598                                                 int *led_argb);
599
600 /**
601  * @brief Set time period of flashing the LED
602  * @details
603  * @remarks
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_DATA - Invalide parameter
610  * @pre
611  * @post
612  * @see
613  * @par Sample code:
614  * @code
615 #include <notification.h>
616 ...
617 {
618         notification_h noti = NULL;
619         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
620
621         noti_err  = notification_set_led_time_period(noti, 100, 100);
622         if(noti_err != NOTIFICATION_ERROR_NONE) {
623                 return;
624         }
625 }
626  * @endcode
627  */
628 notification_error_e notification_set_led_time_period(notification_h noti,
629                                                 int on_ms, int off_ms);
630
631 /**
632   * @brief Get time period of flashing the LED from the notification handle
633   * @details
634   * @remarks
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_DATA - Invalide parameter
641   * @pre
642   * @post
643   * @see
644   * @par Sample code:
645   * @code
646 #include <notification.h>
647 ...
648  {
649         notification_h noti = NULL;
650         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
651         int led_on_ms = 0;
652         int led_off_ms = 0;
653
654         noti_err  = notification_get_led_time_period(noti, &led_on_ms, &led_off_ms);
655         if(noti_err != NOTIFICATION_ERROR_NONE) {
656                 return;
657         }
658 }
659   * @endcode
660   */
661 notification_error_e notification_get_led_time_period(notification_h noti,
662                                                 int *on_ms, int *off_ms);
663
664 /**
665  * @brief Set execution option for a notification
666  * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
667  * @remarks
668  * @param[in] noti notification handle
669  * @param[in] type notification execute type
670  * @param[in] text basic text for button
671  * @param[in] key value for localizaed text
672  * @param[in] service_handle appsvc bundle data
673  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
674  * @retval NOTIFICATION_ERROR_NONE - success
675  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
676  * @pre
677  * @post
678  * @see
679  * @par Sample code:
680  * @code
681 #include <notification.h>
682 ...
683 {
684         notification_h noti = NULL;
685         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
686         bundle *b = NULL;
687
688         ...
689
690         b = bundle_create();
691         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
692         appsvc_set_uri(b,"http://www.samsung.com");
693
694         noti_err  = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
695         if(noti_err != NOTIFICATION_ERROR_NONE) {
696                 notification_free(noti);
697                 return;
698         }
699
700         bundle_free(b);
701 }
702  * @endcode
703  */
704 notification_error_e notification_set_execute_option(notification_h noti,
705                                                      notification_execute_type_e type,
706                                                      const char *text,
707                                                      const char *key,
708                                                      bundle *service_handle);
709
710 /**
711  * @brief Get execution option from the notification handle
712  * @details
713  * @remarks
714  * @param[in] noti notification handle
715  * @param[in] type notification execute type
716  * @param[out] text text for button
717  * @param[out] service_handle appsvc bundle data
718  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
719  * @retval NOTIFICATION_ERROR_NONE - success
720  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
721  * @pre
722  * @post
723  * @see
724  * @par Sample code:
725  * @code
726 #include <notification.h>
727 ...
728 {
729         notification_h noti = NULL;
730         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
731         bundle *b = NULL;
732
733         ...
734
735         noti_err  = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
736         if(noti_err != NOTIFICATION_ERROR_NONE) {
737                 notification_free(noti);
738                 return;
739         }
740 }
741  * @endcode
742  */
743 notification_error_e notification_get_execute_option(notification_h noti,
744                                                      notification_execute_type_e type,
745                                                      const char **text,
746                                                      bundle **service_handle);
747
748 /**
749  * @brief Set the property of the notification
750  * @details
751  * @remarks
752  * @param[in] noti notification handle
753  * @param[in] flags property with | operation
754  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
755  * @retval NOTIFICATION_ERROR_NONE - success
756  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
757  * @pre
758  * @post
759  * @see
760  * @par Sample code:
761  * @code
762 #include <notification.h>
763 ...
764 {
765         notification_h noti = NULL;
766         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
767         bundle *b = NULL;
768
769         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
770         if(noti == NULL) {
771                 return;
772         }
773
774         noti_err  = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
775         if(noti_err != NOTIFICATION_ERROR_NONE) {
776                 notification_free(noti);
777                 return;
778         }
779 }
780  * @endcode
781  */
782 notification_error_e notification_set_property(notification_h noti,
783                                                int flags);
784
785 /**
786  * @brief Get the property of the notification from the notification handle
787  * @details
788  * @remarks
789  * @param[in] noti notification handle
790  * @param[out] flags notification property
791  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
792  * @retval NOTIFICATION_ERROR_NONE - success
793  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
794  * @pre
795  * @post
796  * @see
797  * @par Sample code:
798  * @code
799 #include <notification.h>
800 ...
801 {
802         notification_h noti = NULL;
803         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
804         int flags = 0;
805
806         noti_err  = notification_get_property(noti, &flags);
807         if(noti_err != NOTIFICATION_ERROR_NONE) {
808                 return;
809         }
810 }
811  * @endcode
812  */
813 notification_error_e notification_get_property(notification_h noti,
814                                                int *flags);
815
816 /**
817  * @brief Set applications to display the notification
818  * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
819  * @remarks
820  * @param[in] noti notification handle
821  * @param[in] applist with | operation
822  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
823  * @retval NOTIFICATION_ERROR_NONE - success
824  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
825  * @pre
826  * @post
827  * @see
828  * @par Sample code:
829  * @code
830 #include <notification.h>
831 ...
832 {
833         notification_h noti = NULL;
834         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
835         bundle *b = NULL;
836
837         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
838         if(noti == NULL) {
839                 return;
840         }
841
842         noti_err  = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
843         if(noti_err != NOTIFICATION_ERROR_NONE) {
844                 notification_free(noti);
845                 return;
846         }
847 }
848 }
849  * @endcode
850  */
851 notification_error_e notification_set_display_applist(notification_h noti,
852                                                       int applist);
853
854 /**
855  * @brief Get application list to display the notification from the notification handle
856  * @details
857  * @remarks
858  * @param[in] noti notification handle
859  * @param[out] applist display application list.
860  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
861  * @retval NOTIFICATION_ERROR_NONE - success
862  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
863  * @pre
864  * @post
865  * @see
866  * @par Sample code:
867  * @code
868 #include <notification.h>
869 ...
870 {
871         notification_h noti = NULL;
872         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
873         int applist = 0;
874
875         noti_err  = notification_get_display_applist(noti, &applist);
876         if(noti_err != NOTIFICATION_ERROR_NONE) {
877                 return;
878         }
879 }
880  * @endcode
881  */
882 notification_error_e notification_get_display_applist(notification_h noti,
883                                                       int *applist);
884
885 /**
886  * @brief Set initial size for ongoing type.
887  * @details After notification_insert, it does not upate size. If you want to update size, please call notification_update_size().
888  * @remarks
889  * @param[in] noti notification handle
890  * @param[in] size double type size.
891  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
892  * @retval NOTIFICATION_ERROR_NONE - success
893  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
894  * @pre
895  * @post
896  * @see
897  * @par Sample code:
898  * @code
899 #include <notification.h>
900 ...
901 {
902         notification_h noti = NULL;
903         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
904
905         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
906         if(noti == NULL) {
907                 return;
908         }
909
910         noti_err  = notification_set_size(noti, 0.0);
911         if(noti_err != NOTIFICATION_ERROR_NONE) {
912                 notification_free(noti);
913                 return;
914         }
915 }
916  * @endcode
917  */
918 notification_error_e notification_set_size(notification_h noti,
919                                            double size);
920
921 /**
922  * @brief Get progress size.
923  * @details
924  * @remarks
925  * @param[in] noti notification handle
926  * @param[out] size progress size
927  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
928  * @retval NOTIFICATION_ERROR_NONE - success
929  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
930  * @pre
931  * @post
932  * @see
933  * @par Sample code:
934  * @code
935 #include <notification.h>
936 ...
937 {
938         notification_h noti = NULL;
939         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
940         double size = 0.0;
941
942         noti_err  = notification_get_size(noti, &size);
943         if(noti_err != NOTIFICATION_ERROR_NONE) {
944                 return;
945         }
946 }
947  * @endcode
948  */
949 notification_error_e notification_get_size(notification_h noti,
950                                            double *size);
951
952 /**
953  * @brief Set initial progress for ongoing type.
954  * @details After notification_insert, it does not upate progress. If you want to update progress, please call notification_update_progress().
955  * @remarks
956  * @param[in] noti notification handle
957  * @param[in] percentage progress percentage
958  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
959  * @retval NOTIFICATION_ERROR_NONE - success
960  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
961  * @pre
962  * @post
963  * @see
964  * @par Sample code:
965  * @code
966 #include <notification.h>
967 ...
968 {
969         notification_h noti = NULL;
970         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
971
972         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
973         if(noti == NULL) {
974                 return;
975         }
976
977         noti_err  = notification_set_progress(noti, 0.0);
978         if(noti_err != NOTIFICATION_ERROR_NONE) {
979                 notification_free(noti);
980                 return;
981         }
982 }
983  * @endcode
984  */
985 notification_error_e notification_set_progress(notification_h noti,
986                                                double percentage);
987
988 /**
989  * @brief Get progress from the notification handle
990  * @details
991  * @remarks At the end of the operation, progress should be 1.0
992  * @param[in] noti notification handle
993  * @param[out] percentage progress percentage
994  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
995  * @retval NOTIFICATION_ERROR_NONE - success
996  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
997  * @pre
998  * @post
999  * @see
1000  * @par Sample code:
1001  * @code
1002 #include <notification.h>
1003 ...
1004 {
1005         notification_h noti = NULL;
1006         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1007         double percentage = 0.0;
1008
1009         noti_err  = notification_get_progress(noti, &percentage);
1010         if(noti_err != NOTIFICATION_ERROR_NONE) {
1011                 return;
1012         }
1013 }
1014  * @endcode
1015  */
1016 notification_error_e notification_get_progress(notification_h noti,
1017                                                double *percentage);
1018
1019 /**
1020  * @brief Set the package name of caller
1021  * @details caller_pkgname is set automatically when notification_new. We are not recommend to use this API.
1022  * @remarks
1023  * @param[in] noti notification handle
1024  * @param[in] pkgname caller package name
1025  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1026  * @retval NOTIFICATION_ERROR_NONE - success
1027  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1028  * @pre
1029  * @post
1030  * @see
1031  * @par Sample code:
1032  * @code
1033 #include <notification.h>
1034 ...
1035 {
1036         notification_h noti = NULL;
1037         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1038
1039         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1040         if(noti == NULL) {
1041                 return;
1042         }
1043
1044         noti_err  = notification_set_pkgname(noti, "com.samsung.phone");
1045         if(noti_err != NOTIFICATION_ERROR_NONE) {
1046                 notification_free(noti);
1047                 return;
1048         }
1049 }
1050  * @endcode
1051  */
1052 notification_error_e notification_set_pkgname(notification_h noti,
1053                                               const char *pkgname);
1054
1055 /**
1056  * @brief Get the package name of caller from the notification handle
1057  * @details
1058  * @remarks
1059  * @param[in] noti notification handle
1060  * @param[out] pkgname caller package name
1061  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1062  * @retval NOTIFICATION_ERROR_NONE - success
1063  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1064  * @pre
1065  * @post
1066  * @see
1067  * @par Sample code:
1068  * @code
1069 #include <notification.h>
1070 ...
1071 {
1072         notification_h noti = NULL;
1073         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1074         char *pkgname = NULL;
1075
1076         noti_err  = notification_get_pkgname(noti, &pkgname);
1077         if(noti_err != NOTIFICATION_ERROR_NONE) {
1078                 return;
1079         }
1080 }
1081  * @endcode
1082  */
1083 notification_error_e notification_get_pkgname(notification_h noti,
1084                                               char **pkgname);
1085
1086 /**
1087  * @brief Set the layout of the notification view
1088  * @details caller can set displaying layout of notification
1089  * @remarks
1090  * @param[in] noti notification handle
1091  * @param[in] type of layout
1092  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1093  * @retval NOTIFICATION_ERROR_NONE - success
1094  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1095  * @pre
1096  * @post
1097  * @see #notification_ly_type_e
1098  */
1099 notification_error_e notification_set_layout(notification_h noti,
1100                 notification_ly_type_e layout);
1101
1102 /**
1103  * @brief Get the layout of the notification view from the notification handle
1104  * @details
1105  * @remarks
1106  * @param[in] noti notification handle
1107  * @param[out] type of layout
1108  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1109  * @retval NOTIFICATION_ERROR_NONE - success
1110  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1111  * @pre
1112  * @post
1113  * @see #notification_ly_type_e
1114  */
1115 notification_error_e notification_get_layout(notification_h noti,
1116                 notification_ly_type_e *layout);
1117
1118 /**
1119  * @brief Get Group ID and Private ID
1120  * @details
1121  * @remarks ID is valid only after inserting the notification
1122  * @param[in] noti notification handle
1123  * @param[out] group_id Group ID
1124  * @param[out] priv_id Private ID
1125  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1126  * @retval NOTIFICATION_ERROR_NONE - success
1127  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1128  * @pre 
1129  * @post
1130  * @see 
1131  * @par Sample code:
1132  * @code
1133 #include <notification.h>
1134  ...
1135   {
1136          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1137          int group_id, priv_id;
1138  
1139          noti_err  = notification_get_id(noti, &group_id, &priv_id);
1140          if(noti_err != NOTIFICATION_ERROR_NONE) {
1141                  return;
1142          }
1143  }
1144  * @endcode
1145  */
1146 notification_error_e notification_get_id(notification_h noti,
1147                                          int *group_id, int *priv_id);
1148
1149 /**
1150  * @brief Get the type of notification
1151  * @details
1152  * @remarks
1153  * @param[in] noti notification handle
1154  * @param[out] type notification type
1155  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1156  * @retval NOTIFICATION_ERROR_NONE - success
1157  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1158  * @pre 
1159  * @post
1160  * @see 
1161  * @par Sample code:
1162  * @code
1163 #include <notification.h>
1164 ...
1165  {
1166         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1167         notification_type_e type;
1168
1169         noti_err  = notification_get_type(noti, &type);
1170         if(noti_err != NOTIFICATION_ERROR_NONE) {
1171                 return;
1172         }
1173 }
1174  * @endcode
1175  */
1176 notification_error_e notification_get_type(notification_h noti,
1177                                            notification_type_e * type);
1178
1179 /**
1180  * @brief Insert a notification
1181  * @details A notification will be inserted to DB and then it will be appeared on the notification area
1182  * When notification_new() call, if priv_id is NOTIFICATION_PRIV_ID_NONE, priv_id is return internally set priv_id.
1183  * @remarks
1184  * @param[in] noti notification handle
1185  * @param[out] priv_id private ID
1186  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1187  * @retval NOTIFICATION_ERROR_NONE - success
1188  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1189  * @pre notification_new()
1190  * @post notification_free()
1191  * @see #notification_h
1192  * @par Sample code:
1193  * @code
1194 #include <notification.h>
1195 ...
1196  {
1197         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1198
1199         noti_err  = notification_insert(noti, NULL);
1200         if(noti_err != NOTIFICATION_ERROR_NONE) {
1201                 return;
1202         }
1203 }
1204  * @endcode
1205  */
1206 notification_error_e notification_insert(notification_h noti,
1207                                          int *priv_id);
1208
1209 /**
1210  * @brief Update notification data.
1211  * @details The updated notification will be appeared on the notification area
1212  * @remarks
1213  * @param[in] noti notification handle that is created by notification_new().
1214  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1215  * @retval NOTIFICATION_ERROR_NONE - success
1216  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1217  * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1218  * @pre
1219  * @post
1220  * @see #notification_h
1221  * @par Sample code:
1222  * @code
1223 #include <notification.h>
1224 ...
1225  {
1226         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1227
1228         noti_err  = notification_update(NULL);
1229         if(noti_err != NOTIFICATION_ERROR_NONE) {
1230                 return;
1231         }
1232 }
1233  * @endcode
1234  */
1235 notification_error_e notification_update(notification_h noti);
1236
1237 /**
1238  * @brief Update a notification
1239  * @details The updated notification will be appeared on the notification area
1240  * @remarks This function update a notification in async manner
1241  * @param[in] noti notification handle that is created by notification_new().
1242  * @param[in] result_cb callback called when update completed
1243  * @param[in] user_data user data which you want to use in callback
1244  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1245  * @retval NOTIFICATION_ERROR_NONE - success
1246  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1247  * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1248  * @pre
1249  * @post
1250  * @see #notification_h
1251  * @par Sample code:
1252  * @code
1253 #include <notification.h>
1254 ...
1255  {
1256         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1257
1258         noti_err  = notification_update_async(NULL, result_cb, data);
1259         if(noti_err != NOTIFICATION_ERROR_NONE) {
1260                 return;
1261         }
1262 }
1263  * @endcode
1264  */
1265 notification_error_e notification_update_async(notification_h noti,
1266                 void (*result_cb)(int priv_id, int result, void *data), void *user_data);
1267
1268 /**
1269  * @brief This function clear all notification of type.
1270  * @details Not recommand API. Only for notification tray's clear button operation.
1271  * @remarks
1272  * @param[in] type notification type
1273  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1274  * @retval NOTIFICATION_ERROR_NONE - success
1275  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1276  * @pre
1277  * @post
1278  * @see #notification_type_e
1279  * @par Sample code:
1280  * @code
1281 #include <notification.h>
1282 ...
1283  {
1284         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1285
1286         noti_err  = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1287         if(noti_err != NOTIFICATION_ERROR_NONE) {
1288                 return;
1289         }
1290 }
1291  * @endcode
1292  */
1293 notification_error_e notifiation_clear(notification_type_e type);
1294
1295 /**
1296  * @brief Delete all the notifications of the type.
1297  * @details If pkgname is NULL, caller_pkgname is set internally.
1298  * @remarks
1299  * @param[in] pkgname caller application package name or NULL
1300  * @param[in] type notification type
1301  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1302  * @retval NOTIFICATION_ERROR_NONE - success
1303  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1304  * @pre
1305  * @post
1306  * @see
1307  * @par Sample code:
1308  * @code
1309 #include <notification.h>
1310 ...
1311  {
1312         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1313
1314         noti_err  = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1315         if(noti_err != NOTIFICATION_ERROR_NONE) {
1316                 return;
1317         }
1318 }
1319  * @endcode
1320  */
1321 notification_error_e notification_delete_all_by_type(const char *pkgname,
1322                                                      notification_type_e type);
1323
1324 /**
1325  * @brief Delete a notification by priv_id.
1326  * @details If pkgname is NULL, caller_pkgname is set internally.
1327  * @remarks
1328  * @param[in] pkgname caller application package name or NULL
1329  * @param[in] type notification type
1330  * @param[in] priv_id priv ID
1331  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1332  * @retval NOTIFICATION_ERROR_NONE - success
1333  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1334  * @pre
1335  * @post
1336  * @see
1337  * @par Sample code:
1338  * @code
1339 #include <notification.h>
1340 ...
1341  {
1342         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1343
1344         noti_err  = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1345         if(noti_err != NOTIFICATION_ERROR_NONE) {
1346                 return;
1347         }
1348 }
1349  * @endcode
1350  */
1351 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1352                                                     notification_type_e type,
1353                                                     int priv_id);
1354
1355 /**
1356  * @brief Delete a notification with the given handle
1357  * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1358  * @remarks
1359  * @param[in] noti notification handle
1360  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1361  * @retval NOTIFICATION_ERROR_NONE - success
1362  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1363  * @pre
1364  * @post
1365  * @see #notification_h
1366  * @par Sample code:
1367  * @code
1368 #include <notification.h>
1369 ...
1370  {
1371         notificaton_h noti = NULL;
1372         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1373
1374         ...
1375
1376         noti_err  = notification_delete(noti);
1377         if(noti_err != NOTIFICATION_ERROR_NONE) {
1378                 return;
1379         }
1380
1381 }
1382  * @endcode
1383  */
1384 notification_error_e notification_delete(notification_h noti);
1385
1386 /**
1387  * @brief Update progress of inserted notification. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1388  * @details notification view on notification area could be updated
1389  * @remarks
1390  * @param[in] noti notification handle or NULL if priv_id is valid
1391  * @param[in] priv_id private ID
1392  * @param[in] progress % value of progressive data
1393  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1394  * @retval NOTIFICATION_ERROR_NONE - success
1395  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1396  * @pre
1397  * @post
1398  * @par Sample code:
1399  * @code
1400 #include <notification.h>
1401 ...
1402  {
1403         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1404
1405         noti_err  = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1406         if(noti_err != NOTIFICATION_ERROR_NONE) {
1407                 return;
1408         }
1409 }
1410  * @endcode
1411  */
1412 notification_error_e notification_update_progress(notification_h noti,
1413                                                   int priv_id,
1414                                                   double progress);
1415
1416 /**
1417  * @brief Update size of inserted notification data. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1418  * @details notification view on notification area could be updated
1419  * @remarks
1420  * @param[in] noti notification handle or NULL if priv_id is valid
1421  * @param[in] priv_id private ID
1422  * @param[in] size bytes of progressive data
1423  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1424  * @retval NOTIFICATION_ERROR_NONE - success
1425  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1426  * @pre
1427  * @post
1428  * @par Sample code:
1429  * @code
1430 #include <notification.h>
1431 ...
1432  {
1433         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1434
1435         noti_err  = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1436         if(noti_err != NOTIFICATION_ERROR_NONE) {
1437                 return;
1438         }
1439 }
1440  * @endcode
1441  */
1442 notification_error_e notification_update_size(notification_h noti,
1443                                               int priv_id, double size);
1444
1445 /**
1446  * @brief Update content of inserted notification data. Only for the ongoing notification(NOTIFICATION_TYPE_ONGOING)
1447  * @details notification view on notification area could be updated
1448  * @remarks
1449  * @param[in] noti notification handle or NULL if priv_id is valid
1450  * @param[in] priv_id private ID
1451  * @param[in] content text to update
1452  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1453  * @retval NOTIFICATION_ERROR_NONE - success
1454  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1455  * @pre
1456  * @post
1457  * @par Sample code:
1458  * @code
1459 #include <notification.h>
1460 ...
1461  {
1462         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1463
1464         noti_err  = notification_update_content(NULL, APP_NOTI_PRIV_ID, "updated string");
1465         if(noti_err != NOTIFICATION_ERROR_NONE) {
1466                 return;
1467         }
1468 }
1469  * @endcode
1470  */
1471 notification_error_e notification_update_content(notification_h noti,
1472                                                          int priv_id,
1473                                                          const char *content);
1474
1475 /**
1476  * @brief Create internal structure data and return notification handle.
1477  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1478  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1479  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1480  * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT, 
1481  * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1482  * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1483  * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1484  * @remarks
1485  * @param[in] type notification type
1486  * @param[in] group_id Group ID
1487  * @param[in] priv_id Priv ID
1488  * @return notification handle(#notification_h) if success, NULL if failure.
1489  * @retval #notification_h - success
1490  * @retval NULL - failure
1491  * @pre
1492  * @post
1493  * @see #notification_type_e
1494  * @see #notification_h
1495  * @par Sample code:
1496  * @code
1497 #include <notification.h>
1498 ...
1499 {
1500         notification_h noti = NULL;
1501
1502         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1503         if(noti == NULL) {
1504                 return;
1505         }
1506         ...
1507 }
1508  * @endcode
1509  */
1510 notification_h notification_new(notification_type_e type, int group_id,
1511                                 int priv_id);
1512
1513 /**
1514  * @brief This function create internal structure data and return notification handle.
1515  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1516  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1517  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1518  * @remarks
1519  * @param[in] type notification type
1520  * @return notification handle(#notification_h) if success, NULL if failure.
1521  * @retval #notification_h - success
1522  * @retval NULL - failure
1523  * @pre
1524  * @post
1525  * @see #notification_type_e
1526  * @see #notification_h
1527  * @par Sample code:
1528  * @code
1529 #include <notification.h>
1530 ...
1531 {
1532         notification_h noti = NULL;
1533
1534         noti = notification_create(NOTIFICATION_TYPE_NOTI);
1535         if(noti == NULL) {
1536                 return;
1537         }
1538         ...
1539 }
1540  * @endcode
1541  */
1542 notification_h notification_create(notification_type_e type);
1543
1544 /**
1545  * @brief load a notification from the notification DB with private id
1546  * @details
1547  * @remarks
1548  * @param[in] type notification type
1549  * @param[in] group_id Group ID
1550  * @param[in] priv_id Priv ID
1551  * @return notification handle(#notification_h) if success, NULL if failure.
1552  * @retval #notification_h - success
1553  * @retval NULL - failure
1554  * @pre
1555  * @post
1556  * @see #notification_type_e
1557  * @see #notification_h
1558  * @par Sample code:
1559  * @code
1560 #include <notification.h>
1561 ...
1562 {
1563         notification_h noti = NULL;
1564
1565         noti = notification_load("org.tizen.app", priv_id);
1566         if(noti == NULL) {
1567                 return;
1568         }
1569         ...
1570 }
1571  * @endcode
1572  */
1573 notification_h notification_load(char *pkgname,
1574                                 int priv_id);
1575
1576 /**
1577  * @brief Create a notification clone
1578  * @details Newly created notification handle is returned.
1579  * @remarks This clone notification handle should be call notification_free().
1580  * @param[in] noti notification handle
1581  * @param[out] clone newly created notification handle that has same with input noti.
1582  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1583  * @retval NOTIFICATION_ERROR_NONE - success
1584  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1585  * @pre
1586  * @post
1587  * @see #notification_type_e
1588  * @see #notification_h
1589  * @par Sample code:
1590  * @code
1591 #include <notification.h>
1592 ...
1593 {
1594         notification_h noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1595         notification_h clone = NULL;
1596
1597         notification_clone(noti, &clone);
1598         ...
1599 }
1600  * @endcode
1601  */
1602 notification_error_e notification_clone(notification_h noti, notification_h *clone);
1603
1604 /**
1605  * @brief Free internal structure data of notification handle.
1606  * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1607  * @remarks
1608  * @param[in] noti notification handle
1609  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1610  * @retval NOTIFICATION_ERROR_NONE - success
1611  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1612  * @pre notification_new()
1613  * @post
1614  * @see #notification_h
1615  * @par Sample code:
1616  * @code
1617 #include <notification.h>
1618 ...
1619 {
1620         notification_h noti = NULL;
1621         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1622
1623         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1624         if(noti == NULL) {
1625                 return;
1626         }
1627         ...
1628
1629         noti_err = notification_free(noti);
1630         if(noti_err != NOTIFICATION_ERROR_NONE) {
1631                 return;
1632         }
1633 }
1634  * @endcode
1635  */
1636 notification_error_e notification_free(notification_h noti);
1637
1638 /**
1639  * @}
1640  */
1641
1642 /**
1643  * @addtogroup NOTIFICATION_LIST
1644  * @{
1645  */
1646
1647 /**
1648  * @brief This function return notification list handle.
1649  * @details If count is -1, all of notification list is returned.
1650  * @remarks
1651  * @param[in] type notification type
1652  * @param[in] count returned notification data number
1653  * @param[out] NOTIFICATION_ERROR_NONE if success, other value if failure.
1654  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1655  * @retval NOTIFICATION_ERROR_NONE - success
1656  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1657  * @pre
1658  * @post
1659  * @see #notification_list_h
1660  * @par Sample code:
1661  * @code
1662 #include <notification.h>
1663 ...
1664 {
1665         notification_list_h noti_list = NULL;
1666         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1667
1668         noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
1669         if(noti_err != NOTIFICATION_ERROR_NONE) {
1670                 return;
1671         }
1672 }
1673  * @endcode
1674  */
1675 notification_error_e notification_get_list(notification_type_e type,
1676                                            int count,
1677                                            notification_list_h * list);
1678
1679 /**
1680  * @brief This function will be deprecated.
1681  * @see notification_get_grouping_list()
1682  *
1683  */
1684 notification_error_e notification_get_grouping_list(notification_type_e type,
1685                                                     int count,
1686                                                     notification_list_h *list);
1687
1688 /**
1689  * @brief This function return notification detail list handle of grouping data.
1690  * @details If count is -1, all of notification list is returned.
1691  * @remarks
1692  * @param[in] pkgname caller application package name
1693  * @param[in] group_id group id
1694  * @param[in] priv_id private id
1695  * @param[in] count returned notification data number
1696  * @param[out] list notification list handle
1697  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1698  * @retval NOTIFICATION_ERROR_NONE - success
1699  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1700  * @pre
1701  * @post
1702  * @see #notification_list_h
1703  * @par Sample code:
1704  * @code
1705 #include <notification.h>
1706 ...
1707 {
1708         notification_list_h noti_list = NULL;
1709         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1710
1711         noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, &noti_list);
1712         if(noti_err != NOTIFICATION_ERROR_NONE) {
1713                 return;
1714         }
1715 }
1716  * @endcode
1717  */
1718 notification_error_e notification_get_detail_list(const char *pkgname,
1719                                                   int group_id,
1720                                                   int priv_id,
1721                                                   int count,
1722                                                   notification_list_h *list);
1723
1724 /**
1725  * @brief Free notification list
1726  * @details
1727  * @remarks
1728  * @param[in] list notification list handle
1729  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1730  * @retval NOTIFICATION_ERROR_NONE - success
1731  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1732  * @pre notification_get_grouping_list() or notification_get_detail_list ()
1733  * @post
1734  * @see #notification_list_h
1735  * @par Sample code:
1736  * @code
1737 #include <notification.h>
1738 ...
1739 {
1740         notification_list_h noti_list = NULL;
1741         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1742
1743         ...
1744
1745         noti_err = notification_free_list(noti_list);
1746         if(noti_err != NOTIFICATION_ERROR_NONE) {
1747                 return;
1748         }
1749 }
1750  * @endcode
1751  */
1752 notification_error_e notification_free_list(notification_list_h list);
1753
1754 /**
1755  * @}
1756  */
1757
1758 /**
1759  * @brief Register a callback for all notification events
1760  * @details The registered callback could be called for all notification events
1761  * @remarks
1762  * @param[in] changed_cb callback function
1763  * @param[in] user_data user data
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()
1768  * @post
1769  * @see notification_unresister_changed_cb()
1770  * @par Sample code:
1771  * @code
1772 #include <notification.h>
1773 ...
1774 {
1775         noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1776         if(noti_err != NOTIFICATION_ERROR_NONE) {
1777                 return;
1778         }
1779 }
1780  * @endcode
1781  */
1782 notification_error_e
1783 notification_resister_changed_cb(
1784         void (*changed_cb)(void *data, notification_type_e type),
1785         void *user_data);
1786
1787 /**
1788  * @brief Unregister a callback for all notification events
1789  * @details
1790  * @remarks
1791  * @param[in] changed_cb callback function
1792  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1793  * @retval NOTIFICATION_ERROR_NONE - success
1794  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1795  * @pre
1796  * @post
1797  * @see notification_resister_changed_cb()
1798  * @par Sample code:
1799  * @code
1800 #include <notification.h>
1801 ...
1802 {
1803         noti_err = notification_unresister_changed_cb(app_changed_cb);
1804         if(noti_err != NOTIFICATION_ERROR_NONE) {
1805                 return;
1806         }
1807 }
1808  * @endcode
1809  */
1810 notification_error_e
1811 notification_unresister_changed_cb(
1812         void (*changed_cb)(void *data, notification_type_e type));
1813
1814 /**
1815  * @brief Register a callback for all notification events
1816  * @details The registered callback could be called for all notification events
1817  * @remarks
1818  * @param[in] changed_cb callback function
1819  * @param[in] user_data user data
1820  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1821  * @retval NOTIFICATION_ERROR_NONE - success
1822  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1823  * @pre
1824  * @post
1825  * @see notification_unregister_detailed_changed_cb()
1826  * @par Sample code:
1827  * @code
1828 #include <notification.h>
1829 ...
1830 {
1831         noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1832         if(noti_err != NOTIFICATION_ERROR_NONE) {
1833                 return;
1834         }
1835 }
1836  * @endcode
1837  */
1838 notification_error_e
1839 notification_register_detailed_changed_cb(
1840                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1841                 void *user_data);
1842
1843 /**
1844  * @brief Unregister a callback for all notification events
1845  * @details
1846  * @remarks
1847  * @param[in] changed_cb callback function
1848  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1849  * @retval NOTIFICATION_ERROR_NONE - success
1850  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1851  * @pre
1852  * @post
1853  * @see notification_register_detailed_changed_cb()
1854  * @par Sample code:
1855  * @code
1856 #include <notification.h>
1857 ...
1858 {
1859         noti_err = notification_unresister_changed_cb(app_changed_cb);
1860         if(noti_err != NOTIFICATION_ERROR_NONE) {
1861                 return;
1862         }
1863 }
1864  * @endcode
1865  */
1866 notification_error_e
1867 notification_unregister_detailed_changed_cb(
1868                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1869                 void *user_data);
1870
1871 /**
1872  * @brief Get the information of notification event
1873  * @details
1874  * @remarks
1875  * @param[in] list notification list handle
1876  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1877  * @retval NOTIFICATION_ERROR_NONE - success
1878  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1879  * @pre notification_get_grouping_list() or notification_get_detail_list ()
1880  * @post
1881  * @see #notification_op
1882  */
1883 notification_error_e notification_op_get_data(notification_op *noti_op,
1884                                                        notification_op_data_type_e type,
1885                                                        void *data);
1886
1887 /**
1888  * @}
1889  */
1890
1891 void notification_call_changed_cb(notification_op *op_list, int op_num);
1892
1893 int notification_is_service_ready(void);
1894
1895 notification_error_e notification_add_deffered_task(
1896                 void (*deffered_task_cb)(void *data), void *user_data);
1897
1898 notification_error_e notification_del_deffered_task(
1899                 void (*deffered_task_cb)(void *data));
1900
1901 /**
1902  * @addtogroup NOTIFICATION_DEPRECATED
1903  * @{
1904  */
1905
1906 /**
1907  * @brief This function will be deprecated.
1908  * @see notification_set_image()
1909  *
1910  */
1911 notification_error_e notification_set_icon(notification_h noti,
1912                                            const char *icon_path);
1913
1914 /**
1915  * @brief This function will be deprecated.
1916  * @see notification_get_image()
1917  *
1918  */
1919 notification_error_e notification_get_icon(notification_h noti,
1920                                            char **icon_path);
1921
1922 /**
1923  * @brief This function will be deprecated.
1924  * @see notification_set_text()
1925  *
1926  */
1927 notification_error_e notification_set_title(notification_h noti,
1928                                             const char *title,
1929                                             const char *loc_title);
1930
1931 /**
1932  * @brief This function will be deprecated.
1933  * @see notification_get_text()
1934  *
1935  */
1936 notification_error_e notification_get_title(notification_h noti,
1937                                             char **title,
1938                                             char **loc_title);
1939
1940 /**
1941  * @brief This function will be deprecated.
1942  * @see notification_set_text()
1943  *
1944  */
1945 notification_error_e notification_set_content(notification_h noti,
1946                                               const char *content,
1947                                               const char *loc_content);
1948
1949 /**
1950  * @brief This function will be deprecated.
1951  * @see notification_get_text()
1952  *
1953  */
1954 notification_error_e notification_get_content(notification_h noti,
1955                                               char **content,
1956                                               char **loc_content);
1957
1958 /**
1959  * @brief This function will be deprecated.
1960  * @see notification_set_execute_option()
1961  *
1962  */
1963 notification_error_e notification_set_application(notification_h noti, const char *pkgname);    /* Do not use this */
1964
1965 /**
1966  * @brief This function will be deprecated.
1967  * @see notification_get_execute_option()
1968  *
1969  */
1970 notification_error_e notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
1971
1972 /**
1973  * @brief This function will be deprecated.
1974  * @see notification_set_execute_option()
1975  *
1976  */
1977 notification_error_e notification_set_args(notification_h noti, bundle * args, bundle * group_args);    /* Do not use this */
1978
1979 /**
1980  * @brief This function will be deprecated.
1981  * @see notification_get_execute_option()
1982  *
1983  */
1984 notification_error_e notification_get_args(notification_h noti, bundle ** args, bundle ** group_args);  /* Do not use this */
1985
1986 /**
1987  * @brief This function will be deprecated.
1988  * @see notification_delete_by_priv_id()
1989  *
1990  */
1991 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
1992                                                            notification_type_e type,
1993                                                            int group_id);
1994
1995 /**
1996  * @brief This function will be deprecated.
1997  * @see notification_delete_by_priv_id()
1998  *
1999  */
2000 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
2001                                                           notification_type_e type,
2002                                                           int priv_id);
2003 /**
2004  * @brief This function will be deprecated.
2005  *
2006  */
2007 notification_error_e notification_get_count(notification_type_e type,
2008                                             const char *pkgname,
2009                                             int group_id, int priv_id,
2010                                             int *count);
2011
2012 /**
2013  * @}
2014  */
2015
2016 #ifdef __cplusplus
2017 }
2018 #endif
2019 #endif                          /* __NOTIFICATION_H__ */