4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #ifndef __NOTIFICATION_LIST_H__
23 #define __NOTIFICATION_LIST_H__
25 #include <notification.h>
32 * @file notification_list.h
33 * @brief This file contains the notification list APIs.
38 * @addtogroup NOTIFICATION_LIST
43 * @brief Notification list handle.
44 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
46 typedef struct _notification_list *notification_list_h;
50 * @brief Returns the notification list handle.
51 * @details If count is equal to @c -1, all notifications are returned.
54 * @privilege %http://tizen.org/privilege/notification
55 * @param[in] type The notification type
56 * @param[in] count The returned notification data number
57 * @param[out] #NOTIFICATION_ERROR_NONE on success, other value on failure
58 * @return #NOTIFICATION_ERROR_NONE on success,
59 * otherwise any other value on failure
60 * @retval #NOTIFICATION_ERROR_NONE Success
61 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
62 * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
63 * @see #notification_list_h
66 #include <notification.h>
69 notification_list_h noti_list = NULL;
70 int noti_err = NOTIFICATION_ERROR_NONE;
72 noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
73 if(noti_err != NOTIFICATION_ERROR_NONE) {
79 int notification_get_list(notification_type_e type,
81 notification_list_h * list);
84 * @brief Returns the notification detail list handle of grouping data.
85 * @details If count is equal to c -1, all notifications are returned.
88 * @privilege %http://tizen.org/privilege/notification
89 * @param[in] pkgname The caller application package name
90 * @param[in] group_id The group ID
91 * @param[in] priv_id The private ID
92 * @param[in] count The returned notification data number
93 * @param[out] list The notification list handle
94 * @return #NOTIFICATION_ERROR_NONE if success,
95 * other value if failure
96 * @retval #NOTIFICATION_ERROR_NONE Success
97 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
98 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
99 * @see #notification_list_h
102 #include <notification.h>
105 notification_list_h noti_list = NULL;
106 int noti_err = NOTIFICATION_ERROR_NONE;
108 noti_err = notification_get_detail_list(pkgname, group_id, priv_id, -1, ¬i_list);
109 if(noti_err != NOTIFICATION_ERROR_NONE) {
115 int notification_get_detail_list(const char *pkgname,
119 notification_list_h *list);
122 * @brief Frees a notification list.
125 * @privilege %http://tizen.org/privilege/notification
126 * @param[in] list The notification list handle
127 * @return #NOTIFICATION_ERROR_NONE on success,
128 * otherwise any other value on failure
129 * @retval #NOTIFICATION_ERROR_NONE Success
130 * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
131 * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
132 * @pre notification_get_grouping_list() or notification_get_detail_list().
133 * @see #notification_list_h
136 #include <notification.h>
139 notification_list_h noti_list = NULL;
140 int noti_err = NOTIFICATION_ERROR_NONE;
144 noti_err = notification_free_list(noti_list);
145 if(noti_err != NOTIFICATION_ERROR_NONE) {
151 int notification_free_list(notification_list_h list);
155 * @brief Gets the head pointer of the notification list.
156 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
157 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
158 * @param[in] list Notification list handle
159 * @return Notification list handle on success, NULL on failure
160 * @retval #notification_list_h Success
161 * @retval NULL Failure
162 * @exception #NOTIFICATION_ERROR_NONE Success
163 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
164 * @see #notification_list_h
167 #include <notification.h>
170 notification_list_h noti_list = NULL;
171 int noti_err = NOTIFICATION_ERROR_NONE;
173 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
174 if(noti_err != NOTIFICATION_ERROR_NONE) {
178 noti_list = notification_list_get_head(noti_list);
182 notification_list_h notification_list_get_head(notification_list_h list);
185 * @brief Gets the tail pointer to the notification list.
187 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
188 * @param[in] list Notification list handle
189 * @return Notification list handle on success, NULL on failure
190 * @retval #notification_list_h Success
191 * @retval NULL Failure
192 * @exception #NOTIFICATION_ERROR_NONE Success
193 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
194 * @see #notification_list_h
197 #include <notification.h>
200 notification_list_h noti_list = NULL;
201 int noti_err = NOTIFICATION_ERROR_NONE;
203 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
204 if(noti_err != NOTIFICATION_ERROR_NONE) {
208 noti_list = notification_list_get_tail(noti_list);
212 notification_list_h notification_list_get_tail(notification_list_h list);
215 * @brief Gets the previous pointer of the current notification list.
216 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
217 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
218 * @param[in] list Notification list handle
219 * @return Notification list handle on success, NULL on failure
220 * @retval #notification_list_h Success
221 * @retval NULL Failure
222 * @exception #NOTIFICATION_ERROR_NONE Success
223 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
224 * @see #notification_list_h
227 #include <notification.h>
230 notification_list_h noti_list = NULL;
231 int noti_err = NOTIFICATION_ERROR_NONE;
233 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
234 if(noti_err != NOTIFICATION_ERROR_NONE) {
238 noti_list = notification_list_get_prev(noti_list);
242 notification_list_h notification_list_get_prev(notification_list_h list);
245 * @brief Gets the next pointer of the current notification list.
246 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
247 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
248 * @param[in] list Notification list handle
249 * @return Notification list handle on success, NULL on failure
250 * @retval #notification_list_h Success
251 * @retval NULL Failure
252 * @exception #NOTIFICATION_ERROR_NONE Success
253 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
254 * @see #notification_list_h
257 #include <notification.h>
260 notification_list_h noti_list = NULL;
261 int noti_err = NOTIFICATION_ERROR_NONE;
263 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
264 if(noti_err != NOTIFICATION_ERROR_NONE) {
268 noti_list = notification_list_get_next(noti_list);
272 notification_list_h notification_list_get_next(notification_list_h list);
275 * @brief Gets the notification handle that the list has.
276 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
277 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
278 * @param[in] list Notification list handle
279 * @return Notification handle on success, NULL on failure
280 * @retval #notification_h Success
281 * @retval NULL Failure
282 * @exception #NOTIFICATION_ERROR_NONE Success
283 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
284 * @see #notification_list_h
285 * @see #notification_h
288 #include <notification.h>
291 notification_h noti = NULL;
292 notification_list_h noti_list = NULL;
293 int noti_err = NOTIFICATION_ERROR_NONE;
295 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
296 if(noti_err != NOTIFICATION_ERROR_NONE) {
300 noti = notification_list_get_data(noti_list);
304 notification_h notification_list_get_data(notification_list_h list);
307 * @brief Appends notification data to the notification list.
308 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
309 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
310 * @param[in] list Notification list handle
311 * @param[in] noti Notification handle
312 * @return Notification handle on success, NULL on failure
313 * @retval #notification_h Success
314 * @retval NULL Failure
315 * @exception #NOTIFICATION_ERROR_NONE Success
316 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
317 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
318 * @see #notification_list_h
319 * @see #notification_h
322 #include <notification.h>
325 notification_h noti = NULL;
326 notification_list_h noti_list = NULL;
327 int noti_err = NOTIFICATION_ERROR_NONE;
329 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
334 noti_list = notification_list_append(noti_list, noti);
338 notification_list_h notification_list_append(notification_list_h list,
339 notification_h noti);
342 * @brief Removes notification data from the notification list.
343 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
344 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
345 * @param[in] list The notification list handle
346 * @param[in] noti The notification handle
347 * @return Notification handle on success,
348 * otherwise @c NULL on failure
349 * @retval #notification_h Success
350 * @retval NULL Failure
351 * @exception #NOTIFICATION_ERROR_NONE Success
352 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
353 * @see #notification_list_h
354 * @see #notification_h
357 #include <notification.h>
360 notification_h noti = NULL;
361 notification_list_h noti_list = NULL;
362 int noti_err = NOTIFICATION_ERROR_NONE;
366 noti_list = notification_list_remove(noti_list, noti);
370 notification_list_h notification_list_remove(notification_list_h list,
371 notification_h noti);
380 #endif /* __NOTIFICATION_LIST_H__ */