Git init
[platform/core/api/notification.git] / include / notification_list.h
1 /*
2  *  libnotification
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  *
20  */
21
22 #ifndef __NOTIFICATION_LIST_H__
23 #define __NOTIFICATION_LIST_H__
24
25 #include <notification.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 /**
32  * @ingroup NOTIFICATION_LIBRARY
33  * @defgroup NOTIFICATION_LIST notification list
34  * @brief Notification List API
35  */
36
37 /**
38  * @addtogroup NOTIFICATION_LIST
39  * @{
40  */
41
42 /**
43  * @breief Notification list handle
44  */
45 typedef struct _notification_list *notification_list_h;
46
47 /**
48  * @brief This function get head pointer of the notification list.
49  * @details 
50  * @remarks
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
55  * @pre 
56  * @post
57  * @see #notification_list_h
58  * @par Sample code:
59  * @code
60 #include <notification.h>
61 ...
62 {
63         notification_list_h noti_list = NULL;
64         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
65
66         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
67         if(noti_err != NOTIFICATION_ERROR_NONE) {
68                 return;
69         }
70
71         noti_list = notification_list_get_head(noti_list);
72 }
73  * @endcode
74  */
75 notification_list_h notification_list_get_head(notification_list_h list);
76
77 /**
78  * @brief This function get tail pointer of the notification list.
79  * @details 
80  * @remarks
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
85  * @pre 
86  * @post
87  * @see #notification_list_h
88  * @par Sample code:
89  * @code
90 #include <notification.h>
91 ...
92 {
93         notification_list_h noti_list = NULL;
94         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
95
96         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
97         if(noti_err != NOTIFICATION_ERROR_NONE) {
98                 return;
99         }
100
101         noti_list = notification_list_get_tail(noti_list);
102 }
103  * @endcode
104  */
105 notification_list_h notification_list_get_tail(notification_list_h list);
106
107 /**
108  * @brief This function get previous pointer of the current notification list.
109  * @details 
110  * @remarks
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
115  * @pre 
116  * @post
117  * @see #notification_list_h
118  * @par Sample code:
119  * @code
120 #include <notification.h>
121 ...
122 {
123         notification_list_h noti_list = NULL;
124         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
125
126         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
127         if(noti_err != NOTIFICATION_ERROR_NONE) {
128                 return;
129         }
130
131         noti_list = notification_list_get_prev(noti_list);
132 }
133  * @endcode
134  */
135 notification_list_h notification_list_get_prev(notification_list_h list);
136
137 /**
138  * @brief This function get next pointer of the current notification list.
139  * @details 
140  * @remarks
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
145  * @pre 
146  * @post
147  * @see #notification_list_h
148  * @par Sample code:
149  * @code
150 #include <notification.h>
151 ...
152 {
153         notification_list_h noti_list = NULL;
154         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
155
156         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
157         if(noti_err != NOTIFICATION_ERROR_NONE) {
158                 return;
159         }
160
161         noti_list = notification_list_get_next(noti_list);
162 }
163  * @endcode
164  */
165 notification_list_h notification_list_get_next(notification_list_h list);
166
167 /**
168  * @brief This function get notification handle that list has.
169  * @details 
170  * @remarks
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
175  * @pre 
176  * @post
177  * @see #notification_list_h
178  * @see #notification_h
179  * @par Sample code:
180  * @code
181 #include <notification.h>
182 ...
183 {
184         notification_h noti = NULL;
185         notification_list_h noti_list = NULL;
186         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
187
188         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
189         if(noti_err != NOTIFICATION_ERROR_NONE) {
190                 return;
191         }
192
193         noti = notification_list_get_data(noti_list);
194 }
195  * @endcode
196  */
197 notification_h notification_list_get_data(notification_list_h list);
198
199 /**
200  * @brief This function append notification data in notification list.
201  * @details 
202  * @remarks
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
208  * @pre 
209  * @post
210  * @see #notification_list_h
211  * @see #notification_h
212  * @par Sample code:
213  * @code
214 #include <notification.h>
215 ...
216 {
217         notification_h noti = NULL;
218         notification_list_h noti_list = NULL;
219         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
220
221         noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
222         if(noti == NULL) {
223                 return;
224         }
225
226         noti_list = notification_list_append(noti_list, noti);
227 }
228  * @endcode
229  */
230 notification_list_h notification_list_append(notification_list_h list,
231                                              notification_h noti);
232
233 /**
234  * @brief This function remove notification data from notification list.
235  * @details 
236  * @remarks
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
242  * @pre 
243  * @post
244  * @see #notification_list_h
245  * @see #notification_h
246  * @par Sample code:
247  * @code
248 #include <notification.h>
249 ...
250 {
251         notification_h noti = NULL;
252         notification_list_h noti_list = NULL;
253         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
254         
255         ...
256         
257         noti_list = notification_list_remove(noti_list, noti);
258 }
259  * @endcode
260  */
261 notification_list_h notification_list_remove(notification_list_h list,
262                                              notification_h noti);
263
264 /** 
265  * @}
266  */
267
268 #ifdef __cplusplus
269 }
270 #endif
271 #endif                          /* __NOTIFICATION_LIST_H__ */