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>, Youngsub Ko <ys4610.ko@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.h
33 * @brief This file contains the notification list APIs
37 * @addtogroup NOTIFICATION_LIST
42 * @breief Notification list handle
44 typedef struct _notification_list *notification_list_h;
47 * @brief This function get head pointer of the notification list.
50 * @param[in] list notification list handle
51 * @return notification list handle if success, NULL if failure.
52 * @retval notification list handle(#notification_list_h) - success
53 * @retval NULL - failure
56 * @see #notification_list_h
59 #include <notification.h>
62 notification_list_h noti_list = NULL;
63 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
65 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
66 if(noti_err != NOTIFICATION_ERROR_NONE) {
70 noti_list = notification_list_get_head(noti_list);
74 notification_list_h notification_list_get_head(notification_list_h list);
77 * @brief This function get tail pointer of the notification list.
80 * @param[in] list notification list handle
81 * @return notification list handle if success, NULL if failure.
82 * @retval notification list handle(#notification_list_h) - success
83 * @retval NULL - failure
86 * @see #notification_list_h
89 #include <notification.h>
92 notification_list_h noti_list = NULL;
93 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
95 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
96 if(noti_err != NOTIFICATION_ERROR_NONE) {
100 noti_list = notification_list_get_tail(noti_list);
104 notification_list_h notification_list_get_tail(notification_list_h list);
107 * @brief This function get previous pointer of the current notification list.
110 * @param[in] list notification list handle
111 * @return notification list handle if success, NULL if failure.
112 * @retval notification list handle(#notification_list_h) - success
113 * @retval NULL - failure
116 * @see #notification_list_h
119 #include <notification.h>
122 notification_list_h noti_list = NULL;
123 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
125 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
126 if(noti_err != NOTIFICATION_ERROR_NONE) {
130 noti_list = notification_list_get_prev(noti_list);
134 notification_list_h notification_list_get_prev(notification_list_h list);
137 * @brief This function get next pointer of the current notification list.
140 * @param[in] list notification list handle
141 * @return notification list handle if success, NULL if failure.
142 * @retval notification list handle(#notification_list_h) - success
143 * @retval NULL - failure
146 * @see #notification_list_h
149 #include <notification.h>
152 notification_list_h noti_list = NULL;
153 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
155 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
156 if(noti_err != NOTIFICATION_ERROR_NONE) {
160 noti_list = notification_list_get_next(noti_list);
164 notification_list_h notification_list_get_next(notification_list_h list);
167 * @brief This function get notification handle that list has.
170 * @param[in] list notification list handle
171 * @return notification handle if success, NULL if failure.
172 * @retval notification handle(#notification_h) - success
173 * @retval NULL - failure
176 * @see #notification_list_h
177 * @see #notification_h
180 #include <notification.h>
183 notification_h noti = NULL;
184 notification_list_h noti_list = NULL;
185 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
187 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
188 if(noti_err != NOTIFICATION_ERROR_NONE) {
192 noti = notification_list_get_data(noti_list);
196 notification_h notification_list_get_data(notification_list_h list);
199 * @brief This function append notification data in notification list.
202 * @param[in] list notification list handle
203 * @param[in] noti notification handle
204 * @return notification handle if success, NULL if failure.
205 * @retval notification handle(#notification_h) - success
206 * @retval NULL - failure
209 * @see #notification_list_h
210 * @see #notification_h
213 #include <notification.h>
216 notification_h noti = NULL;
217 notification_list_h noti_list = NULL;
218 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
220 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
225 noti_list = notification_list_append(noti_list, noti);
229 notification_list_h notification_list_append(notification_list_h list,
230 notification_h noti);
233 * @brief This function remove notification data from notification list.
236 * @param[in] list notification list handle
237 * @param[in] noti notification handle
238 * @return notification handle if success, NULL if failure.
239 * @retval notification handle(#notification_h) - success
240 * @retval NULL - failure
243 * @see #notification_list_h
244 * @see #notification_h
247 #include <notification.h>
250 notification_h noti = NULL;
251 notification_list_h noti_list = NULL;
252 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
256 noti_list = notification_list_remove(noti_list, noti);
260 notification_list_h notification_list_remove(notification_list_h list,
261 notification_h noti);
270 #endif /* __NOTIFICATION_LIST_H__ */