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