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