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