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);
79 * @brief Returns the notification detail list handle of grouping data.
80 * @details If count is equal to c -1, all notifications are returned.
81 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
83 * @privilege %http://tizen.org/privilege/notification
84 * @param[in] pkgname The caller application package name
85 * @param[in] group_id The group ID
86 * @param[in] priv_id The private ID
87 * @param[in] count The returned notification data number
88 * @param[out] list The notification list handle
89 * @return #NOTIFICATION_ERROR_NONE if success,
90 * other value if failure
91 * @retval #NOTIFICATION_ERROR_NONE Success
92 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
93 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
94 * @see #notification_list_h
97 #include <notification.h>
100 notification_list_h noti_list = NULL;
101 int noti_err = NOTIFICATION_ERROR_NONE;
103 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
104 if(noti_err != NOTIFICATION_ERROR_NONE) {
110 int notification_get_detail_list(const char *pkgname,
114 notification_list_h *list);
117 * @brief Frees a notification list.
118 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
120 * @privilege %http://tizen.org/privilege/notification
121 * @param[in] list The notification list handle
122 * @return #NOTIFICATION_ERROR_NONE on success,
123 * otherwise any other value on failure
124 * @retval #NOTIFICATION_ERROR_NONE Success
125 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
126 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
127 * @pre notification_get_grouping_list() or notification_get_detail_list().
128 * @see #notification_list_h
131 #include <notification.h>
134 notification_list_h noti_list = NULL;
135 int noti_err = NOTIFICATION_ERROR_NONE;
139 noti_err = notification_free_list(noti_list);
140 if(noti_err != NOTIFICATION_ERROR_NONE) {
146 int notification_free_list(notification_list_h list);
150 * @brief Gets the head pointer of the notification list.
151 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
152 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
153 * @param[in] list Notification list handle
154 * @return Notification list handle on success, NULL on failure
155 * @retval #notification_list_h Success
156 * @retval NULL Failure
157 * @exception #NOTIFICATION_ERROR_NONE Success
158 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
159 * @see #notification_list_h
162 #include <notification.h>
165 notification_list_h noti_list = NULL;
166 int noti_err = NOTIFICATION_ERROR_NONE;
168 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
169 if(noti_err != NOTIFICATION_ERROR_NONE) {
173 noti_list = notification_list_get_head(noti_list);
177 notification_list_h notification_list_get_head(notification_list_h list);
180 * @brief Gets the tail pointer to the notification list.
181 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 2.3.1 @endif
182 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
183 * @param[in] list Notification list handle
184 * @return Notification list handle on success, NULL on failure
185 * @retval #notification_list_h Success
186 * @retval NULL Failure
187 * @exception #NOTIFICATION_ERROR_NONE Success
188 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
189 * @see #notification_list_h
192 #include <notification.h>
195 notification_list_h noti_list = NULL;
196 int noti_err = NOTIFICATION_ERROR_NONE;
198 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
199 if(noti_err != NOTIFICATION_ERROR_NONE) {
203 noti_list = notification_list_get_tail(noti_list);
207 notification_list_h notification_list_get_tail(notification_list_h list);
210 * @brief Gets the previous pointer of the current notification list.
211 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
212 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
213 * @param[in] list Notification list handle
214 * @return Notification list handle on success, NULL on failure
215 * @retval #notification_list_h Success
216 * @retval NULL Failure
217 * @exception #NOTIFICATION_ERROR_NONE Success
218 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
219 * @see #notification_list_h
222 #include <notification.h>
225 notification_list_h noti_list = NULL;
226 int noti_err = NOTIFICATION_ERROR_NONE;
228 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
229 if(noti_err != NOTIFICATION_ERROR_NONE) {
233 noti_list = notification_list_get_prev(noti_list);
237 notification_list_h notification_list_get_prev(notification_list_h list);
240 * @brief Gets the next pointer of the current notification list.
241 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
242 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
243 * @param[in] list Notification list handle
244 * @return Notification list handle on success, NULL on failure
245 * @retval #notification_list_h Success
246 * @retval NULL Failure
247 * @exception #NOTIFICATION_ERROR_NONE Success
248 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
249 * @see #notification_list_h
252 #include <notification.h>
255 notification_list_h noti_list = NULL;
256 int noti_err = NOTIFICATION_ERROR_NONE;
258 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
259 if(noti_err != NOTIFICATION_ERROR_NONE) {
263 noti_list = notification_list_get_next(noti_list);
267 notification_list_h notification_list_get_next(notification_list_h list);
270 * @brief Gets the notification handle that the list has.
271 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
272 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
273 * @param[in] list Notification list handle
274 * @return Notification handle on success, NULL on failure
275 * @retval #notification_h Success
276 * @retval NULL Failure
277 * @exception #NOTIFICATION_ERROR_NONE Success
278 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
279 * @see #notification_list_h
280 * @see #notification_h
283 #include <notification.h>
286 notification_h noti = NULL;
287 notification_list_h noti_list = NULL;
288 int noti_err = NOTIFICATION_ERROR_NONE;
290 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
291 if(noti_err != NOTIFICATION_ERROR_NONE) {
295 noti = notification_list_get_data(noti_list);
299 notification_h notification_list_get_data(notification_list_h list);
302 * @brief Appends notification data to the notification list.
303 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
304 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
305 * @param[in] list Notification list handle
306 * @param[in] noti Notification handle
307 * @return Notification handle on success, NULL on failure
308 * @retval #notification_h Success
309 * @retval NULL Failure
310 * @exception #NOTIFICATION_ERROR_NONE Success
311 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
312 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
313 * @see #notification_list_h
314 * @see #notification_h
317 #include <notification.h>
320 notification_h noti = NULL;
321 notification_list_h noti_list = NULL;
322 int noti_err = NOTIFICATION_ERROR_NONE;
324 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
329 noti_list = notification_list_append(noti_list, noti);
333 notification_list_h notification_list_append(notification_list_h list,
334 notification_h noti);
337 * @brief Removes notification data from the notification list.
338 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
339 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
340 * @param[in] list The notification list handle
341 * @param[in] noti The notification handle
342 * @return Notification handle on success,
343 * otherwise @c NULL on failure
344 * @retval #notification_h Success
345 * @retval NULL Failure
346 * @exception #NOTIFICATION_ERROR_NONE Success
347 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
348 * @see #notification_list_h
349 * @see #notification_h
352 #include <notification.h>
355 notification_h noti = NULL;
356 notification_list_h noti_list = NULL;
357 int noti_err = NOTIFICATION_ERROR_NONE;
361 noti_list = notification_list_remove(noti_list, noti);
365 notification_list_h notification_list_remove(notification_list_h list,
366 notification_h noti);
375 #endif /* __NOTIFICATION_LIST_H__ */