2 * Copyright (c) 2000 - 2016 Samsung Electronics Co., Ltd. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __NOTIFICATION_LIST_H__
18 #define __NOTIFICATION_LIST_H__
20 #include <notification.h>
27 * @file notification_list.h
28 * @brief This file contains the notification list APIs.
33 * @addtogroup NOTIFICATION_LIST
38 * @brief Notification list handle.
39 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
41 typedef struct _notification_list *notification_list_h;
45 * @brief Returns the notification list handle.
46 * @details If count is equal to @c -1, all notifications are returned.
47 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
49 * @privilege %http://tizen.org/privilege/notification
50 * @param[in] type The notification type
51 * @param[in] count The returned notification data number
52 * @param[out] #NOTIFICATION_ERROR_NONE on success, other value on failure
53 * @return #NOTIFICATION_ERROR_NONE on success,
54 * otherwise any other value on failure
55 * @retval #NOTIFICATION_ERROR_NONE Success
56 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
57 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
58 * @see #notification_list_h
61 #include <notification.h>
64 notification_list_h noti_list = NULL;
65 int noti_err = NOTIFICATION_ERROR_NONE;
67 noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
68 if(noti_err != NOTIFICATION_ERROR_NONE) {
74 int notification_get_list(notification_type_e type,
76 notification_list_h *list);
78 int notification_get_list_for_uid(notification_type_e type,
80 notification_list_h *list, uid_t uid);
83 * @brief Returns the notification detail list handle of grouping data.
84 * @details If count is equal to c -1, all notifications are returned.
85 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
87 * @privilege %http://tizen.org/privilege/notification
88 * @param[in] pkgname The caller application package name
89 * @param[in] group_id The group ID
90 * @param[in] priv_id The private ID
91 * @param[in] count The returned notification data number
92 * @param[out] list The notification list handle
93 * @return #NOTIFICATION_ERROR_NONE if success,
94 * other value if failure
95 * @retval #NOTIFICATION_ERROR_NONE Success
96 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
97 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
98 * @see #notification_list_h
101 #include <notification.h>
104 notification_list_h noti_list = NULL;
105 int noti_err = NOTIFICATION_ERROR_NONE;
107 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
108 if(noti_err != NOTIFICATION_ERROR_NONE) {
114 int notification_get_detail_list(const char *pkgname,
118 notification_list_h *list);
120 int notification_get_detail_list_for_uid(const char *pkgname,
124 notification_list_h *list,
128 * @brief Frees a notification list.
129 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
131 * @privilege %http://tizen.org/privilege/notification
132 * @param[in] list The notification list handle
133 * @return #NOTIFICATION_ERROR_NONE on success,
134 * otherwise any other value on failure
135 * @retval #NOTIFICATION_ERROR_NONE Success
136 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
137 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
138 * @pre notification_get_grouping_list() or notification_get_detail_list().
139 * @see #notification_list_h
142 #include <notification.h>
145 notification_list_h noti_list = NULL;
146 int noti_err = NOTIFICATION_ERROR_NONE;
150 noti_err = notification_free_list(noti_list);
151 if(noti_err != NOTIFICATION_ERROR_NONE) {
157 int notification_free_list(notification_list_h list);
161 * @brief Gets the head pointer of the notification list.
162 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
163 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
164 * @param[in] list Notification list handle
165 * @return Notification list handle on success, NULL on failure
166 * @retval #notification_list_h Success
167 * @retval NULL Failure
168 * @exception #NOTIFICATION_ERROR_NONE Success
169 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
170 * @see #notification_list_h
173 #include <notification.h>
176 notification_list_h noti_list = NULL;
177 int noti_err = NOTIFICATION_ERROR_NONE;
179 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
180 if(noti_err != NOTIFICATION_ERROR_NONE) {
184 noti_list = notification_list_get_head(noti_list);
188 notification_list_h notification_list_get_head(notification_list_h list);
191 * @brief Gets the tail pointer to the notification list.
192 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
193 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
194 * @param[in] list Notification list handle
195 * @return Notification list handle on success, NULL on failure
196 * @retval #notification_list_h Success
197 * @retval NULL Failure
198 * @exception #NOTIFICATION_ERROR_NONE Success
199 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
200 * @see #notification_list_h
203 #include <notification.h>
206 notification_list_h noti_list = NULL;
207 int noti_err = NOTIFICATION_ERROR_NONE;
209 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
210 if(noti_err != NOTIFICATION_ERROR_NONE) {
214 noti_list = notification_list_get_tail(noti_list);
218 notification_list_h notification_list_get_tail(notification_list_h list);
221 * @brief Gets the previous pointer of the current notification list.
222 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
223 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
224 * @param[in] list Notification list handle
225 * @return Notification list handle on success, NULL on failure
226 * @retval #notification_list_h Success
227 * @retval NULL Failure
228 * @exception #NOTIFICATION_ERROR_NONE Success
229 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
230 * @see #notification_list_h
233 #include <notification.h>
236 notification_list_h noti_list = NULL;
237 int noti_err = NOTIFICATION_ERROR_NONE;
239 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
240 if(noti_err != NOTIFICATION_ERROR_NONE) {
244 noti_list = notification_list_get_prev(noti_list);
248 notification_list_h notification_list_get_prev(notification_list_h list);
251 * @brief Gets the next pointer of the current notification list.
252 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
253 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
254 * @param[in] list Notification list handle
255 * @return Notification list handle on success, NULL on failure
256 * @retval #notification_list_h Success
257 * @retval NULL Failure
258 * @exception #NOTIFICATION_ERROR_NONE Success
259 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
260 * @see #notification_list_h
263 #include <notification.h>
266 notification_list_h noti_list = NULL;
267 int noti_err = NOTIFICATION_ERROR_NONE;
269 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
270 if(noti_err != NOTIFICATION_ERROR_NONE) {
274 noti_list = notification_list_get_next(noti_list);
278 notification_list_h notification_list_get_next(notification_list_h list);
281 * @brief Gets the notification handle that the list has.
282 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
283 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
284 * @param[in] list Notification list handle
285 * @return Notification handle on success, NULL on failure
286 * @retval #notification_h Success
287 * @retval NULL Failure
288 * @exception #NOTIFICATION_ERROR_NONE Success
289 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
290 * @see #notification_list_h
291 * @see #notification_h
294 #include <notification.h>
297 notification_h noti = NULL;
298 notification_list_h noti_list = NULL;
299 int noti_err = NOTIFICATION_ERROR_NONE;
301 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
302 if(noti_err != NOTIFICATION_ERROR_NONE) {
306 noti = notification_list_get_data(noti_list);
310 notification_h notification_list_get_data(notification_list_h list);
313 * @brief Appends notification data to the notification list.
314 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
315 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
316 * @param[in] list Notification list handle
317 * @param[in] noti Notification handle
318 * @return Notification handle on success, NULL on failure
319 * @retval #notification_h Success
320 * @retval NULL Failure
321 * @exception #NOTIFICATION_ERROR_NONE Success
322 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
323 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
324 * @see #notification_list_h
325 * @see #notification_h
328 #include <notification.h>
331 notification_h noti = NULL;
332 notification_list_h noti_list = NULL;
333 int noti_err = NOTIFICATION_ERROR_NONE;
335 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
340 noti_list = notification_list_append(noti_list, noti);
344 notification_list_h notification_list_append(notification_list_h list,
345 notification_h noti);
348 * @brief Removes notification data from the notification list.
349 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
350 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
351 * @param[in] list The notification list handle
352 * @param[in] noti The notification handle
353 * @return Notification handle on success,
354 * otherwise @c NULL on failure
355 * @retval #notification_h Success
356 * @retval NULL Failure
357 * @exception #NOTIFICATION_ERROR_NONE Success
358 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
359 * @see #notification_list_h
360 * @see #notification_h
363 #include <notification.h>
366 notification_h noti = NULL;
367 notification_list_h noti_list = NULL;
368 int noti_err = NOTIFICATION_ERROR_NONE;
372 noti_list = notification_list_remove(noti_list, noti);
376 notification_list_h notification_list_remove(notification_list_h list,
377 notification_h noti);
386 #endif /* __NOTIFICATION_LIST_H__ */