Adjust coding rule in header descriptions
[platform/core/api/notification.git] / include / notification_setting.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_SETTING_H__
18 #define __NOTIFICATION_SETTING_H__
19
20 #include <stdbool.h>
21 #include <sys/types.h>
22
23 #include "notification.h"
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 typedef struct notification_setting *notification_setting_h;
30
31 int notification_setting_get_setting(notification_setting_h *setting);
32
33 /*
34  * @internal
35  * @brief Gets value which whether information on the notification view is visible.
36  * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
37  * @param[in] setting   The notification setting handle
38  * @param[out] value    The visibility_class value
39  * @return #NOTIFICATION_ERROR_NONE on success,
40  *         otherwise any other value on failure
41  * @retval #NOTIFICATION_ERROR_NONE         Success
42  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
43  * @par sample code:
44  * @code
45 #include <notification_setting_internal.h>
46 ...
47 {
48         int noti_err = 0;
49         bool value;
50         notification_setting_h setting = NULL;
51
52         ...
53
54         noti_err = notifiacation_setting_get_visibility_class(setting, &value);
55         if (noti_err != NOTIFICATION_ERROR_NONE) {
56                 return;
57         }
58
59         notification_setting_free_notification(setting);
60
61         return 0;
62
63 }
64  * @endcode
65  */
66 int notification_setting_get_visibility_class(notification_setting_h setting, int *value);
67
68 /*
69  * @internal
70  * @brief Sets value which whether information on the notification view is visible.
71  * @details After notification_setting_update_setting() call, the visibility_class value is not updated.
72  * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
73  * @param[in] setting   The notification setting handle
74  * @param[in] value     The visibility_class value
75  * @return #NOTIFICATION_ERROR_NONE on success,
76  *         otherwise any other value on failure
77  * @retval #NOTIFICATION_ERROR_NONE         Success
78  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
79  * @par sample code:
80  * @code
81 #include <notification_setting_internal.h>
82 ...
83 {
84         int noti_err = 0;
85         bool value;
86         notification_setting_h setting = NULL;
87
88         ...
89
90         value = true;   // or false
91
92         noti_err = notifiacation_setting_set_visibility_class(setting, value);
93         if (noti_err != NOTIFICATION_ERROR_NONE) {
94                 return;
95         }
96
97         notification_setting_free_notification(setting);
98
99         return 0;
100
101 }
102  * @endcode
103  */
104 int notification_setting_set_visibility_class(notification_setting_h setting, int value);
105
106 /*
107  * @internal
108  * @brief Update the notification setting handle.
109  * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
110  * @privlevel public
111  * @privilege %http://tizen.org/privilege/notification
112  * @param[in] setting   The notification setting handle
113  * @return #NOTIFICATION_ERROR_NONE on success,
114  *         otherwise any other value on failure
115  * @retval #NOTIFICATION_ERROR_NONE         Success
116  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
117  * @par sample code:
118  * @code
119 #include <notification_setting_internal.h>
120 ...
121 {
122         int noti_err = 0;
123         bool value;
124         notification_setting_h setting = NULL;
125
126         ...
127
128         noti_err = notifiacation_setting_update_setting(setting);
129         if (noti_err != NOTIFICATION_ERROR_NONE) {
130                 return;
131         }
132
133         notification_setting_free_notification(setting);
134
135         return 0;
136
137 }
138  * @endcode
139  */
140 int notification_setting_update_setting(notification_setting_h setting);
141
142 /*
143  * @internal
144  * @brief Frees the internal structure data of a notification setting handle.
145  * @since_tizen @if wearable 2.3.1 @elseif mobile 2.3 @endif
146  * @param[in] setting   The notification setting handle
147  * @return #NOTIFICATION_ERROR_NONE on success,
148  *         otherwise any other value on failure
149  * @retval #NOTIFICATION_ERROR_NONE         Success
150  * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
151  * @par sample code:
152  * @code
153 #include <notification_setting_internal.h>
154 ...
155 {
156         int noti_err = 0;
157         notification_setting_h setting = NULL;
158
159         ...
160
161         noti_err = notifiacation_setting_free_notification(setting);
162         if (noti_err != NOTIFICATION_ERROR_NONE) {
163                 return;
164         }
165
166         return 0;
167
168 }
169  * @endcode
170  */
171 int notification_setting_free_notification(notification_setting_h setting);
172
173 int notification_setting_refresh_setting_table(uid_t uid);
174 int notification_system_setting_init_system_setting_table(uid_t uid);
175
176 #ifdef __cplusplus
177 }
178 #endif
179 #endif /* __NOTIFICATION_SETTING_H__ */
180