sync with private git
[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 set led notification.
594  * @details
595  * @remarks
596  * @param[in] noti notification handle
597  * @param[in] operation led notification operation
598  * @param[in] led_argb notification led color
599  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
600  * @retval NOTIFICATION_ERROR_NONE - success
601  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
602  * @pre
603  * @post
604  * @see
605  * @par Sample code:
606  * @code
607 #include <notification.h>
608 ...
609 {
610         notification_h noti = NULL;
611         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
612
613         noti_err  = notification_set_led(noti, NOTIFICATION_LED_TYPE_DEFAULT, NULL);
614         if(noti_err != NOTIFICATION_ERROR_NONE) {
615                 return;
616         }
617 }
618  * @endcode
619  */
620 notification_error_e notification_set_led(notification_h noti,
621                                                 notification_led_op_e operation,
622                                                 int led_argb);
623
624 /**
625   * @brief This function get notification led.
626   * @details
627   * @remarks
628   * @param[in] noti notification handle
629   * @param[out] operation led notification operation
630   * @param[out] led_argb notification led color
631   * @return NOTIFICATION_ERROR_NONE if success, other value if failure
632   * @retval NOTIFICATION_ERROR_NONE - success
633   * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
634   * @pre
635   * @post
636   * @see
637   * @par Sample code:
638   * @code
639 #include <notification.h>
640 ...
641  {
642         notification_h noti = NULL;
643         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
644         notification_led_type_e type = NOTIFICATION_LED_TYPE_NONE;
645
646         noti_err  = notification_get_led(noti, &type, NULL);
647         if(noti_err != NOTIFICATION_ERROR_NONE) {
648                 return;
649         }
650 }
651   * @endcode
652   */
653 notification_error_e notification_get_led(notification_h noti,
654                                                 notification_led_op_e *operation,
655                                                 int *led_argb);
656
657 /**
658  * @brief This function will be deprecated.
659  * @see notification_set_execute_option()
660  *
661  */
662 notification_error_e notification_set_application(notification_h noti, const char *pkgname);    /* Do not use this */
663
664 /**
665  * @brief This function will be deprecated.
666  * @see notification_get_execute_option()
667  *
668  */
669 notification_error_e notification_get_application(notification_h noti, char **pkgname); /* Do not use this */
670
671 /**
672  * @brief This function will be deprecated.
673  * @see notification_set_execute_option()
674  *
675  */
676 notification_error_e notification_set_args(notification_h noti, bundle * args, bundle * group_args);    /* Do not use this */
677
678 /**
679  * @brief This function will be deprecated.
680  * @see notification_get_execute_option()
681  *
682  */
683 notification_error_e notification_get_args(notification_h noti, bundle ** args, bundle ** group_args);  /* Do not use this */
684
685 /**
686  * @brief This function set execute option.
687  * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
688  * @remarks
689  * @param[in] noti notification handle
690  * @param[in] type notification execute type
691  * @param[in] text basic text for button
692  * @param[in] key value for localizaed text
693  * @param[in] service_handle appsvc bundle data
694  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
695  * @retval NOTIFICATION_ERROR_NONE - success
696  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
697  * @pre
698  * @post
699  * @see
700  * @par Sample code:
701  * @code
702 #include <notification.h>
703 ...
704 {
705         notification_h noti = NULL;
706         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
707         bundle *b = NULL;
708
709         ...
710
711         b = bundle_create();
712         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
713         appsvc_set_uri(b,"http://www.samsung.com");
714
715         noti_err  = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
716         if(noti_err != NOTIFICATION_ERROR_NONE) {
717                 notification_free(noti);
718                 return;
719         }
720
721         bundle_free(b);
722 }
723  * @endcode
724  */
725 notification_error_e notification_set_execute_option(notification_h noti,
726                                                      notification_execute_type_e type,
727                                                      const char *text,
728                                                      const char *key,
729                                                      bundle *service_handle);
730
731 /**
732  * @brief This function get execute option.
733  * @details
734  * @remarks
735  * @param[in] noti notification handle
736  * @param[in] type notification execute type
737  * @param[out] text text for button
738  * @param[out] service_handle appsvc bundle data
739  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
740  * @retval NOTIFICATION_ERROR_NONE - success
741  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
742  * @pre
743  * @post
744  * @see
745  * @par Sample code:
746  * @code
747 #include <notification.h>
748 ...
749 {
750         notification_h noti = NULL;
751         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
752         bundle *b = NULL;
753
754         ...
755
756         noti_err  = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
757         if(noti_err != NOTIFICATION_ERROR_NONE) {
758                 notification_free(noti);
759                 return;
760         }
761 }
762  * @endcode
763  */
764 notification_error_e notification_get_execute_option(notification_h noti,
765                                                      notification_execute_type_e type,
766                                                      const char **text,
767                                                      bundle **service_handle);
768
769 /**
770  * @brief This function set notification property.
771  * @details
772  * @remarks
773  * @param[in] noti notification handle
774  * @param[in] flags property with | operation
775  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
776  * @retval NOTIFICATION_ERROR_NONE - success
777  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
778  * @pre
779  * @post
780  * @see
781  * @par Sample code:
782  * @code
783 #include <notification.h>
784 ...
785 {
786         notification_h noti = NULL;
787         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
788         bundle *b = NULL;
789
790         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
791         if(noti == NULL) {
792                 return;
793         }
794
795         noti_err  = notification_set_property(noti, NOTIFICATION_PROP_DISPLAY_ONLY_SIMMODE | NOTIFICATION_PROP_DISABLE_APP_LAUNCH);
796         if(noti_err != NOTIFICATION_ERROR_NONE) {
797                 notification_free(noti);
798                 return;
799         }
800 }
801  * @endcode
802  */
803 notification_error_e notification_set_property(notification_h noti,
804                                                int flags);
805
806 /**
807  * @brief This function get notification property.
808  * @details
809  * @remarks
810  * @param[in] noti notification handle
811  * @param[out] flags notification property
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         int flags = 0;
826
827         noti_err  = notification_get_property(noti, &flags);
828         if(noti_err != NOTIFICATION_ERROR_NONE) {
829                 return;
830         }
831 }
832  * @endcode
833  */
834 notification_error_e notification_get_property(notification_h noti,
835                                                int *flags);
836
837 /**
838  * @brief This function set display application list.
839  * @details All display application is enable(NOTIFICATION_DISPLAY_APP_ALL) if you are not call this API.
840  * @remarks
841  * @param[in] noti notification handle
842  * @param[in] applist with | operation
843  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
844  * @retval NOTIFICATION_ERROR_NONE - success
845  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
846  * @pre
847  * @post
848  * @see
849  * @par Sample code:
850  * @code
851 #include <notification.h>
852 ...
853 {
854         notification_h noti = NULL;
855         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
856         bundle *b = NULL;
857
858         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
859         if(noti == NULL) {
860                 return;
861         }
862
863         noti_err  = notification_set_display_applist(noti, NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER);
864         if(noti_err != NOTIFICATION_ERROR_NONE) {
865                 notification_free(noti);
866                 return;
867         }
868 }
869 }
870  * @endcode
871  */
872 notification_error_e notification_set_display_applist(notification_h noti,
873                                                       int applist);
874
875 /**
876  * @brief This function get display application list.
877  * @details
878  * @remarks
879  * @param[in] noti notification handle
880  * @param[out] applist display application list.
881  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
882  * @retval NOTIFICATION_ERROR_NONE - success
883  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
884  * @pre
885  * @post
886  * @see
887  * @par Sample code:
888  * @code
889 #include <notification.h>
890 ...
891 {
892         notification_h noti = NULL;
893         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
894         int applist = 0;
895
896         noti_err  = notification_get_display_applist(noti, &applist);
897         if(noti_err != NOTIFICATION_ERROR_NONE) {
898                 return;
899         }
900 }
901  * @endcode
902  */
903 notification_error_e notification_get_display_applist(notification_h noti,
904                                                       int *applist);
905
906 /**
907  * @brief This function set initial size for ongoing type.
908  * @details After notification_insert, it does not upate size. If you want to update size, please call notification_update_size().
909  * @remarks
910  * @param[in] noti notification handle
911  * @param[in] size double type size.
912  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
913  * @retval NOTIFICATION_ERROR_NONE - success
914  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
915  * @pre
916  * @post
917  * @see
918  * @par Sample code:
919  * @code
920 #include <notification.h>
921 ...
922 {
923         notification_h noti = NULL;
924         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
925
926         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
927         if(noti == NULL) {
928                 return;
929         }
930
931         noti_err  = notification_set_size(noti, 0.0);
932         if(noti_err != NOTIFICATION_ERROR_NONE) {
933                 notification_free(noti);
934                 return;
935         }
936 }
937  * @endcode
938  */
939 notification_error_e notification_set_size(notification_h noti,
940                                            double size);
941
942 /**
943  * @brief This function get progress size.
944  * @details
945  * @remarks
946  * @param[in] noti notification handle
947  * @param[out] size progress size
948  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
949  * @retval NOTIFICATION_ERROR_NONE - success
950  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
951  * @pre
952  * @post
953  * @see
954  * @par Sample code:
955  * @code
956 #include <notification.h>
957 ...
958 {
959         notification_h noti = NULL;
960         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
961         double size = 0.0;
962
963         noti_err  = notification_get_size(noti, &size);
964         if(noti_err != NOTIFICATION_ERROR_NONE) {
965                 return;
966         }
967 }
968  * @endcode
969  */
970 notification_error_e notification_get_size(notification_h noti,
971                                            double *size);
972
973 /**
974  * @brief This function set initial progress for ongoing type.
975  * @details After notification_insert, it does not upate progress. If you want to update progress, please call notification_update_progress().
976  * @remarks
977  * @param[in] noti notification handle
978  * @param[in] percentage progress percentage
979  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
980  * @retval NOTIFICATION_ERROR_NONE - success
981  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
982  * @pre
983  * @post
984  * @see
985  * @par Sample code:
986  * @code
987 #include <notification.h>
988 ...
989 {
990         notification_h noti = NULL;
991         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
992
993         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
994         if(noti == NULL) {
995                 return;
996         }
997
998         noti_err  = notification_set_progress(noti, 0.0);
999         if(noti_err != NOTIFICATION_ERROR_NONE) {
1000                 notification_free(noti);
1001                 return;
1002         }
1003 }
1004  * @endcode
1005  */
1006 notification_error_e notification_set_progress(notification_h noti,
1007                                                double percentage);
1008
1009 /**
1010  * @brief This function get progress percentage.
1011  * @details
1012  * @remarks
1013  * @param[in] noti notification handle
1014  * @param[out] percentage progress percentage
1015  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1016  * @retval NOTIFICATION_ERROR_NONE - success
1017  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1018  * @pre
1019  * @post
1020  * @see
1021  * @par Sample code:
1022  * @code
1023 #include <notification.h>
1024 ...
1025 {
1026         notification_h noti = NULL;
1027         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1028         double percentage = 0.0;
1029
1030         noti_err  = notification_get_progress(noti, &percentage);
1031         if(noti_err != NOTIFICATION_ERROR_NONE) {
1032                 return;
1033         }
1034 }
1035  * @endcode
1036  */
1037 notification_error_e notification_get_progress(notification_h noti,
1038                                                double *percentage);
1039
1040 /**
1041  * @brief This function set caller_pkgname.
1042  * @details caller_pkgname is set automatically when notification_new. We are not recommend to use this API.
1043  * @remarks
1044  * @param[in] noti notification handle
1045  * @param[in] pkgname caller package name
1046  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1047  * @retval NOTIFICATION_ERROR_NONE - success
1048  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1049  * @pre
1050  * @post
1051  * @see
1052  * @par Sample code:
1053  * @code
1054 #include <notification.h>
1055 ...
1056 {
1057         notification_h noti = NULL;
1058         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1059
1060         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1061         if(noti == NULL) {
1062                 return;
1063         }
1064
1065         noti_err  = notification_set_pkgname(noti, "org.tizen.phone");
1066         if(noti_err != NOTIFICATION_ERROR_NONE) {
1067                 notification_free(noti);
1068                 return;
1069         }
1070 }
1071  * @endcode
1072  */
1073 notification_error_e notification_set_pkgname(notification_h noti,
1074                                               const char *pkgname);
1075
1076 /**
1077  * @brief This function get caller pkgname.
1078  * @details
1079  * @remarks
1080  * @param[in] noti notification handle
1081  * @param[out] pkgname caller package name
1082  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1083  * @retval NOTIFICATION_ERROR_NONE - success
1084  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1085  * @pre
1086  * @post
1087  * @see
1088  * @par Sample code:
1089  * @code
1090 #include <notification.h>
1091 ...
1092 {
1093         notification_h noti = NULL;
1094         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1095         char *pkgname = NULL;
1096
1097         noti_err  = notification_get_pkgname(noti, &pkgname);
1098         if(noti_err != NOTIFICATION_ERROR_NONE) {
1099                 return;
1100         }
1101 }
1102  * @endcode
1103  */
1104 notification_error_e notification_get_pkgname(notification_h noti,
1105                                               char **pkgname);
1106
1107 /**
1108  * @brief This function set layout type of notification
1109  * @details caller can set displaying layout of notification with this API
1110  * @remarks
1111  * @param[in] noti notification handle
1112  * @param[in] layout type
1113  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1114  * @retval NOTIFICATION_ERROR_NONE - success
1115  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1116  * @pre
1117  * @post
1118  * @see #notification_ly_type_e
1119  */
1120 notification_error_e notification_set_layout(notification_h noti,
1121                 notification_ly_type_e layout);
1122
1123 /**
1124  * @brief This function get layout type of notification
1125  * @details
1126  * @remarks
1127  * @param[in] noti notification handle
1128  * @param[out] layout type of notification
1129  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1130  * @retval NOTIFICATION_ERROR_NONE - success
1131  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1132  * @pre
1133  * @post
1134  * @see #notification_ly_type_e
1135  */
1136 notification_error_e notification_get_layout(notification_h noti,
1137                 notification_ly_type_e *layout);
1138
1139 /**
1140  * @brief This function set application badge count.
1141  * @details
1142  * @remarks
1143  * @param[in] pkgname If NULL, caller pkgname is set internally.
1144  * @param[in] group_id group id
1145  * @param[in] count badge count
1146  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1147  * @retval NOTIFICATION_ERROR_NONE - success
1148  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1149  * @pre 
1150  * @post
1151  * @see
1152  * @par Sample code:
1153 #include <notification.h>
1154  ...
1155   {
1156          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1157          
1158          noti_err  = notification_set_badge(NULL, NOTIFICATION_GROUP_ID_NONE, 5);
1159          if(noti_err != NOTIFICATION_ERROR_NONE) {
1160                  return;
1161          }
1162  }
1163  * @endcode
1164  */
1165 notification_error_e notification_set_badge(const char *pkgname,
1166                                             int group_id, int count);
1167
1168 /**
1169  * @brief This function get application badge count.
1170  * @details
1171  * @remarks
1172  * @param[in] pkgname If NULL, caller pkgname is set internally.
1173  * @param[in] group_id group id
1174  * @param[out] count badge count
1175  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1176  * @retval NOTIFICATION_ERROR_NONE - success
1177  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1178  * @pre 
1179  * @post
1180  * @see
1181  * @par Sample code:
1182 #include <notification.h>
1183  ...
1184   {
1185          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1186          int count = 0;
1187          
1188          noti_err  = notification_get_badge(NULL, NOTIFICATION_GROUP_ID_NONE, &count);
1189          if(noti_err != NOTIFICATION_ERROR_NONE) {
1190                  return;
1191          }
1192  }
1193  * @endcode
1194  */
1195 notification_error_e notification_get_badge(const char *pkgname,
1196                                             int group_id, int *count);
1197
1198 /**
1199  * @brief This function get Group ID and Private ID
1200  * @details
1201  * @remarks
1202  * @param[in] noti notification handle
1203  * @param[out] group_id Group ID
1204  * @param[out] priv_id Private ID
1205  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1206  * @retval NOTIFICATION_ERROR_NONE - success
1207  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1208  * @pre 
1209  * @post
1210  * @see 
1211  * @par Sample code:
1212  * @code
1213 #include <notification.h>
1214  ...
1215   {
1216          notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1217          int group_id, priv_id;
1218  
1219          noti_err  = notification_get_id(noti, &group_id, &priv_id);
1220          if(noti_err != NOTIFICATION_ERROR_NONE) {
1221                  return;
1222          }
1223  }
1224  * @endcode
1225  */
1226 notification_error_e notification_get_id(notification_h noti,
1227                                          int *group_id, int *priv_id);
1228
1229 /**
1230  * @brief This function get notification type
1231  * @details
1232  * @remarks
1233  * @param[in] noti notification handle
1234  * @param[out] type notification type
1235  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1236  * @retval NOTIFICATION_ERROR_NONE - success
1237  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide parameter
1238  * @pre 
1239  * @post
1240  * @see 
1241  * @par Sample code:
1242  * @code
1243 #include <notification.h>
1244 ...
1245  {
1246         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1247         notification_type_e type;
1248
1249         noti_err  = notification_get_type(noti, &type);
1250         if(noti_err != NOTIFICATION_ERROR_NONE) {
1251                 return;
1252         }
1253 }
1254  * @endcode
1255  */
1256 notification_error_e notification_get_type(notification_h noti,
1257                                            notification_type_e * type);
1258
1259 /**
1260  * @brief This function insert notification data.
1261  * @details Notification data is inserted to DB and then notification data is displaying display application.
1262  * When notification_new() call, if priv_id is NOTIFICATION_PRIV_ID_NONE, priv_id is return internally set priv_id.
1263  * @remarks
1264  * @param[in] noti notification handle
1265  * @param[out] priv_id private ID
1266  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1267  * @retval NOTIFICATION_ERROR_NONE - success
1268  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1269  * @pre notification_new()
1270  * @post notification_free()
1271  * @see #notification_h
1272  * @par Sample code:
1273  * @code
1274 #include <notification.h>
1275 ...
1276  {
1277         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1278
1279         noti_err  = notification_insert(noti, NULL);
1280         if(noti_err != NOTIFICATION_ERROR_NONE) {
1281                 return;
1282         }
1283 }
1284  * @endcode
1285  */
1286 notification_error_e notification_insert(notification_h noti,
1287                                          int *priv_id);
1288
1289 /**
1290  * @brief This function update notification data.
1291  * @details Display application update UI.
1292  * @remarks
1293  * @param[in] noti notification handle that is created by notification_new().
1294  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1295  * @retval NOTIFICATION_ERROR_NONE - success
1296  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1297  * @retval NOTIFICATION_ERROR_NOT_EXIST_ID - not exist priv id
1298  * @pre
1299  * @post
1300  * @see #notification_h
1301  * @par Sample code:
1302  * @code
1303 #include <notification.h>
1304 ...
1305  {
1306         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1307
1308         noti_err  = notification_update(NULL);
1309         if(noti_err != NOTIFICATION_ERROR_NONE) {
1310                 return;
1311         }
1312 }
1313  * @endcode
1314  */
1315 notification_error_e notification_update(notification_h noti);
1316
1317 /**
1318  * @brief This function clear all notification of type.
1319  * @details Not recommand API. Only for notification tray's clear button operation.
1320  * @remarks
1321  * @param[in] type notification type
1322  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1323  * @retval NOTIFICATION_ERROR_NONE - success
1324  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1325  * @pre
1326  * @post
1327  * @see #notification_type_e
1328  * @par Sample code:
1329  * @code
1330 #include <notification.h>
1331 ...
1332  {
1333         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1334
1335         noti_err  = notifiation_clear(NOTIFICATION_TYPE_NOTI);
1336         if(noti_err != NOTIFICATION_ERROR_NONE) {
1337                 return;
1338         }
1339 }
1340  * @endcode
1341  */
1342 notification_error_e notifiation_clear(notification_type_e type);
1343
1344 /**
1345  * @brief This function delete notification by type. 
1346  * @details If pkgname is NULL, caller_pkgname is set internally.
1347  * @remarks
1348  * @param[in] pkgname caller application package name or NULL
1349  * @param[in] type notification type
1350  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1351  * @retval NOTIFICATION_ERROR_NONE - success
1352  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1353  * @pre
1354  * @post
1355  * @see
1356  * @par Sample code:
1357  * @code
1358 #include <notification.h>
1359 ...
1360  {
1361         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1362
1363         noti_err  = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
1364         if(noti_err != NOTIFICATION_ERROR_NONE) {
1365                 return;
1366         }
1367 }
1368  * @endcode
1369  */
1370 notification_error_e notification_delete_all_by_type(const char *pkgname,
1371                                                      notification_type_e type);
1372
1373 /**
1374  * @brief This function delete group notification data by group ID.
1375  * @details If pkgname is NULL, caller_pkgname is set internally.
1376  * @remarks
1377  * @param[in] pkgname caller application package name or NULL
1378  * @param[in] type notification type
1379  * @param[in] group_id group ID
1380  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1381  * @retval NOTIFICATION_ERROR_NONE - success
1382  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1383  * @pre
1384  * @post
1385  * @see
1386  * @par Sample code:
1387  * @code
1388 #include <notification.h>
1389 ...
1390  {
1391         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1392
1393         noti_err  = notification_delete_group_by_group_id(NULL, NOTIFICATION_TYPE_NOTI, APP_GROUP_ID);
1394         if(noti_err != NOTIFICATION_ERROR_NONE) {
1395                 return;
1396         }
1397 }
1398  * @endcode
1399  */
1400 notification_error_e notification_delete_group_by_group_id(const char *pkgname,
1401                                                            notification_type_e type,
1402                                                            int group_id);
1403
1404 /**
1405  * @brief This function delete group notification data that include priv_id.
1406  * @details If pkgname is NULL, caller_pkgname is set internally.
1407  * @remarks
1408  * @param[in] pkgname caller application package name or NULL
1409  * @param[in] type notification type
1410  * @param[in] priv_id priv ID
1411  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1412  * @retval NOTIFICATION_ERROR_NONE - success
1413  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1414  * @pre
1415  * @post
1416  * @see
1417  * @par Sample code:
1418  * @code
1419 #include <notification.h>
1420 ...
1421  {
1422         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1423
1424         noti_err  = notification_delete_group_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1425         if(noti_err != NOTIFICATION_ERROR_NONE) {
1426                 return;
1427         }
1428 }
1429  * @endcode
1430  */
1431 notification_error_e notification_delete_group_by_priv_id(const char *pkgname,
1432                                                           notification_type_e type,
1433                                                           int priv_id);
1434
1435 /**
1436  * @brief This function delete notification data that private ID is priv_id.
1437  * @details If pkgname is NULL, caller_pkgname is set internally.
1438  * @remarks
1439  * @param[in] pkgname caller application package name or NULL
1440  * @param[in] type notification type
1441  * @param[in] priv_id priv ID
1442  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1443  * @retval NOTIFICATION_ERROR_NONE - success
1444  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1445  * @pre
1446  * @post
1447  * @see
1448  * @par Sample code:
1449  * @code
1450 #include <notification.h>
1451 ...
1452  {
1453         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1454
1455         noti_err  = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
1456         if(noti_err != NOTIFICATION_ERROR_NONE) {
1457                 return;
1458         }
1459 }
1460  * @endcode
1461  */
1462 notification_error_e notification_delete_by_priv_id(const char *pkgname,
1463                                                     notification_type_e type,
1464                                                     int priv_id);
1465
1466 /**
1467  * @brief This function delete notification data from DB
1468  * @details notification_delete() remove notification data from DB and notification_free release menory of notification data.
1469  * @remarks
1470  * @param[in] noti notification handle
1471  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1472  * @retval NOTIFICATION_ERROR_NONE - success
1473  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1474  * @pre
1475  * @post
1476  * @see #notification_h
1477  * @par Sample code:
1478  * @code
1479 #include <notification.h>
1480 ...
1481  {
1482         notificaton_h noti = NULL;
1483         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1484
1485         ...
1486
1487         noti_err  = notification_delete(noti);
1488         if(noti_err != NOTIFICATION_ERROR_NONE) {
1489                 return;
1490         }
1491
1492 }
1493  * @endcode
1494  */
1495 notification_error_e notification_delete(notification_h noti);
1496
1497 /**
1498  * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1499  * @details Display application update UI.
1500  * @remarks
1501  * @param[in] noti notification handle or NULL if priv_id is valid
1502  * @param[in] priv_id private ID
1503  * @param[in] progress % value of progressive data
1504  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1505  * @retval NOTIFICATION_ERROR_NONE - success
1506  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1507  * @pre
1508  * @post
1509  * @par Sample code:
1510  * @code
1511 #include <notification.h>
1512 ...
1513  {
1514         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1515
1516         noti_err  = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
1517         if(noti_err != NOTIFICATION_ERROR_NONE) {
1518                 return;
1519         }
1520 }
1521  * @endcode
1522  */
1523 notification_error_e notification_update_progress(notification_h noti,
1524                                                   int priv_id,
1525                                                   double progress);
1526
1527 /**
1528  * @brief This function update progressive data of inserted notification data. Only work at NOTIFICATION_TYPE_ONGOING type.
1529  * @details Display application update UI.
1530  * @remarks
1531  * @param[in] noti notification handle or NULL if priv_id is valid
1532  * @param[in] priv_id private ID
1533  * @param[in] size bytes of progressive data
1534  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
1535  * @retval NOTIFICATION_ERROR_NONE - success
1536  * @retval NOTIFICATION_ERROR_INVALID_DATA - Invalide input value
1537  * @pre
1538  * @post
1539  * @par Sample code:
1540  * @code
1541 #include <notification.h>
1542 ...
1543  {
1544         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1545
1546         noti_err  = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
1547         if(noti_err != NOTIFICATION_ERROR_NONE) {
1548                 return;
1549         }
1550 }
1551  * @endcode
1552  */
1553 notification_error_e notification_update_size(notification_h noti,
1554                                               int priv_id, double size);
1555
1556 notification_error_e notification_update_content(notification_h noti,
1557                                                          int priv_id,
1558                                                          const char *content);
1559
1560 /**
1561  * @brief This function create internal structure data and return notification handle.
1562  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1563  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1564  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1565  * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT, 
1566  * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1567  * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1568  * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1569  * @remarks
1570  * @param[in] type notification type
1571  * @param[in] group_id Group ID
1572  * @param[in] priv_id Priv ID
1573  * @return notification handle(#notification_h) if success, NULL if failure.
1574  * @retval #notification_h - success
1575  * @retval NULL - failure
1576  * @pre
1577  * @post
1578  * @see #notification_type_e
1579  * @see #notification_h
1580  * @par Sample code:
1581  * @code
1582 #include <notification.h>
1583 ...
1584 {
1585         notification_h noti = NULL;
1586
1587         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1588         if(noti == NULL) {
1589                 return;
1590         }
1591         ...
1592 }
1593  * @endcode
1594  */
1595 notification_h notification_new(notification_type_e type, int group_id,
1596                                 int priv_id);
1597
1598 /**
1599  * @brief This function create internal structure data and return notification handle.
1600  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1601  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1602  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1603  * @remarks
1604  * @param[in] type notification type
1605  * @return notification handle(#notification_h) if success, NULL if failure.
1606  * @retval #notification_h - success
1607  * @retval NULL - failure
1608  * @pre
1609  * @post
1610  * @see #notification_type_e
1611  * @see #notification_h
1612  * @par Sample code:
1613  * @code
1614 #include <notification.h>
1615 ...
1616 {
1617         notification_h noti = NULL;
1618
1619         noti = notification_create(NOTIFICATION_TYPE_NOTI);
1620         if(noti == NULL) {
1621                 return;
1622         }
1623         ...
1624 }
1625  * @endcode
1626  */
1627 notification_h notification_create(notification_type_e type);
1628
1629 /**
1630  * @brief This function create internal structure data and return notification handle.
1631  * @details Available type is #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
1632  * #NOTIFICATION_TYPE_NOTI is remaining notification data evenif device is restarted.
1633  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
1634  * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouping. #NOTIFICATION_GROUP_ID_DEFAULT,
1635  * notification data is grouping with same title. Positive number ( > 0 ) is grouping with same number.
1636  * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
1637  * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
1638  * @remarks
1639  * @param[in] type notification type
1640  * @param[in] group_id Group ID
1641  * @param[in] priv_id Priv ID
1642  * @return notification handle(#notification_h) if success, NULL if failure.
1643  * @retval #notification_h - success
1644  * @retval NULL - failure
1645  * @pre
1646  * @post
1647  * @see #notification_type_e
1648  * @see #notification_h
1649  * @par Sample code:
1650  * @code
1651 #include <notification.h>
1652 ...
1653 {
1654         notification_h noti = NULL;
1655
1656         noti = notification_load(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1657         if(noti == NULL) {
1658                 return;
1659         }
1660         ...
1661 }
1662  * @endcode
1663  */
1664 notification_h notification_load(char *pkgname,
1665                                 int priv_id);
1666
1667 /**
1668  * @brief This function create notification clone.
1669  * @details Newly created notification handle is returned.
1670  * @remarks This clone notification handle should be call notification_free().
1671  * @param[in] noti notification handle
1672  * @param[out] clone newly created notification handle that has same with input noti.
1673  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1674  * @retval NOTIFICATION_ERROR_NONE - success
1675  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1676  * @pre
1677  * @post
1678  * @see #notification_type_e
1679  * @see #notification_h
1680  * @par Sample code:
1681  * @code
1682 #include <notification.h>
1683 ...
1684 {
1685         notification_h noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1686         notification_h clone = NULL;
1687
1688         notification_clone(noti, &clone);
1689         ...
1690 }
1691  * @endcode
1692  */
1693 notification_error_e notification_clone(notification_h noti, notification_h *clone);
1694
1695 /**
1696  * @brief This function free internal structure data of notification handle.
1697  * @details Internal data of notification handle is released. Notification data that inserted is not deleted.
1698  * @remarks
1699  * @param[in] noti notification handle
1700  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1701  * @retval NOTIFICATION_ERROR_NONE - success
1702  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1703  * @pre notification_new()
1704  * @post
1705  * @see #notification_h
1706  * @par Sample code:
1707  * @code
1708 #include <notification.h>
1709 ...
1710 {
1711         notification_h noti = NULL;
1712         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1713
1714         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
1715         if(noti == NULL) {
1716                 return;
1717         }
1718         ...
1719
1720         noti_err = notification_free(noti);
1721         if(noti_err != NOTIFICATION_ERROR_NONE) {
1722                 return;
1723         }
1724 }
1725  * @endcode
1726  */
1727 notification_error_e notification_free(notification_h noti);
1728
1729 /**
1730  * @brief This function register notification chagned callback.
1731  * @details 
1732  * @remarks
1733  * @param[in] changed_cb callback function
1734  * @param[in] user_data user data
1735  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1736  * @retval NOTIFICATION_ERROR_NONE - success
1737  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1738  * @pre notification_new()
1739  * @post
1740  * @see notification_unresister_changed_cb()
1741  * @par Sample code:
1742  * @code
1743 #include <notification.h>
1744 ...
1745 {
1746         noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1747         if(noti_err != NOTIFICATION_ERROR_NONE) {
1748                 return;
1749         }
1750 }
1751  * @endcode
1752  */
1753 notification_error_e
1754 notification_resister_changed_cb(
1755         void (*changed_cb)(void *data, notification_type_e type),
1756         void *user_data);
1757
1758 /**
1759  * @brief This function unregister notification chagned callback.
1760  * @details 
1761  * @remarks
1762  * @param[in] changed_cb callback function
1763  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1764  * @retval NOTIFICATION_ERROR_NONE - success
1765  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1766  * @pre notification_new()
1767  * @post
1768  * @see notification_resister_changed_cb()
1769  * @par Sample code:
1770  * @code
1771 #include <notification.h>
1772 ...
1773 {
1774         noti_err = notification_unresister_changed_cb(app_changed_cb);
1775         if(noti_err != NOTIFICATION_ERROR_NONE) {
1776                 return;
1777         }
1778 }
1779  * @endcode
1780  */
1781 notification_error_e
1782 notification_unresister_changed_cb(
1783         void (*changed_cb)(void *data, notification_type_e type));
1784
1785 /**
1786  * @brief This function register notification chagned callback.
1787  * @details
1788  * @remarks
1789  * @param[in] changed_cb callback function
1790  * @param[in] user_data user data
1791  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1792  * @retval NOTIFICATION_ERROR_NONE - success
1793  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1794  * @pre notification_new()
1795  * @post
1796  * @see notification_unresister_changed_cb()
1797  * @par Sample code:
1798  * @code
1799 #include <notification.h>
1800 ...
1801 {
1802         noti_err = notification_resister_changed_cb(app_changed_cb, user_data);
1803         if(noti_err != NOTIFICATION_ERROR_NONE) {
1804                 return;
1805         }
1806 }
1807  * @endcode
1808  */
1809 notification_error_e
1810 notification_register_detailed_changed_cb(
1811                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1812                 void *user_data);
1813
1814 /**
1815  * @brief This function unregister notification chagned callback.
1816  * @details
1817  * @remarks
1818  * @param[in] changed_cb callback function
1819  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1820  * @retval NOTIFICATION_ERROR_NONE - success
1821  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1822  * @pre notification_new()
1823  * @post
1824  * @see notification_resister_changed_cb()
1825  * @par Sample code:
1826  * @code
1827 #include <notification.h>
1828 ...
1829 {
1830         noti_err = notification_unresister_changed_cb(app_changed_cb);
1831         if(noti_err != NOTIFICATION_ERROR_NONE) {
1832                 return;
1833         }
1834 }
1835  * @endcode
1836  */
1837 notification_error_e
1838 notification_unregister_detailed_changed_cb(
1839                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
1840                 void *user_data);
1841
1842 /**
1843  * @brief This function get notification data count.
1844  * @details Count is the result of the conditions that type, pkgname, group_id, priv_id.
1845  * @remarks
1846  * @param[in] type notification type
1847  * @param[in] pkgname caller application package name
1848  * @param[in] group_id group id
1849  * @param[in] priv_id private id
1850  * @param[out] count notification data number
1851  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1852  * @retval NOTIFICATION_ERROR_NONE - success
1853  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1854  * @pre
1855  * @post
1856  * @see #notification_type_e
1857  * @par Sample code:
1858  * @code
1859 #include <notification.h>
1860 ...
1861 {
1862         notification_list_h noti_list = NULL;
1863         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1864         int count = 0;
1865         
1866         noti_err = notification_get_count(NOTIFICATION_TYPE_NONE, NULL, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE, &count);
1867         if(noti_err != NOTIFICATION_ERROR_NONE) {
1868                 return;
1869         }
1870 }
1871  * @endcode
1872  */
1873 notification_error_e notification_get_count(notification_type_e type,
1874                                             const char *pkgname,
1875                                             int group_id, int priv_id,
1876                                             int *count);
1877
1878 /**
1879  * @brief This function will be deprecated.
1880  * @see notification_get_grouping_list()
1881  *
1882  */
1883 notification_error_e notification_get_list(notification_type_e type,
1884                                            int count,
1885                                            notification_list_h * list);
1886
1887 /**
1888  * @brief This function return notification grouping list handle.
1889  * @details If count is -1, all of notification list is returned.
1890  * @remarks
1891  * @param[in] type notification type
1892  * @param[in] count returned notification data number
1893  * @param[out] list notification list handle
1894  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1895  * @retval NOTIFICATION_ERROR_NONE - success
1896  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1897  * @pre
1898  * @post
1899  * @see #notification_list_h
1900  * @par Sample code:
1901  * @code
1902 #include <notification.h>
1903 ...
1904 {
1905         notification_list_h noti_list = NULL;
1906         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1907         
1908         noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
1909         if(noti_err != NOTIFICATION_ERROR_NONE) {
1910                 return;
1911         }
1912 }
1913  * @endcode
1914  */
1915 notification_error_e notification_get_grouping_list(notification_type_e type,
1916                                                     int count,
1917                                                     notification_list_h *list);
1918
1919 /**
1920  * @brief This function return notification detail list handle of grouping data.
1921  * @details If count is -1, all of notification list is returned.
1922  * @remarks
1923  * @param[in] pkgname caller application package name
1924  * @param[in] group_id group id
1925  * @param[in] priv_id private id
1926  * @param[in] count returned notification data number
1927  * @param[out] list notification list handle
1928  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1929  * @retval NOTIFICATION_ERROR_NONE - success
1930  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1931  * @pre
1932  * @post
1933  * @see #notification_list_h
1934  * @par Sample code:
1935  * @code
1936 #include <notification.h>
1937 ...
1938 {
1939         notification_list_h noti_list = NULL;
1940         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1941         
1942         noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, &noti_list);
1943         if(noti_err != NOTIFICATION_ERROR_NONE) {
1944                 return;
1945         }
1946 }
1947  * @endcode
1948  */
1949 notification_error_e notification_get_detail_list(const char *pkgname,
1950                                                   int group_id,
1951                                                   int priv_id,
1952                                                   int count,
1953                                                   notification_list_h *list);
1954
1955 /**
1956  * @brief This function release notification list.
1957  * @details
1958  * @remarks
1959  * @param[in] list notification list handle
1960  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1961  * @retval NOTIFICATION_ERROR_NONE - success
1962  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1963  * @pre notification_get_grouping_list() or notification_get_detail_list ()
1964  * @post
1965  * @see #notification_list_h
1966  * @par Sample code:
1967  * @code
1968 #include <notification.h>
1969 ...
1970 {
1971         notification_list_h noti_list = NULL;
1972         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
1973
1974         ...
1975         
1976         noti_err = notification_free_list(noti_list);
1977         if(noti_err != NOTIFICATION_ERROR_NONE) {
1978                 return;
1979         }
1980 }
1981  * @endcode
1982  */
1983 notification_error_e notification_free_list(notification_list_h list);
1984
1985 /** 
1986  * @}
1987  */
1988
1989 /**
1990  * @brief You can get the information about notification operation using this function
1991  * @details
1992  * @remarks
1993  * @param[in] list notification list handle
1994  * @return NOTIFICATION_ERROR_NONE if success, other value if failure.
1995  * @retval NOTIFICATION_ERROR_NONE - success
1996  * @retval NOTIFICATION_ERROR_INVALID_DATA - invalid parameter
1997  * @pre notification_get_grouping_list() or notification_get_detail_list ()
1998  * @post
1999  * @see #notification_op
2000  */
2001 notification_error_e notification_op_get_data(notification_op *noti_op,
2002                                                        notification_op_data_type_e type,
2003                                                        void *data);
2004
2005 /**
2006  * @}
2007  */
2008
2009 void notification_call_changed_cb(notification_op *op_list, int op_num);
2010
2011 int notification_is_service_ready(void);
2012
2013 notification_error_e notification_add_deffered_task(
2014                 void (*deffered_task_cb)(void *data), void *user_data);
2015
2016 notification_error_e notification_del_deffered_task(
2017                 void (*deffered_task_cb)(void *data));
2018
2019 #ifdef __cplusplus
2020 }
2021 #endif
2022 #endif                          /* __NOTIFICATION_H__ */