Add multi-user feature
[platform/core/api/notification.git] / include / notification_internal.h
1 /*
2  * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __NOTIFICATION_INTERNAL_H__
18 #define __NOTIFICATION_INTERNAL_H__
19 #include <glib.h>
20 #include <notification_error.h>
21 #include <notification_type.h>
22 #include <notification_list.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 /**
29  * @addtogroup NOTIFICATION_INTERNAL
30  * @{
31  */
32 #define NOTIFICATION_GLOBAL_UID -1
33 #define NOTIFICATION_DISPLAY_APP_HEADS_UP NOTIFICATION_DISPLAY_APP_ACTIVE /* To avoid build error */
34 #define NOTIFICATION_ERROR (notification_error_quark())
35 GQuark notification_error_quark(void);
36
37 /**
38  * @brief This function add deferred task. the registered task will be executed when notification service become ready
39  * @param[in] deferred_task_cb The callback function
40  * @param[in] user_data The user data to be passed to the callback function
41  * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
42  * @see #notification_error_e
43  * @see notification_is_service_ready()
44  */
45 int notification_add_deferred_task(
46                 void (*deferred_task_cb)(void *data), void *user_data);
47
48 /**
49  * @brief This function remove deferred task.
50  * @param[in] deferred_task_cb The callback function
51  * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
52  * @see #notification_error_e
53  * @see notification_is_service_ready()
54  */
55 int notification_del_deferred_task(
56                 void (*deferred_task_cb)(void *data));
57
58
59 int
60 notification_resister_changed_cb_for_uid(
61         void (*changed_cb)(void *data, notification_type_e type),
62         void *user_data, uid_t uid);
63
64 /**
65  * @brief This function will be removed.
66  * @see notification_unresister_changed_cb()
67  */
68 int
69 notification_resister_changed_cb(
70         void (*changed_cb)(void *data, notification_type_e type),
71         void *user_data);
72
73 /**
74  * @brief This function will be removed.
75  * @see notification_resister_changed_cb()
76  */
77 int
78 notification_unresister_changed_cb(
79         void (*changed_cb)(void *data, notification_type_e type));
80
81 /**
82  * @brief Updates the progress of the inserted notification. This only works for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
83  * @details The Notification view on the notification area could be updated.
84  * @param[in] noti Notification handle or NULL if priv_id is valid
85  * @param[in] priv_id Private ID
86  * @param[in] progress Percentage value of progressive data
87  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
88  * @retval NOTIFICATION_ERROR_NONE Success
89  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
90  * @par Sample code:
91  * @code
92 #include <notification.h>
93 ...
94  {
95         int noti_err = NOTIFICATION_ERROR_NONE;
96
97         noti_err  = notification_update_progress(NULL, APP_NOTI_PRIV_ID, 0.6);
98         if(noti_err != NOTIFICATION_ERROR_NONE) {
99                 return;
100         }
101 }
102  * @endcode
103  */
104 int notification_update_progress(notification_h noti,
105                                                   int priv_id,
106                                                   double progress);
107
108 /**
109  * @brief Updates the size of inserted notification data. This only works for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
110  * @details Notification view on notification area could be updated.
111  * @param[in] noti Notification handle or NULL if priv_id is valid
112  * @param[in] priv_id Private ID
113  * @param[in] size Bytes of progressive data
114  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
115  * @retval NOTIFICATION_ERROR_NONE Success
116  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
117  * @par Sample code:
118  * @code
119 #include <notification.h>
120 ...
121  {
122         int noti_err = NOTIFICATION_ERROR_NONE;
123
124         noti_err  = notification_update_size(NULL, APP_NOTI_PRIV_ID, 3000000);
125         if(noti_err != NOTIFICATION_ERROR_NONE) {
126                 return;
127         }
128 }
129  * @endcode
130  */
131 int notification_update_size(notification_h noti,
132                                               int priv_id, double size);
133
134 /**
135  * @brief Updates the content of the inserted notification data. This is only for the ongoing notification (NOTIFICATION_TYPE_ONGOING).
136  * @details Notification view on notification area could be updated.
137  * @param[in] noti Notification handle or NULL if priv_id is valid
138  * @param[in] priv_id Private ID
139  * @param[in] content Text to update
140  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
141  * @retval NOTIFICATION_ERROR_NONE Success
142  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
143  * @par Sample code:
144  * @code
145 #include <notification.h>
146 ...
147  {
148         int noti_err = NOTIFICATION_ERROR_NONE;
149
150         noti_err  = notification_update_content(NULL, APP_NOTI_PRIV_ID, "updated string");
151         if(noti_err != NOTIFICATION_ERROR_NONE) {
152                 return;
153         }
154 }
155  * @endcode
156  */
157 int notification_update_content(notification_h noti,
158                                                          int priv_id,
159                                                          const char *content);
160
161 /**
162  * @brief This function will be deprecated.
163  * @see notification_set_image()
164  *
165  */
166 NOTIFICATION_DEPRECATED_API int notification_set_icon(notification_h noti,
167                                            const char *icon_path);
168
169 /**
170  * @brief This function will be deprecated.
171  * @see notification_get_image()
172  *
173  */
174 NOTIFICATION_DEPRECATED_API int notification_get_icon(notification_h noti,
175                                            char **icon_path);
176
177 /**
178  * @brief This function will be deprecated.
179  * @see notification_set_text()
180  *
181  */
182 NOTIFICATION_DEPRECATED_API int notification_set_title(notification_h noti,
183                                             const char *title,
184                                             const char *loc_title);
185
186 /**
187  * @brief This function will be deprecated.
188  * @see notification_get_text()
189  *
190  */
191 NOTIFICATION_DEPRECATED_API int notification_get_title(notification_h noti,
192                                             char **title,
193                                             char **loc_title);
194
195 /**
196  * @brief This function will be deprecated.
197  * @see notification_set_text()
198  *
199  */
200 NOTIFICATION_DEPRECATED_API int notification_set_content(notification_h noti,
201                                               const char *content,
202                                               const char *loc_content);
203
204 /**
205  * @brief This function will be deprecated.
206  * @see notification_get_text()
207  *
208  */
209 NOTIFICATION_DEPRECATED_API int notification_get_content(notification_h noti,
210                                               char **content,
211                                               char **loc_content);
212
213 /**
214  * @brief This function will be removed.
215  * @see notification_set_execute_option()
216  *
217  */
218 NOTIFICATION_DEPRECATED_API int notification_set_application(notification_h noti, const char *pkgname); /* Do not use this */
219
220 /**
221  * @brief This function will be removed.
222  * @see notification_get_execute_option()
223  *
224  */
225 NOTIFICATION_DEPRECATED_API int notification_get_application(notification_h noti, char **pkgname);      /* Do not use this */
226
227 /**
228  * @brief This function will be deprecated.
229  * @see notification_set_execute_option()
230  *
231  */
232 NOTIFICATION_DEPRECATED_API int notification_set_args(notification_h noti, bundle *args, bundle *group_args);   /* Do not use this */
233
234 /**
235  * @brief This function will be deprecated.
236  * @see notification_get_execute_option()
237  *
238  */
239 NOTIFICATION_DEPRECATED_API int notification_get_args(notification_h noti, bundle **args, bundle **group_args); /* Do not use this */
240
241 /**
242  * @brief This function is deprecated.
243  * @see notification_get_grouping_list()
244  *
245  */
246 NOTIFICATION_DEPRECATED_API int notification_get_grouping_list(notification_type_e type,
247                                                     int count,
248                                                     notification_list_h *list);
249
250 /**
251  * @brief This function will be deprecated.
252  * @see notification_delete_by_priv_id()
253  *
254  */
255 NOTIFICATION_DEPRECATED_API int notification_delete_group_by_group_id(const char *pkgname,
256                                                            notification_type_e type,
257                                                            int group_id);
258
259 /**
260  * @brief This function will be deprecated.
261  * @see notification_delete_by_priv_id()
262  *
263  */
264 NOTIFICATION_DEPRECATED_API int notification_delete_group_by_priv_id(const char *pkgname,
265                                                           notification_type_e type,
266                                                           int priv_id);
267 /**
268  * @brief This function will be deprecated.
269  *
270  */
271 NOTIFICATION_DEPRECATED_API int notification_get_count(notification_type_e type,
272                                             const char *pkgname,
273                                             int group_id, int priv_id,
274                                             int *count);
275
276 /**
277  * @brief This function will be deprecated.
278  *
279  */
280 NOTIFICATION_DEPRECATED_API int notifiation_clear(notification_type_e type);
281
282 /**
283  * @internal
284  * @brief This function will be deprecated.
285  * @details Use only for the notification tray's clear button operation.
286  * @param[in] type Notification type
287  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
288  * @retval NOTIFICATION_ERROR_NONE Success
289  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
290  * @see #notification_type_e
291  * @par Sample code:
292  * @code
293 #include <notification.h>
294 ...
295  {
296         int noti_err = NOTIFICATION_ERROR_NONE;
297
298         noti_err  = notification_clear(NOTIFICATION_TYPE_NOTI);
299         if(noti_err != NOTIFICATION_ERROR_NONE) {
300                 return;
301         }
302 }
303  * @endcode
304  */
305 NOTIFICATION_DEPRECATED_API int notification_clear(notification_type_e type);
306
307 /**
308  * @internal
309  * @brief This function will be deprecated.
310  * @return 1 on ready, other value on not ready
311  */
312 NOTIFICATION_DEPRECATED_API int notification_is_service_ready(void);
313
314 /**
315  * @internal
316  * @brief This function will be deprecated.
317  * @param[in] list Notification list handle
318  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
319  * @retval NOTIFICATION_ERROR_NONE Success
320  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
321  * @pre notification_get_grouping_list() or notification_get_detail_list().
322  * @see #notification_op
323  */
324 NOTIFICATION_DEPRECATED_API int notification_op_get_data(notification_op *noti_op,
325                                                        notification_op_data_type_e type,
326                                                        void *data);
327
328 /**
329  * @internal
330  * @brief This function will be deprecated.
331  * @details Caller_pkgname is set automatically when notification_new() is called. We do not recommend to use this API.
332  * @param[in] noti Notification handle
333  * @param[in] pkgname Caller package name
334  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
335  * @retval NOTIFICATION_ERROR_NONE Success
336  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
337  * @par Sample code:
338  * @code
339 #include <notification.h>
340 ...
341 {
342         notification_h noti = NULL;
343         int noti_err = NOTIFICATION_ERROR_NONE;
344
345         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
346         if(noti == NULL) {
347                 return;
348         }
349
350         noti_err  = notification_set_pkgname(noti, "org.tizen.phone");
351         if(noti_err != NOTIFICATION_ERROR_NONE) {
352                 notification_free(noti);
353                 return;
354         }
355 }
356  * @endcode
357  */
358 NOTIFICATION_DEPRECATED_API int notification_set_pkgname(notification_h noti,
359                                               const char *pkgname);
360
361 /**
362  * @internal
363  * @brief This function will be deprecated.
364  * @details If @a pkgname is NULL, caller_pkgname is set internally.
365  * @param[in] pkgname Caller application package name or NULL
366  * @param[in] type Notification type
367  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
368  * @retval NOTIFICATION_ERROR_NONE Success
369  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
370  * @par Sample code:
371  * @code
372 #include <notification.h>
373 ...
374  {
375         int noti_err = NOTIFICATION_ERROR_NONE;
376
377         noti_err  = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
378         if(noti_err != NOTIFICATION_ERROR_NONE) {
379                 return;
380         }
381 }
382  * @endcode
383  */
384 NOTIFICATION_DEPRECATED_API int notification_delete_all_by_type(const char *pkgname,
385                                                      notification_type_e type);
386
387 /**
388  * @internal
389  * @brief This function will be deprecated.
390  * @details If @a pkgname is NULL, caller_pkgname is set internally.
391  * @param[in] pkgname Caller application package name or NULL
392  * @param[in] type Notification type
393  * @param[in] priv_id Priv ID
394  * @return NOTIFICATION_ERROR_NONE if success, other value if failure
395  * @retval NOTIFICATION_ERROR_NONE Success
396  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
397  * @par Sample code:
398  * @code
399 #include <notification.h>
400 ...
401  {
402         int noti_err = NOTIFICATION_ERROR_NONE;
403
404         noti_err  = notification_delete_by_priv_id(NULL, NOTIFICATION_TYPE_NOTI, APP_PRIV_ID);
405         if(noti_err != NOTIFICATION_ERROR_NONE) {
406                 return;
407         }
408 }
409  * @endcode
410  */
411 NOTIFICATION_DEPRECATED_API int notification_delete_by_priv_id(const char *pkgname,
412                                                     notification_type_e type,
413                                                     int priv_id);
414
415 /**
416  * @internal
417  * @brief This function will be deprecated.
418  * @details When notification data selected in display application, application launched by appsvc_run_service with service_handle.
419  * @param[in] noti Notification handle
420  * @param[in] type Notification execute type
421  * @param[in] text Basic text for button
422  * @param[in] key Value for localized text
423  * @param[in] service_handle Appsvc bundle data
424  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
425  * @retval NOTIFICATION_ERROR_NONE Success
426  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
427  * @par Sample code:
428  * @code
429 #include <notification.h>
430 ...
431 {
432         notification_h noti = NULL;
433         int noti_err = NOTIFICATION_ERROR_NONE;
434         bundle *b = NULL;
435
436         ...
437
438         b = bundle_create();
439         appsvc_set_operation(b, APPSVC_OPERATION_VIEW);
440         appsvc_set_uri(b,"http://www.samsung.com");
441
442         noti_err  = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
443         if(noti_err != NOTIFICATION_ERROR_NONE) {
444                 notification_free(noti);
445                 return;
446         }
447
448         bundle_free(b);
449 }
450  * @endcode
451  */
452 NOTIFICATION_DEPRECATED_API int notification_set_execute_option(notification_h noti,
453                                                      notification_execute_type_e type,
454                                                      const char *text,
455                                                      const char *key,
456                                                      bundle *service_handle);
457
458 /**
459  * @internal
460  * @brief This function will be deprecated.
461  * @remarks ID is valid only after inserting the notification.
462  * @param[in] noti Notification handle
463  * @param[out] group_id Group ID
464  * @param[out] priv_id Private ID
465  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
466  * @retval NOTIFICATION_ERROR_NONE Success
467  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
468  * @par Sample code:
469  * @code
470 #include <notification.h>
471  ...
472   {
473          int noti_err = NOTIFICATION_ERROR_NONE;
474          int group_id, priv_id;
475
476          noti_err  = notification_get_id(noti, &group_id, &priv_id);
477          if(noti_err != NOTIFICATION_ERROR_NONE) {
478                  return;
479          }
480  }
481  * @endcode
482  */
483 NOTIFICATION_DEPRECATED_API int notification_get_id(notification_h noti,
484                                          int *group_id, int *priv_id);
485
486 /**
487  * @internal
488  * @brief This function will be deprecated.
489  * @param[in] type Notification type
490  * @param[in] group_id Group ID
491  * @param[in] priv_id Priv ID
492  * @return Notification handle(#notification_h) on success, NULL on failure
493  * @retval #notification_h Success
494  * @retval NULL Failure
495  * @see #notification_type_e
496  * @see #notification_h
497  * @par Sample code:
498  * @code
499 #include <notification.h>
500 ...
501 {
502         notification_h noti = NULL;
503
504         noti = notification_load("org.tizen.app", priv_id);
505         if(noti == NULL) {
506                 return;
507         }
508         ...
509 }
510  * @endcode
511  */
512 NOTIFICATION_DEPRECATED_API notification_h notification_load(char *pkgname,
513                                 int priv_id);
514
515 /**
516  * @internal
517  * @brief This function will be deprecated.
518  * @details Available types are #NOTIFICATION_TYPE_NOTI and #NOTIFICATION_TYPE_ONGOING.
519  * #NOTIFICATION_TYPE_NOTI is remaining notification data even if device is restarted.
520  * #NOTIFICATION_TYPE_ONGOING can display progressive feather, but notification data is removed after device is restarted.
521  * If group_id is #NOTIFICATION_GROUP_ID_NONE, notification data is not grouped. #NOTIFICATION_GROUP_ID_DEFAULT,
522  * notification data is grouped with same title. Positive number ( > 0 ) is grouped with same number.
523  * If priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id is set internally and return it when notification_insert() call.
524  * Positive number and zero ( >= 0 ) is application set private ID. These ID should have be unique each application package.
525  * @param[in] type Notification type
526  * @param[in] group_id Group ID
527  * @param[in] priv_id Priv ID
528  * @return Notification handle(#notification_h) on success, NULL on failure
529  * @retval #notification_h Success
530  * @retval NULL Failure
531  * @see #notification_type_e
532  * @see #notification_h
533  * @par Sample code:
534  * @code
535 #include <notification.h>
536 ...
537 {
538         notification_h noti = NULL;
539
540         noti = notification_new(NOTIFICATION_TYPE_NOTI, APP_GROUP_ID, NOTIFICATION_PRIV_ID_NONE);
541         if(noti == NULL) {
542                 return;
543         }
544         ...
545 }
546  * @endcode
547  */
548 NOTIFICATION_DEPRECATED_API notification_h notification_new(notification_type_e type, int group_id,
549                                 int priv_id);
550
551 /**
552  * @internal
553  * @brief This function will be deprecated.
554  * @param[in] noti Notification handle
555  * @param[in] type Notification execute type
556  * @param[out] text Text for button
557  * @param[out] service_handle Appsvc bundle data
558  * @return NOTIFICATION_ERROR_NONE on success, other value on failure
559  * @retval NOTIFICATION_ERROR_NONE Success
560  * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
561  * @par Sample code:
562  * @code
563 #include <notification.h>
564 ...
565 {
566         notification_h noti = NULL;
567         int noti_err = NOTIFICATION_ERROR_NONE;
568         bundle *b = NULL;
569
570         ...
571
572         noti_err  = notification_get_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, &b);
573         if(noti_err != NOTIFICATION_ERROR_NONE) {
574                 notification_free(noti);
575                 return;
576         }
577 }
578  * @endcode
579  */
580 NOTIFICATION_DEPRECATED_API int notification_get_execute_option(notification_h noti,
581                                                      notification_execute_type_e type,
582                                                      const char **text,
583                                                      bundle **service_handle);
584
585 /**
586  * @internal
587  * @brief Inserts a notification.
588  * @details The notification will be inserted to the database and then it will appear in the notification area.
589  *          When notification_create() is called, if priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id returns the internally set priv_id.
590  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
591  * @privlevel public
592  * @privilege %http://tizen.org/privilege/notification
593  * @param[in]  noti    The notification handle
594  * @param[out] priv_id The private ID
595  * @return #NOTIFICATION_ERROR_NONE on success,
596  *         otherwise any other value on failure
597  * @retval #NOTIFICATION_ERROR_NONE         Success
598  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
599  * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
600  * @pre Notification handle should be created by notification_create().
601  * @post notification_free().
602  * @par Sample code:
603  * @code
604 #include <notification.h>
605 ...
606  {
607         int noti_err = NOTIFICATION_ERROR_NONE;
608
609         noti_err  = notification_insert(noti, NULL);
610         if(noti_err != NOTIFICATION_ERROR_NONE) {
611                 return;
612         }
613 }
614  * @endcode
615  */
616 int notification_insert(notification_h noti,
617                 int *priv_id);
618
619 int notification_insert_for_uid(notification_h noti,
620                 int *priv_id, uid_t uid);
621
622 /**
623  * @internal
624  * @brief Updates a notification, asynchronously.
625  * @details The updated notification will appear in the notification area.
626  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
627  * @privlevel public
628  * @privilege %http://tizen.org/privilege/notification
629  * @remarks This function updates the notification asynchronously.
630  * @param[in] noti      The notification handle that is created by notification_create()
631  * @param[in] result_cb The callback called when an update completed
632  * @param[in] user_data The user data which you want to use in callback
633  * @return #NOTIFICATION_ERROR_NONE on success,
634  *         otherwise any other value on failure
635  * @retval #NOTIFICATION_ERROR_NONE         Success
636  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
637  * @retval #NOTIFICATION_ERROR_NOT_EXIST_ID Priv ID does not exist
638  * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
639  * @par Sample code:
640  * @code
641 #include <notification.h>
642 ...
643  {
644         int noti_err = NOTIFICATION_ERROR_NONE;
645
646         noti_err  = notification_update_async(NULL, result_cb, data);
647         if(noti_err != NOTIFICATION_ERROR_NONE) {
648                 return;
649         }
650 }
651  * @endcode
652  */
653 int notification_update_async(notification_h noti,
654                 void (*result_cb)(int priv_id, int result, void *data), void *user_data);
655 int notification_update_async_for_uid(notification_h noti,
656                 void (*result_cb)(int priv_id, int result, void *data), void *user_data, uid_t uid);
657
658 /**
659  * @internal
660  * @brief Registers a callback for all notification events.
661  * @details The registered callback could be called for all notification events.
662  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
663  * @privlevel public
664  * @privilege %http://tizen.org/privilege/notification
665  * @param[in] changed_cb The callback function
666  * @param[in] user_data  The user data
667  * @return #NOTIFICATION_ERROR_NONE on success,
668  *         otherwise any other value on failure
669  * @retval #NOTIFICATION_ERROR_NONE         Success
670  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
671  * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
672  * @see notification_unregister_detailed_changed_cb()
673  * @par Sample code:
674  * @code
675 #include <notification.h>
676 ...
677 {
678         noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
679         if(noti_err != NOTIFICATION_ERROR_NONE) {
680                 return;
681         }
682 }
683  * @endcode
684  */
685 int notification_register_detailed_changed_cb(
686                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
687                 void *user_data);
688 int notification_register_detailed_changed_cb_for_uid(
689                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
690                 void *user_data, uid_t uid);
691
692 /**
693  * @internal
694  * @brief Unregisters a callback for all notification events.
695  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
696  * @privlevel public
697  * @privilege %http://tizen.org/privilege/notification
698  * @param[in] changed_cb The callback function
699  * @return #NOTIFICATION_ERROR_NONE on success,
700  *         otherwise any other value on failure
701  * @retval #NOTIFICATION_ERROR_NONE         Success
702  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
703  * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
704  * @see notification_register_detailed_changed_cb()
705  * @par Sample code:
706  * @code
707 #include <notification.h>
708 ...
709 {
710         noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
711         if(noti_err != NOTIFICATION_ERROR_NONE) {
712                 return;
713         }
714 }
715  * @endcode
716  */
717 int notification_unregister_detailed_changed_cb(
718                 void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
719                 void *user_data);
720
721 /**
722  * @brief This function translate localized texts
723  * @param[in] noti The notification handle that is created by notification_create()
724  * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
725  * @see notification_create()
726  */
727 int notification_translate_localized_text(notification_h noti);
728 int notification_set_uid(notification_h noti, uid_t uid);
729 int notification_get_uid(notification_h noti, uid_t *uid);
730 int notification_post_for_uid(notification_h noti, uid_t uid);
731 int notification_update_for_uid(notification_h noti, uid_t uid);
732 int notification_delete_for_uid(notification_h noti, uid_t uid);
733 int notification_delete_all_for_uid(notification_type_e type, uid_t uid);
734 notification_h notification_load_by_tag_for_uid(const char *tag, uid_t uid);
735
736 /**
737  * @}
738  */
739 #ifdef __cplusplus
740 }
741 #endif
742 #endif
743