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 Gets the head pointer of the notification list.
51 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
52 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
53 * @param[in] list Notification list handle
54 * @return Notification list handle on success, NULL on failure
55 * @retval #notification_list_h Success
56 * @retval NULL Failure
57 * @exception #NOTIFICATION_ERROR_NONE Success
58 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
59 * @see #notification_list_h
62 #include <notification.h>
65 notification_list_h noti_list = NULL;
66 int noti_err = NOTIFICATION_ERROR_NONE;
68 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
69 if(noti_err != NOTIFICATION_ERROR_NONE) {
73 noti_list = notification_list_get_head(noti_list);
77 notification_list_h notification_list_get_head(notification_list_h list);
81 * @brief Gets the tail pointer to the notification list.
82 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
83 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
84 * @param[in] list Notification list handle
85 * @return Notification list handle on success, NULL on failure
86 * @retval #notification_list_h Success
87 * @retval NULL Failure
88 * @exception #NOTIFICATION_ERROR_NONE Success
89 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
90 * @see #notification_list_h
93 #include <notification.h>
96 notification_list_h noti_list = NULL;
97 int noti_err = NOTIFICATION_ERROR_NONE;
99 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
100 if(noti_err != NOTIFICATION_ERROR_NONE) {
104 noti_list = notification_list_get_tail(noti_list);
108 notification_list_h notification_list_get_tail(notification_list_h list);
112 * @brief Gets the previous pointer of the current notification list.
113 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
114 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
115 * @param[in] list Notification list handle
116 * @return Notification list handle on success, NULL on failure
117 * @retval #notification_list_h Success
118 * @retval NULL Failure
119 * @exception #NOTIFICATION_ERROR_NONE Success
120 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
121 * @see #notification_list_h
124 #include <notification.h>
127 notification_list_h noti_list = NULL;
128 int noti_err = NOTIFICATION_ERROR_NONE;
130 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
131 if(noti_err != NOTIFICATION_ERROR_NONE) {
135 noti_list = notification_list_get_prev(noti_list);
139 notification_list_h notification_list_get_prev(notification_list_h list);
143 * @brief Gets the next pointer of the current notification list.
144 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
145 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
146 * @param[in] list Notification list handle
147 * @return Notification list handle on success, NULL on failure
148 * @retval #notification_list_h Success
149 * @retval NULL Failure
150 * @exception #NOTIFICATION_ERROR_NONE Success
151 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
152 * @see #notification_list_h
155 #include <notification.h>
158 notification_list_h noti_list = NULL;
159 int noti_err = NOTIFICATION_ERROR_NONE;
161 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
162 if(noti_err != NOTIFICATION_ERROR_NONE) {
166 noti_list = notification_list_get_next(noti_list);
170 notification_list_h notification_list_get_next(notification_list_h list);
174 * @brief Gets the notification handle that the list has.
175 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
176 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
177 * @param[in] list Notification list handle
178 * @return Notification handle on success, NULL on failure
179 * @retval #notification_h Success
180 * @retval NULL Failure
181 * @exception #NOTIFICATION_ERROR_NONE Success
182 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
183 * @see #notification_list_h
184 * @see #notification_h
187 #include <notification.h>
190 notification_h noti = NULL;
191 notification_list_h noti_list = NULL;
192 int noti_err = NOTIFICATION_ERROR_NONE;
194 noti_err = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, ¬i_list);
195 if(noti_err != NOTIFICATION_ERROR_NONE) {
199 noti = notification_list_get_data(noti_list);
203 notification_h notification_list_get_data(notification_list_h list);
207 * @brief Appends notification data to the notification list.
208 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
209 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
210 * @param[in] list Notification list handle
211 * @param[in] noti Notification handle
212 * @return Notification handle on success, NULL on failure
213 * @retval #notification_h Success
214 * @retval NULL Failure
215 * @exception #NOTIFICATION_ERROR_NONE Success
216 * @exception #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
217 * @exception #NOTIFICATION_ERROR_OUT_OF_MEMORY Out of memory
218 * @see #notification_list_h
219 * @see #notification_h
222 #include <notification.h>
225 notification_h noti = NULL;
226 notification_list_h noti_list = NULL;
227 int noti_err = NOTIFICATION_ERROR_NONE;
229 noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
234 noti_list = notification_list_append(noti_list, noti);
238 notification_list_h notification_list_append(notification_list_h list,
239 notification_h noti);
243 * @brief Removes notification data from the notification list.
244 * @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
245 * @remarks The specific error code can be obtained using the get_last_result() method. Error codes are described in Exception section.
246 * @param[in] list The notification list handle
247 * @param[in] noti The notification handle
248 * @return Notification handle on success,
249 * otherwise @c NULL on failure
250 * @retval #notification_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
255 * @see #notification_h
258 #include <notification.h>
261 notification_h noti = NULL;
262 notification_list_h noti_list = NULL;
263 int noti_err = NOTIFICATION_ERROR_NONE;
267 noti_list = notification_list_remove(noti_list, noti);
271 notification_list_h notification_list_remove(notification_list_h list,
272 notification_h noti);
281 #endif /* __NOTIFICATION_LIST_H__ */