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 * @ingroup NOTIFICATION_LIBRARY
33 * @defgroup NOTIFICATION_LIST notification list
34 * @brief Notification List API
38 * @addtogroup NOTIFICATION_LIST
43 * @breief Notification list handle
45 typedef struct _notification_list *notification_list_h;
48 * @brief This function get head pointer of the notification list.
51 * @param[in] list notification list handle
52 * @return notification list handle if success, NULL if failure.
53 * @retval notification list handle(#notification_list_h) - success
54 * @retval NULL - failure
57 * @see #notification_list_h
60 #include <notification.h>
63 notification_list_h noti_list = NULL;
64 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
66 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
67 if(noti_err != NOTIFICATION_ERROR_NONE) {
71 noti_list = notification_list_get_head(noti_list);
75 notification_list_h notification_list_get_head(notification_list_h list);
78 * @brief This function get tail pointer of the notification list.
81 * @param[in] list notification list handle
82 * @return notification list handle if success, NULL if failure.
83 * @retval notification list handle(#notification_list_h) - success
84 * @retval NULL - failure
87 * @see #notification_list_h
90 #include <notification.h>
93 notification_list_h noti_list = NULL;
94 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
96 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
97 if(noti_err != NOTIFICATION_ERROR_NONE) {
101 noti_list = notification_list_get_tail(noti_list);
105 notification_list_h notification_list_get_tail(notification_list_h list);
108 * @brief This function get previous pointer of the current notification list.
111 * @param[in] list notification list handle
112 * @return notification list handle if success, NULL if failure.
113 * @retval notification list handle(#notification_list_h) - success
114 * @retval NULL - failure
117 * @see #notification_list_h
120 #include <notification.h>
123 notification_list_h noti_list = NULL;
124 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
126 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
127 if(noti_err != NOTIFICATION_ERROR_NONE) {
131 noti_list = notification_list_get_prev(noti_list);
135 notification_list_h notification_list_get_prev(notification_list_h list);
138 * @brief This function get next pointer of the current notification list.
141 * @param[in] list notification list handle
142 * @return notification list handle if success, NULL if failure.
143 * @retval notification list handle(#notification_list_h) - success
144 * @retval NULL - failure
147 * @see #notification_list_h
150 #include <notification.h>
153 notification_list_h noti_list = NULL;
154 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
156 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
157 if(noti_err != NOTIFICATION_ERROR_NONE) {
161 noti_list = notification_list_get_next(noti_list);
165 notification_list_h notification_list_get_next(notification_list_h list);
168 * @brief This function get notification handle that list has.
171 * @param[in] list notification list handle
172 * @return notification handle if success, NULL if failure.
173 * @retval notification handle(#notification_h) - success
174 * @retval NULL - failure
177 * @see #notification_list_h
178 * @see #notification_h
181 #include <notification.h>
184 notification_h noti = NULL;
185 notification_list_h noti_list = NULL;
186 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
188 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
189 if(noti_err != NOTIFICATION_ERROR_NONE) {
193 noti = notification_list_get_data(noti_list);
197 notification_h notification_list_get_data(notification_list_h list);
200 * @brief This function append notification data in notification list.
203 * @param[in] list notification list handle
204 * @param[in] noti notification handle
205 * @return notification handle if success, NULL if failure.
206 * @retval notification handle(#notification_h) - success
207 * @retval NULL - failure
210 * @see #notification_list_h
211 * @see #notification_h
214 #include <notification.h>
217 notification_h noti = NULL;
218 notification_list_h noti_list = NULL;
219 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
221 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
226 noti_list = notification_list_append(noti_list, noti);
230 notification_list_h notification_list_append(notification_list_h list,
231 notification_h noti);
234 * @brief This function remove notification data from notification list.
237 * @param[in] list notification list handle
238 * @param[in] noti notification handle
239 * @return notification handle if success, NULL if failure.
240 * @retval notification handle(#notification_h) - success
241 * @retval NULL - failure
244 * @see #notification_list_h
245 * @see #notification_h
248 #include <notification.h>
251 notification_h noti = NULL;
252 notification_list_h noti_list = NULL;
253 notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
257 noti_list = notification_list_remove(noti_list, noti);
261 notification_list_h notification_list_remove(notification_list_h list,
262 notification_h noti);
271 #endif /* __NOTIFICATION_LIST_H__ */