a833560ac7f72c30588d9fd84cf66e132e503376
[apps/home/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>
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
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 /**
37  * @defgroup NOTIFICATION_LIBRARY Notification Library
38  * @brief This notification library provides UI notification event. Inserted notification event is displaying Notification Tray, Indicator, etc.
39  */
40
41 /**
42  * @ingroup NOTIFICATION_LIBRARY
43  * @defgroup NOTIFICATION notification core API
44  * @brief Notification core API
45  */
46
47 /**
48  * @addtogroup NOTIFICATION
49  * @{
50  */
51
52 /**
53  * @brief This function will be deprecated.
54  * @see notification_set_image()
55  *
56  */
57 notification_error_e notification_set_icon(notification_h noti,
58                                            const char *icon_path);
59
60 /**
61  * @brief This function will be deprecated.
62  * @see notification_get_image()
63  *
64  */
65 notification_error_e notification_get_icon(notification_h noti,
66                                            char **icon_path);
67
68 /**
69  * @brief This function set image path according to type.
70  * @details 
71  * @remarks
72  * @param[in] noti notification handle
73  * @param[in] type notification image type
74  * @param[in] image_path image file full path
75  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
76  * @retval NOTIFICATION_ERROR_NONE - success
77  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
78  * @pre Notification handle should be created by notification_new()
79  * @post
80  * @see #notification_image_type_e
81  * @see notification_new()
82  * @par Sample code:
83  * @code
84 #include <notification.h>
85 ...
86 {
87         notification_h noti = NULL;
88         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
89
90         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
91         if(noti == NULL) {
92                 return;
93         }
94
95         noti_err  = notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, APP_IMAGE_FULL_PATH);
96         if(noti_err != NOTIFICATION_ERROR_NONE) {
97                 notification_free(noti);
98                 return;
99         }
100 }
101  * @endcode
102  */
103 notification_error_e notification_set_image(notification_h noti,
104                                             notification_image_type_e type,
105                                             const char *image_path);
106
107 /**
108  * @brief This function get image path according to type.
109  * @details 
110  * @remarks Do not free image_path. It will be freed when notification_free() or notification_free_list().
111  * @param[in] noti notification handle
112  * @param[in] type notification image type
113  * @param[out] image_path image file full path
114  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
115  * @retval NOTIFICATION_ERROR_NONE - success
116  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
117  * @pre Notification handle should be created by notification_new()
118  * @post
119  * @see #notification_image_type_e
120  * @see notification_new()
121  * @par Sample code:
122  * @code
123  #include <notification.h>
124  ...
125  {
126         char *image_path = NULL;
127         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
128         
129         noti_err  = notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON, &image_path);
130         if(noti_err != NOTIFICATION_ERROR_NONE) {
131                 return;
132         }
133 }
134  * @endcode
135  */
136 notification_error_e notification_get_image(notification_h noti,
137                                             notification_image_type_e type,
138                                             char **image_path);
139
140 /**
141  * @brief This function set time infomation.
142  * @details If input_time is 0, time information is set by current time.
143  * @remarks
144  * @param[in] noti notification handle
145  * @param[in] input_time input time
146  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
147  * @retval NOTIFICATION_ERROR_NONE - success
148  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
149  * @pre Notification handle should be created by notification_new()
150  * @post
151  * @see notification_new()
152  * @par Sample code:
153  * @code
154 #include <notification.h>
155  ...
156   {
157          notification_h noti = NULL;
158          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
159          
160          noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
161          if(noti == NULL) {
162                  return;
163          }
164  
165          noti_err  = notification_set_time(noti, time(NULL));
166          if(noti_err != NOTIFICATION_ERROR_NONE) {
167                 notification_free(noti);
168                  return;
169          }
170  }
171  * @endcode
172  */
173 notification_error_e notification_set_time(notification_h noti,
174                                            time_t input_time);
175
176 /**
177  * @brief This function get time information.
178  * @details If ret_time is 0, time information is not set before.
179  * @remarks
180  * @param[in] noti notification handle
181  * @param[out] ret_time return time value
182  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
183  * @retval NOTIFICATION_ERROR_NONE - success
184  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
185  * @pre Notification handle should be created by notification_new()
186  * @post
187  * @see notification_new()
188  * @par Sample code:
189  * @code
190  #include <notification.h>
191  ...
192  {
193         time_t ret_time;
194         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
195         
196         noti_err  = notification_get_time(noti, &ret_time);
197         if(noti_err != NOTIFICATION_ERROR_NONE) {
198                 return;
199         }
200 }
201  * @endcode
202  */
203 notification_error_e notification_get_time(notification_h noti,
204                                            time_t * ret_time);
205
206 /**
207  * @brief This function get insert time information.
208  * @details If ret_time is 0, this notification data is not inserted before.
209  * @remarks
210  * @param[in] noti notification handle
211  * @param[out] ret_time return time value
212  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
213  * @retval NOTIFICATION_ERROR_NONE - success
214  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
215  * @pre 
216  * @post
217  * @see 
218  * @par Sample code:
219  * @code
220  #include <notification.h>
221   ...
222   {
223          time_t ret_time;
224          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
225          
226          noti_err  = notification_get_insert_time(noti, &ret_time);
227          if(noti_err != NOTIFICATION_ERROR_NONE) {
228                  return;
229          }
230  }
231  * @endcode
232  */
233 notification_error_e notification_get_insert_time(notification_h noti,
234                                                   time_t * ret_time);
235
236 /**
237  * @brief This function will be deprecated.
238  * @see notification_set_text()
239  *
240  */
241 notification_error_e notification_set_title(notification_h noti,
242                                             const char *title,
243                                             const char *loc_title);
244
245 /**
246  * @brief This function will be deprecated.
247  * @see notification_get_text()
248  *
249  */
250 notification_error_e notification_get_title(notification_h noti,
251                                             char **title,
252                                             char **loc_title);
253
254 /**
255  * @brief This function will be deprecated.
256  * @see notification_set_text()
257  *
258  */
259 notification_error_e notification_set_group_title(const char *pkgname,
260                                                   int group_id,
261                                                   const char *title,
262                                                   const char *loc_title,
263                                                   notification_count_display_type_e
264                                                   count_display);
265
266 /**
267  * @brief This function will be deprecated.
268  * @see notification_get_text()
269  *
270  */
271 notification_error_e notification_get_group_title(const char *pkgname,
272                                                   int group_id,
273                                                   char **title,
274                                                   char **loc_title,
275                                                   notification_count_display_type_e *count_display);
276
277 /**
278  * @brief This function will be deprecated.
279  * @see notification_set_text()
280  *
281  */
282 notification_error_e notification_set_content(notification_h noti,
283                                               const char *content,
284                                               const char *loc_content);
285
286 /**
287  * @brief This function will be deprecated.
288  * @see notification_get_text()
289  *
290  */
291 notification_error_e notification_get_content(notification_h noti,
292                                               char **content,
293                                               char **loc_content);
294
295 /**
296  * @brief This function will be deprecated.
297  * @see notification_set_text()
298  *
299  */
300 notification_error_e notification_set_default_content(notification_h noti,
301                                                       const char *content,
302                                                       const char *loc_content);
303
304 /**
305  * @brief This function will be deprecated.
306  * @see notification_get_text()
307  *
308  */
309 notification_error_e notification_get_default_content(notification_h noti,
310                                                       char **content,
311                                                       char **loc_content);
312
313 /**
314  * @brief This function will be deprecated.
315  * @see notification_set_text()
316  *
317  */
318 notification_error_e notification_set_group_content(const char *pkgname,
319                                                     int group_id,
320                                                     const char *content,
321                                                     const char *loc_content,
322                                                     notification_count_display_type_e count_display);
323
324 /**
325  * @brief This function will be deprecated.
326  * @see notification_get_text()
327  *
328  */
329 notification_error_e notification_get_group_content(const char *pkgname,
330                                                     int group_id,
331                                                     char **content,
332                                                     char **loc_content,
333                                                     notification_count_display_type_e *count_display);
334
335 /**
336  * @brief This function set text.
337  * @details Set title, content string. If text is formated data(only support %d, %f, %s), type - value pair should be set.
338  * If %d, type NOTIFICATION_VARIABLE_TYPE_INT and value is integer value.
339  * If %f, type NOTIFICATION_VARIABLE_TYPE_DOUBLE and value is double value.
340  * If %s, type NOTIFICATION_VARIABLE_TYPE_STRING and value is character string.
341  * If type is NOTIFICATION_VARIABLE_TYPE_COUNT, notification count is displaying with text.
342  * If value is NOTIFICATION_COUNT_POS_LEFT, count is displaying at the left of the text.
343  * If value is NOTIFICATION_COUNT_POS_IN, count is displaying in the text that text has %d format.
344  * If value is NOTIFICATION_COUNT_POS_RIGHT, count is displaying at the right of the text.
345  * Variable parameter should be terminated NOTIFICATION_VARIABLE_TYPE_NONE.
346  * @remarks
347  * @param[in] noti notification handle
348  * @param[in] type notification text type
349  * @param[in] text basic text
350  * @param[in] key text key for localization
351  * @param[in] args_type variable parameter that type - value pair.
352  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
353  * @retval NOTIFICATION_ERROR_NONE - success
354  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
355  * @pre notification handle should be created by notification_new().
356  * @post
357  * @see
358  * @par Sample code:
359  * @code
360 #include <notification.h>
361 ...
362 {
363         notification_h noti = NULL;
364         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
365
366         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
367         if(noti == NULL) {
368                 return;
369         }
370
371         noti_err  = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, "I'm Title", "IDS_APP_BODY_IM_TITLE", NOTIFICATION_VARIABLE_TYPE_NONE);
372         if(noti_err != NOTIFICATION_ERROR_NONE) {
373                 notification_free(noti);
374                 return;
375         }
376 }
377  * @endcode
378  */
379 notification_error_e notification_set_text(notification_h noti,
380                                            notification_text_type_e type,
381                                            const char *text,
382                                            const char *key,
383                                            int args_type, ...);
384
385 /**
386  * @brief This function get text.
387  * @details
388  * @remarks
389  * @param[in] noti notification handle
390  * @param[in] type notification text type.
391  * @param[out] text text
392  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
393  * @retval NOTIFICATION_ERROR_NONE - success
394  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
395  * @pre
396  * @post
397  * @see
398  * @par Sample code:
399  * @code
400 #include <notification.h>
401 ...
402 {
403         notification_h noti = NULL;
404         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
405         char *text = NULL;
406
407         noti_err  = notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &text);
408         if(noti_err != NOTIFICATION_ERROR_NONE) {
409                 return;
410         }
411 }
412  * @endcode
413  */
414 notification_error_e notification_get_text(notification_h noti,
415                                            notification_text_type_e type,
416                                            char **text);
417
418 /**
419  * @brief This function set text domain.
420  * @details
421  * @remarks
422  * @param[in] noti notification handle
423  * @param[in] domain text domain
424  * @param[in] dir text dir
425  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
426  * @retval NOTIFICATION_ERROR_NONE - success
427  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
428  * @pre
429  * @post
430  * @see
431  * @par Sample code:
432  * @code
433 #include <notification.h>
434 ...
435 {
436         notification_h noti = NULL;
437         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
438
439         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
440         if(noti == NULL) {
441                 return;
442         }
443
444         noti_err  = notification_set_text_domain(noti, PACKAGE, LOCALEDIR);
445         if(noti_err != NOTIFICATION_ERROR_NONE) {
446                 notification_free(noti);
447                 return;
448         }
449 }
450  * @endcode
451  */
452 notification_error_e notification_set_text_domain(notification_h noti,
453                                                   const char *domain,
454                                                   const char *dir);
455
456 /**
457  * @brief This function get text domain.
458  * @details
459  * @remarks Do not free returned domain and dir. These are freed when notification_free or notification_free_list.
460  * @param[in] noti notification handle
461  * @param[out] domain domain
462  * @param[out] dir locale dir
463  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
464  * @retval NOTIFICATION_ERROR_NONE - success
465  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
466  * @pre
467  * @post
468  * @see
469  * @par Sample code:
470  * @code
471 #include <notification.h>
472 ...
473 {
474         notification_h noti = NULL;
475         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
476         char *domain = NULL;
477         char *dir = NULL;
478
479         noti_err  = notification_get_text_domain(noti, &domain, &dir);
480         if(noti_err != NOTIFICATION_ERROR_NONE) {
481                 return;
482         }
483 }
484  * @endcode
485  */
486 notification_error_e notification_get_text_domain(notification_h noti,
487                                                   char **domain,
488                                                   char **dir);
489
490 /**
491  * @brief This function set notification sound.
492  * @details
493  * @remarks
494  * @param[in] noti notification handle
495  * @param[in] type notification sound type
496  * @param[in] path user sound file path
497  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
498  * @retval NOTIFICATION_ERROR_NONE - success
499  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
500  * @pre
501  * @post
502  * @see
503  * @par Sample code:
504  * @code
505 #include <notification.h>
506 ...
507 {
508         notification_h noti = NULL;
509         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
510
511         noti_err  = notification_set_sound(noti, NOTIFICATION_SOUND_TYPE_DEFAULT, NULL);
512         if(noti_err != NOTIFICATION_ERROR_NONE) {
513                 return;
514         }
515 }
516  * @endcode
517  */
518 notification_error_e notification_set_sound(notification_h noti,
519                                             notification_sound_type_e type,
520                                             const char *path);
521
522 /**
523  * @brief This function get notification sound.
524  * @details
525  * @remarks
526  * @param[in] noti notification handle
527  * @param[out] type notification sound type
528  * @param[out] path user sound file path
529  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
530  * @retval NOTIFICATION_ERROR_NONE - success
531  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
532  * @pre
533  * @post
534  * @see
535  * @par Sample code:
536  * @code
537 #include <notification.h>
538 ...
539 {
540         notification_h noti = NULL;
541         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
542         notification_sound_type_e type = NOTIFICATION_SOUND_TYPE_NONE;
543
544         noti_err  = notification_get_sound(noti, &type, NULL);
545         if(noti_err != NOTIFICATION_ERROR_NONE) {
546                 return;
547         }
548 }
549  * @endcode
550  */
551 notification_error_e notification_get_sound(notification_h noti,
552                                             notification_sound_type_e *type,
553                                             const char **path);
554
555 /**
556  * @brief This function set notification vibration.
557  * @details
558  * @remarks
559  * @param[in] noti notification handle
560  * @param[in] type notification vibration type
561  * @param[in] path user vibration file path
562  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
563  * @retval NOTIFICATION_ERROR_NONE - success
564  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
565  * @pre
566  * @post
567  * @see
568  * @par Sample code:
569  * @code
570 #include <notification.h>
571 ...
572 {
573         notification_h noti = NULL;
574         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
575
576         noti_err  = notification_set_vibration(noti, NOTIFICATION_VIBRATION_TYPE_DEFAULT, NULL);
577         if(noti_err != NOTIFICATION_ERROR_NONE) {
578                 return;
579         }
580 }
581  * @endcode
582  */
583 notification_error_e notification_set_vibration(notification_h noti,
584                                                 notification_vibration_type_e type,
585                                                 const char *path);
586
587 /**
588   * @brief This function get notification vibration.
589   * @details
590   * @remarks
591   * @param[in] noti notification handle
592   * @param[out] type notification sound type
593   * @param[out] path user vibration file path
594   * @return NOTIFICATION_ERROR_NONE if success, other value if failure
595   * @retval NOTIFICATION_ERROR_NONE - success
596   * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
597   * @pre
598   * @post
599   * @see 
600   * @par Sample code:
601   * @code
602 #include <notification.h>
603 ...
604  {
605         notification_h noti = NULL;
606         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
607         notification_vibration_type_e type = NOTIFICATION_VIBRATION_TYPE_NONE;
608
609         noti_err  = notification_get_vibration(noti, &type, NULL);
610         if(noti_err != NOTIFICATION_ERROR_NONE) {
611                 return;
612         }
613 }
614   * @endcode
615   */
616 notification_error_e notification_get_vibration(notification_h noti,
617                                                 notification_vibration_type_e *type,
618                                                 const char **path);
619
620 /**
621  * @brief This function will be deprecated.
622  * @see notification_set_execute_option()
623  *
624  */
625 notification_error_e notification_set_application(notification_h noti, const char *pkgname);    /* Do not use this */
626
627 /**
628  * @brief This function will be deprecated.
629  * @see notification_get_execute_option()
630  *
631  */
632 notification_error_e notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
633
634 /**
635  * @brief This function will be deprecated.
636  * @see notification_set_execute_option()
637  *
638  */
639 notification_error_e notification_set_args(notification_h noti, bundle * args, bundle * group_args);    /* Do not use this */
640
641 /**
642  * @brief This function will be deprecated.
643  * @see notification_get_execute_option()
644  *
645  */
646 notification_error_e notification_get_args(notification_h noti, bundle ** args, bundle ** group_args);  /* Do not use this */
647
648 /**
649  * @brief This function will be deprecated.
650  * @see notification_set_execute_option()
651  *
652  */
653 notification_error_e notification_set_service_data(notification_h noti,
654                                                    bundle *service_data,
655                                                    bundle *group_service_data);
656
657 /**
658  * @brief This function will be deprecated.
659  * @see notification_get_execute_option()
660  *
661  */
662 notification_error_e notification_get_service_data(notification_h noti,
663                                                    bundle **service_data,
664                                                    bundle **group_service_data);
665
666 /**
667  * @brief This function set execute option.
668  * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
669  * @remarks
670  * @param[in] noti notification handle
671  * @param[in] type notification execute type
672  * @param[in] text basic text for button
673  * @param[in] key value for localizaed text
674  * @param[in] service_handle appsvc bundle data
675  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
676  * @retval NOTIFICATION_ERROR_NONE - success
677  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
678  * @pre
679  * @post
680  * @see
681  */
682 notification_error_e notification_set_execute_option(notification_h noti,
683                                                      notification_execute_type_e type,
684                                                      const char *text,
685                                                      const char *key,
686                                                      bundle *service_handle);
687
688 /**
689  * @brief This function get execute option.
690  * @details
691  * @remarks
692  * @param[in] noti notification handle
693  * @param[in] type notification execute type
694  * @param[out] text text for button
695  * @param[out] service_handle appsvc bundle data
696  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
697  * @retval NOTIFICATION_ERROR_NONE - success
698  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
699  * @pre
700  * @post
701  * @see
702  * @par Sample code:
703  * @code
704 #include <notification.h>
705 ...
706 {
707         notification_h noti = NULL;
708         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
709         bundle *b = NULL;
710
711         ...
712
713         noti_err  = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
714         if(noti_err != NOTIFICATION_ERROR_NONE) {
715                 notification_free(noti);
716                 return;
717         }
718 }
719  * @endcode
720  */
721 notification_error_e notification_get_execute_option(notification_h noti,
722                                                      notification_execute_type_e type,
723                                                      const char **text,
724                                                      bundle **service_handle);
725
726 /**
727  * @brief This function set notification property.
728  * @details
729  * @remarks
730  * @param[in] noti notification handle
731  * @param[in] flags property with | operation
732  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
733  * @retval NOTIFICATION_ERROR_NONE - success
734  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
735  * @pre
736  * @post
737  * @see
738  * @par Sample code:
739  * @code
740 #include <notification.h>
741 ...
742 {
743         notification_h noti = NULL;
744         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
745         bundle *b = NULL;
746
747         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
748         if(noti == NULL) {
749                 return;
750         }
751
752         noti_err  = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
753         if(noti_err != NOTIFICATION_ERROR_NONE) {
754                 notification_free(noti);
755                 return;
756         }
757 }
758  * @endcode
759  */
760 notification_error_e notification_set_property(notification_h noti,
761                                                int flags);
762
763 /**
764  * @brief This function get notification property.
765  * @details
766  * @remarks
767  * @param[in] noti notification handle
768  * @param[out] flags notification property
769  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
770  * @retval NOTIFICATION_ERROR_NONE - success
771  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
772  * @pre
773  * @post
774  * @see
775  * @par Sample code:
776  * @code
777 #include <notification.h>
778 ...
779 {
780         notification_h noti = NULL;
781         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
782         int flags = 0;
783
784         noti_err  = notification_get_property(noti, &flags);
785         if(noti_err != NOTIFICATION_ERROR_NONE) {
786                 return;
787         }
788 }
789  * @endcode
790  */
791 notification_error_e notification_get_property(notification_h noti,
792                                                int *flags);
793
794 /**
795  * @brief This function set display application list.
796  * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
797  * @remarks
798  * @param[in] noti notification handle
799  * @param[in] applist with | operation
800  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
801  * @retval NOTIFICATION_ERROR_NONE - success
802  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
803  * @pre
804  * @post
805  * @see
806  * @par Sample code:
807  * @code
808 #include <notification.h>
809 ...
810 {
811         notification_h noti = NULL;
812         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
813         bundle *b = NULL;
814
815         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
816         if(noti == NULL) {
817                 return;
818         }
819
820         noti_err  = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
821         if(noti_err != NOTIFICATION_ERROR_NONE) {
822                 notification_free(noti);
823                 return;
824         }
825 }
826 }
827  * @endcode
828  */
829 notification_error_e notification_set_display_applist(notification_h noti,
830                                                       int applist);
831
832 /**
833  * @brief This function get display application list.
834  * @details
835  * @remarks
836  * @param[in] noti notification handle
837  * @param[out] applist display application list.
838  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
839  * @retval NOTIFICATION_ERROR_NONE - success
840  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
841  * @pre
842  * @post
843  * @see
844  * @par Sample code:
845  * @code
846 #include <notification.h>
847 ...
848 {
849         notification_h noti = NULL;
850         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
851         int applist = 0;
852
853         noti_err  = notification_get_display_applist(noti, &applist);
854         if(noti_err != NOTIFICATION_ERROR_NONE) {
855                 return;
856         }
857 }
858  * @endcode
859  */
860 notification_error_e notification_get_display_applist(notification_h noti,
861                                                       int *applist);
862
863 /**
864  * @brief This function set initial size for ongoing type.
865  * @details After notification_insert, it does not upate size. If you want to update size, please call notification_update_size().
866  * @remarks
867  * @param[in] noti notification handle
868  * @param[in] size double type size.
869  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
870  * @retval NOTIFICATION_ERROR_NONE - success
871  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
872  * @pre
873  * @post
874  * @see
875  * @par Sample code:
876  * @code
877 #include <notification.h>
878 ...
879 {
880         notification_h noti = NULL;
881         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
882
883         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
884         if(noti == NULL) {
885                 return;
886         }
887
888         noti_err  = notification_set_size(noti, 0.0);
889         if(noti_err != NOTIFICATION_ERROR_NONE) {
890                 notification_free(noti);
891                 return;
892         }
893 }
894  * @endcode
895  */
896 notification_error_e notification_set_size(notification_h noti,
897                                            double size);
898
899 /**
900  * @brief This function get progress size.
901  * @details
902  * @remarks
903  * @param[in] noti notification handle
904  * @param[out] size progress size
905  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
906  * @retval NOTIFICATION_ERROR_NONE - success
907  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
908  * @pre
909  * @post
910  * @see
911  * @par Sample code:
912  * @code
913 #include <notification.h>
914 ...
915 {
916         notification_h noti = NULL;
917         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
918         double size = 0.0;
919
920         noti_err  = notification_get_size(noti, &size);
921         if(noti_err != NOTIFICATION_ERROR_NONE) {
922                 return;
923         }
924 }
925  * @endcode
926  */
927 notification_error_e notification_get_size(notification_h noti,
928                                            double *size);
929
930 /**
931  * @brief This function set initial progress for ongoing type.
932  * @details After notification_insert, it does not upate progress. If you want to update progress, please call notification_update_progress().
933  * @remarks
934  * @param[in] noti notification handle
935  * @param[in] percentage progress percentage
936  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
937  * @retval NOTIFICATION_ERROR_NONE - success
938  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
939  * @pre
940  * @post
941  * @see
942  * @par Sample code:
943  * @code
944 #include <notification.h>
945 ...
946 {
947         notification_h noti = NULL;
948         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
949
950         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
951         if(noti == NULL) {
952                 return;
953         }
954
955         noti_err  = notification_set_progress(noti, 0.0);
956         if(noti_err != NOTIFICATION_ERROR_NONE) {
957                 notification_free(noti);
958                 return;
959         }
960 }
961  * @endcode
962  */
963 notification_error_e notification_set_progress(notification_h noti,
964                                                double percentage);
965
966 /**
967  * @brief This function get progress percentage.
968  * @details
969  * @remarks
970  * @param[in] noti notification handle
971  * @param[out] percentage progress percentage
972  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
973  * @retval NOTIFICATION_ERROR_NONE - success
974  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
975  * @pre
976  * @post
977  * @see
978  * @par Sample code:
979  * @code
980 #include <notification.h>
981 ...
982 {
983         notification_h noti = NULL;
984         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
985         double percentage = 0.0;
986
987         noti_err  = notification_get_progress(noti, &percentage);
988         if(noti_err != NOTIFICATION_ERROR_NONE) {
989                 return;
990         }
991 }
992  * @endcode
993  */
994 notification_error_e notification_get_progress(notification_h noti,
995                                                double *percentage);
996
997 /**
998  * @brief This function set caller_pkgname.
999  * @details caller_pkgname is set automatically when notification_new. We are not recommend to use this API.
1000  * @remarks
1001  * @param[in] noti notification handle
1002  * @param[in] pkgname caller package name
1003  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1004  * @retval NOTIFICATION_ERROR_NONE - success
1005  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1006  * @pre
1007  * @post
1008  * @see
1009  * @par Sample code:
1010  * @code
1011 #include <notification.h>
1012 ...
1013 {
1014         notification_h noti = NULL;
1015         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1016
1017         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1018         if(noti == NULL) {
1019                 return;
1020         }
1021
1022         noti_err  = notification_set_pkgname(noti, "org.tizen.phone");
1023         if(noti_err != NOTIFICATION_ERROR_NONE) {
1024                 notification_free(noti);
1025                 return;
1026         }
1027 }
1028  * @endcode
1029  */
1030 notification_error_e notification_set_pkgname(notification_h noti,
1031                                               const char *pkgname);
1032
1033 /**
1034  * @brief This function get caller pkgname.
1035  * @details
1036  * @remarks
1037  * @param[in] noti notification handle
1038  * @param[out] pkgname caller package name
1039  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1040  * @retval NOTIFICATION_ERROR_NONE - success
1041  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1042  * @pre
1043  * @post
1044  * @see
1045  * @par Sample code:
1046  * @code
1047 #include <notification.h>
1048 ...
1049 {
1050         notification_h noti = NULL;
1051         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1052         char *pkgname = NULL;
1053
1054         noti_err  = notification_get_pkgname(noti, &pkgname);
1055         if(noti_err != NOTIFICATION_ERROR_NONE) {
1056                 return;
1057         }
1058 }
1059  * @endcode
1060  */
1061 notification_error_e notification_get_pkgname(notification_h noti,
1062                                               char **pkgname);
1063
1064 /**
1065  * @brief This function will be deprecated.
1066  * @see notification_set_badge()
1067  *
1068  */
1069 notification_error_e notification_set_unread_count(const char *pkgname,
1070                                                    int group_id,
1071                                                    int unread_count);
1072
1073 /**
1074  * @brief This function will be deprecated.
1075  * @see notification_get_badge()
1076  *
1077  */
1078 notification_error_e notification_get_unread_count(const char *pkgname,
1079                                                    int group_id,
1080                                                    int *unread_count);
1081
1082 /**
1083  * @brief This function set application badge count.
1084  * @details
1085  * @remarks
1086  * @param[in] pkgname If NULL, caller pkgname is set internally.
1087  * @param[in] group_id group id
1088  * @param[in] count badge count
1089  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1090  * @retval NOTIFICATION_ERROR_NONE - success
1091  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1092  * @pre 
1093  * @post
1094  * @see
1095  * @par Sample code:
1096 #include <notification.h>
1097  ...
1098   {
1099          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1100          
1101          noti_err  = notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, 5);
1102          if(noti_err != NOTIFICATION_ERROR_NONE) {
1103                  return;
1104          }
1105  }
1106  * @endcode
1107  */
1108 notification_error_e notification_set_badge(const char *pkgname,
1109                                             int group_id, int count);
1110
1111 /**
1112  * @brief This function get application badge count.
1113  * @details
1114  * @remarks
1115  * @param[in] pkgname If NULL, caller pkgname is set internally.
1116  * @param[in] group_id group id
1117  * @param[out] count badge count
1118  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1119  * @retval NOTIFICATION_ERROR_NONE - success
1120  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1121  * @pre 
1122  * @post
1123  * @see
1124  * @par Sample code:
1125 #include <notification.h>
1126  ...
1127   {
1128          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1129          int count = 0;
1130          
1131          noti_err  = notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
1132          if(noti_err != NOTIFICATION_ERROR_NONE) {
1133                  return;
1134          }
1135  }
1136  * @endcode
1137  */
1138 notification_error_e notification_get_badge(const char *pkgname,
1139                                             int group_id, int *count);
1140
1141 /**
1142  * @brief This function get Group ID and Private ID
1143  * @details
1144  * @remarks
1145  * @param[in] noti notification handle
1146  * @param[out] group_id Group ID
1147  * @param[out] priv_id Private ID
1148  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1149  * @retval NOTIFICATION_ERROR_NONE - success
1150  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1151  * @pre 
1152  * @post
1153  * @see 
1154  * @par Sample code:
1155  * @code
1156 #include <notification.h>
1157  ...
1158   {
1159          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1160          int group_id, priv_id;
1161  
1162          noti_err  = notification_get_id(noti, &group_id, &priv_id);
1163          if(noti_err != NOTIFICATION_ERROR_NONE) {
1164                  return;
1165          }
1166  }
1167  * @endcode
1168  */
1169 notification_error_e notification_get_id(notification_h noti,
1170                                          int *group_id, int *priv_id);
1171
1172 /**
1173  * @brief This function get notification type
1174  * @details
1175  * @remarks
1176  * @param[in] noti notification handle
1177  * @param[out] type notification type
1178  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1179  * @retval NOTIFICATION_ERROR_NONE - success
1180  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1181  * @pre 
1182  * @post
1183  * @see 
1184  * @par Sample code:
1185  * @code
1186 #include <notification.h>
1187 ...
1188  {
1189         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1190         notification_type_e type;
1191
1192         noti_err  = notification_get_type(noti, &type);
1193         if(noti_err != NOTIFICATION_ERROR_NONE) {
1194                 return;
1195         }
1196 }
1197  * @endcode
1198  */
1199 notification_error_e notification_get_type(notification_h noti,
1200                                            notification_type_e * type);
1201
1202 /**
1203  * @brief This function insert notification data.
1204  * @details Notification data is inserted to DB and then notification data is displaying display application.
1205  * When notification_new() call, if priv_id is NOTIFICATION_PRIV_ID_NONE, priv_id is return internally set priv_id.
1206  * @remarks
1207  * @param[in] noti notification handle
1208  * @param[out] priv_id private ID
1209  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1210  * @retval NOTIFICATION_ERROR_NONE - success
1211  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1212  * @pre notification_new()
1213  * @post notification_free()
1214  * @see #notification_h
1215  * @par Sample code:
1216  * @code
1217 #include <notification.h>
1218 ...
1219  {
1220         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1221
1222         noti_err  = notification_insert(noti, NULL);
1223         if(noti_err != NOTIFICATION_ERROR_NONE) {
1224                 return;
1225         }
1226 }
1227  * @endcode
1228  */
1229 notification_error_e notification_insert(notification_h noti,
1230                                          int *priv_id);
1231
1232 /**
1233  * @brief This function update notification data. Not fully implemented yet.
1234  * @details Display application update UI.
1235  * @remarks
1236  * @param[in] noti notification handle that is created by notification_new().
1237  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1238  * @retval NOTIFICATION_ERROR_NONE - success
1239  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1240  * @pre
1241  * @post
1242  * @see #notification_h
1243  * @par Sample code:
1244  * @code
1245 #include <notification.h>
1246 ...
1247  {
1248         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1249
1250         noti_err  = notification_update(NULL);
1251         if(noti_err != NOTIFICATION_ERROR_NONE) {
1252                 return;
1253         }
1254 }
1255  * @endcode
1256  */
1257 notification_error_e notification_update(notification_h noti);
1258
1259 /**
1260  * @brief This function clear all notification of type.
1261  * @details Not recommand API. Only for notification tray's clear button operation.
1262  * @remarks
1263  * @param[in] type notification type
1264  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1265  * @retval NOTIFICATION_ERROR_NONE - success
1266  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1267  * @pre
1268  * @post
1269  * @see #notification_type_e
1270  * @par Sample code:
1271  * @code
1272 #include <notification.h>
1273 ...
1274  {
1275         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1276
1277         noti_err  = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1278         if(noti_err != NOTIFICATION_ERROR_NONE) {
1279                 return;
1280         }
1281 }
1282  * @endcode
1283  */
1284 notification_error_e notifiation_clear(notification_type_e type);
1285
1286 /**
1287  * @brief This function delete notification by type. 
1288  * @details If pkgname is NULL, caller_pkgname is set internally.
1289  * @remarks
1290  * @param[in] pkgname caller application package name or NULL
1291  * @param[in] type notification type
1292  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1293  * @retval NOTIFICATION_ERROR_NONE - success
1294  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1295  * @pre
1296  * @post
1297  * @see
1298  * @par Sample code:
1299  * @code
1300 #include <notification.h>
1301 ...
1302  {
1303         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1304
1305         noti_err  = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1306         if(noti_err != NOTIFICATION_ERROR_NONE) {
1307                 return;
1308         }
1309 }
1310  * @endcode
1311  */
1312 notification_error_e notification_delete_all_by_type(const char *pkgname,
1313                                                      notification_type_e type);
1314
1315 /**
1316  * @brief This function delete group notification data by group ID.
1317  * @details If pkgname is NULL, caller_pkgname is set internally.
1318  * @remarks
1319  * @param[in] pkgname caller application package name or NULL
1320  * @param[in] type notification type
1321  * @param[in] group_id group ID
1322  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1323  * @retval NOTIFICATION_ERROR_NONE - success
1324  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1325  * @pre
1326  * @post
1327  * @see
1328  * @par Sample code:
1329  * @code
1330 #include <notification.h>
1331 ...
1332  {
1333         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1334
1335         noti_err  = notification_delete_group_by_group_id(NULL, NOTIFICATION_TYPE_NOTI, APP_GROUP_ID);
1336         if(noti_err != NOTIFICATION_ERROR_NONE) {
1337                 return;
1338         }
1339 }
1340  * @endcode
1341  */
1342 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
1343                                                            notification_type_e type,
1344                                                            int group_id);
1345
1346 /**
1347  * @brief This function delete group notification data that include priv_id.
1348  * @details If pkgname is NULL, caller_pkgname is set internally.
1349  * @remarks
1350  * @param[in] pkgname caller application package name or NULL
1351  * @param[in] type notification type
1352  * @param[in] priv_id priv ID
1353  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1354  * @retval NOTIFICATION_ERROR_NONE - success
1355  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1356  * @pre
1357  * @post
1358  * @see
1359  * @par Sample code:
1360  * @code
1361 #include <notification.h>
1362 ...
1363  {
1364         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1365
1366         noti_err  = notification_delete_group_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1367         if(noti_err != NOTIFICATION_ERROR_NONE) {
1368                 return;
1369         }
1370 }
1371  * @endcode
1372  */
1373 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
1374                                                           notification_type_e type,
1375                                                           int priv_id);
1376
1377 /**
1378  * @brief This function delete notification data that private ID is priv_id.
1379  * @details If pkgname is NULL, caller_pkgname is set internally.
1380  * @remarks
1381  * @param[in] pkgname caller application package name or NULL
1382  * @param[in] type notification type
1383  * @param[in] priv_id priv ID
1384  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1385  * @retval NOTIFICATION_ERROR_NONE - success
1386  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1387  * @pre
1388  * @post
1389  * @see
1390  * @par Sample code:
1391  * @code
1392 #include <notification.h>
1393 ...
1394  {
1395         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1396
1397         noti_err  = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1398         if(noti_err != NOTIFICATION_ERROR_NONE) {
1399                 return;
1400         }
1401 }
1402  * @endcode
1403  */
1404 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1405                                                     notification_type_e type,
1406                                                     int priv_id);
1407
1408 /**
1409  * @brief This function delete notification data from DB
1410  * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1411  * @remarks
1412  * @param[in] noti notification handle
1413  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1414  * @retval NOTIFICATION_ERROR_NONE - success
1415  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1416  * @pre
1417  * @post
1418  * @see #notification_h
1419  * @par Sample code:
1420  * @code
1421 #include <notification.h>
1422 ...
1423  {
1424         notificaton_h noti = NULL;
1425         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1426
1427         ...
1428
1429         noti_err  = notification_delete(noti);
1430         if(noti_err != NOTIFICATION_ERROR_NONE) {
1431                 return;
1432         }
1433
1434 }
1435  * @endcode
1436  */
1437 notification_error_e notification_delete(notification_h noti);
1438
1439 /**
1440  * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1441  * @details Display application update UI.
1442  * @remarks
1443  * @param[in] noti notification handle or NULL if priv_id is valid
1444  * @param[in] priv_id private ID
1445  * @param[in] progress % value of progressive data
1446  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1447  * @retval NOTIFICATION_ERROR_NONE - success
1448  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1449  * @pre
1450  * @post
1451  * @par Sample code:
1452  * @code
1453 #include <notification.h>
1454 ...
1455  {
1456         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1457
1458         noti_err  = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1459         if(noti_err != NOTIFICATION_ERROR_NONE) {
1460                 return;
1461         }
1462 }
1463  * @endcode
1464  */
1465 notification_error_e notification_update_progress(notification_h noti,
1466                                                   int priv_id,
1467                                                   double progress);
1468
1469 /**
1470  * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1471  * @details Display application update UI.
1472  * @remarks
1473  * @param[in] noti notification handle or NULL if priv_id is valid
1474  * @param[in] priv_id private ID
1475  * @param[in] size bytes of progressive data
1476  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1477  * @retval NOTIFICATION_ERROR_NONE - success
1478  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1479  * @pre
1480  * @post
1481  * @par Sample code:
1482  * @code
1483 #include <notification.h>
1484 ...
1485  {
1486         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1487
1488         noti_err  = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1489         if(noti_err != NOTIFICATION_ERROR_NONE) {
1490                 return;
1491         }
1492 }
1493  * @endcode
1494  */
1495 notification_error_e notification_update_size(notification_h noti,
1496                                               int priv_id, double size);
1497
1498 /**
1499  * @brief This function create internal structure data and return notification handle.
1500  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1501  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1502  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1503  * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT, 
1504  * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1505  * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1506  * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1507  * @remarks
1508  * @param[in] type notification type
1509  * @param[in] group_id Group ID
1510  * @param[in] priv_id Priv ID
1511  * @return notification handle(#notification_h) if success, NULL if failure.
1512  * @retval #notification_h - success
1513  * @retval NULL - failure
1514  * @pre
1515  * @post
1516  * @see #notification_type_e
1517  * @see #notification_h
1518  * @par Sample code:
1519  * @code
1520 #include <notification.h>
1521 ...
1522 {
1523         notification_h noti = NULL;
1524
1525         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1526         if(noti == NULL) {
1527                 return;
1528         }
1529         ...
1530 }
1531  * @endcode
1532  */
1533 notification_h notification_new(notification_type_e type, int group_id,
1534                                 int priv_id);
1535
1536 /**
1537  * @brief This function free internal structure data of notification handle.
1538  * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1539  * @remarks
1540  * @param[in] noti notification handle
1541  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1542  * @retval NOTIFICATION_ERROR_NONE - success
1543  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1544  * @pre notification_new()
1545  * @post
1546  * @see #notification_h
1547  * @par Sample code:
1548  * @code
1549 #include <notification.h>
1550 ...
1551 {
1552         notification_h noti = NULL;
1553         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1554
1555         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1556         if(noti == NULL) {
1557                 return;
1558         }
1559         ...
1560
1561         noti_err = notification_free(noti);
1562         if(noti_err != NOTIFICATION_ERROR_NONE) {
1563                 return;
1564         }
1565 }
1566  * @endcode
1567  */
1568 notification_error_e notification_free(notification_h noti);
1569
1570 /**
1571  * @brief This function register notification chagned callback.
1572  * @details 
1573  * @remarks
1574  * @param[in] changed_cb callback function
1575  * @param[in] user_data user data
1576  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1577  * @retval NOTIFICATION_ERROR_NONE - success
1578  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1579  * @pre notification_new()
1580  * @post
1581  * @see notification_unresister_changed_cb()
1582  * @par Sample code:
1583  * @code
1584 #include <notification.h>
1585 ...
1586 {
1587         noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1588         if(noti_err != NOTIFICATION_ERROR_NONE) {
1589                 return;
1590         }
1591 }
1592  * @endcode
1593  */
1594 notification_error_e
1595 notification_resister_changed_cb(
1596         void (*changed_cb)(void *data, notification_type_e type),
1597         void *user_data);
1598
1599 /**
1600  * @brief This function unregister notification chagned callback.
1601  * @details 
1602  * @remarks
1603  * @param[in] changed_cb callback function
1604  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1605  * @retval NOTIFICATION_ERROR_NONE - success
1606  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1607  * @pre notification_new()
1608  * @post
1609  * @see notification_resister_changed_cb()
1610  * @par Sample code:
1611  * @code
1612 #include <notification.h>
1613 ...
1614 {
1615         noti_err = notification_unresister_changed_cb(app_changed_cb);
1616         if(noti_err != NOTIFICATION_ERROR_NONE) {
1617                 return;
1618         }
1619 }
1620  * @endcode
1621  */
1622 notification_error_e
1623 notification_unresister_changed_cb(
1624         void (*changed_cb)(void *data, notification_type_e type));
1625
1626 /**
1627  * @brief This function get notification data count.
1628  * @details Count is the result of the conditions that type, pkgname, group_id, priv_id.
1629  * @remarks
1630  * @param[in] type notification type
1631  * @param[in] pkgname caller application package name
1632  * @param[in] group_id group id
1633  * @param[in] priv_id private id
1634  * @param[out] count notification data number
1635  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1636  * @retval NOTIFICATION_ERROR_NONE - success
1637  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1638  * @pre
1639  * @post
1640  * @see #notification_type_e
1641  * @par Sample code:
1642  * @code
1643 #include <notification.h>
1644 ...
1645 {
1646         notification_list_h noti_list = NULL;
1647         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1648         int count = 0;
1649         
1650         noti_err = notification_get_count(NOTIFICATION_TYPE_NONE, NULL, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE, &count);
1651         if(noti_err != NOTIFICATION_ERROR_NONE) {
1652                 return;
1653         }
1654 }
1655  * @endcode
1656  */
1657 notification_error_e notification_get_count(notification_type_e type,
1658                                             const char *pkgname,
1659                                             int group_id, int priv_id,
1660                                             int *count);
1661
1662 /**
1663  * @brief This function will be deprecated.
1664  * @see notification_get_grouping_list()
1665  *
1666  */
1667 notification_error_e notification_get_list(notification_type_e type,
1668                                            int count,
1669                                            notification_list_h * list);
1670
1671 /**
1672  * @brief This function return notification grouping list handle.
1673  * @details If count is -1, all of notification list is returned.
1674  * @remarks
1675  * @param[in] type notification type
1676  * @param[in] count returned notification data number
1677  * @param[out] list notification list handle
1678  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1679  * @retval NOTIFICATION_ERROR_NONE - success
1680  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1681  * @pre
1682  * @post
1683  * @see #notification_list_h
1684  * @par Sample code:
1685  * @code
1686 #include <notification.h>
1687 ...
1688 {
1689         notification_list_h noti_list = NULL;
1690         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1691         
1692         noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
1693         if(noti_err != NOTIFICATION_ERROR_NONE) {
1694                 return;
1695         }
1696 }
1697  * @endcode
1698  */
1699 notification_error_e notification_get_grouping_list(notification_type_e type,
1700                                                     int count,
1701                                                     notification_list_h *list);
1702
1703 /**
1704  * @brief This function return notification detail list handle of grouping data.
1705  * @details If count is -1, all of notification list is returned.
1706  * @remarks
1707  * @param[in] pkgname caller application package name
1708  * @param[in] group_id group id
1709  * @param[in] priv_id private id
1710  * @param[in] count returned notification data number
1711  * @param[out] list notification list handle
1712  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1713  * @retval NOTIFICATION_ERROR_NONE - success
1714  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1715  * @pre
1716  * @post
1717  * @see #notification_list_h
1718  * @par Sample code:
1719  * @code
1720 #include <notification.h>
1721 ...
1722 {
1723         notification_list_h noti_list = NULL;
1724         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1725         
1726         noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, &noti_list);
1727         if(noti_err != NOTIFICATION_ERROR_NONE) {
1728                 return;
1729         }
1730 }
1731  * @endcode
1732  */
1733 notification_error_e notification_get_detail_list(const char *pkgname,
1734                                                   int group_id,
1735                                                   int priv_id,
1736                                                   int count,
1737                                                   notification_list_h *list);
1738
1739 /**
1740  * @brief This function release notification list.
1741  * @details
1742  * @remarks
1743  * @param[in] list notification list handle
1744  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1745  * @retval NOTIFICATION_ERROR_NONE - success
1746  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1747  * @pre notification_get_grouping_list() or notification_get_detail_list ()
1748  * @post
1749  * @see #notification_list_h
1750  * @par Sample code:
1751  * @code
1752 #include <notification.h>
1753 ...
1754 {
1755         notification_list_h noti_list = NULL;
1756         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1757
1758         ...
1759         
1760         noti_err = notification_free_list(noti_list);
1761         if(noti_err != NOTIFICATION_ERROR_NONE) {
1762                 return;
1763         }
1764 }
1765  * @endcode
1766  */
1767 notification_error_e notification_free_list(notification_list_h list);
1768
1769 /** 
1770  * @}
1771  */
1772
1773 #ifdef __cplusplus
1774 }
1775 #endif
1776 #endif                          /* __NOTIFICATION_H__ */