Fix typo
[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>, Youngsub Ko <ys4610.ko@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  * @file notification.h
33  * @brief This file contains the notification list APIs
34  */
35
36 /**
37  * @addtogroup NOTIFICATION_LIST
38  * @{
39  */
40
41 /**
42  * @breief Notification list handle
43  */
44 typedef struct _notification_list *notification_list_h;
45
46 /**
47  * @brief This function get head pointer of the notification list.
48  * @details 
49  * @remarks
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
54  * @pre 
55  * @post
56  * @see #notification_list_h
57  * @par Sample code:
58  * @code
59 #include <notification.h>
60 ...
61 {
62         notification_list_h noti_list = NULL;
63         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
64
65         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
66         if(noti_err != NOTIFICATION_ERROR_NONE) {
67                 return;
68         }
69
70         noti_list = notification_list_get_head(noti_list);
71 }
72  * @endcode
73  */
74 notification_list_h notification_list_get_head(notification_list_h list);
75
76 /**
77  * @brief This function get tail pointer of the notification list.
78  * @details 
79  * @remarks
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
84  * @pre 
85  * @post
86  * @see #notification_list_h
87  * @par Sample code:
88  * @code
89 #include <notification.h>
90 ...
91 {
92         notification_list_h noti_list = NULL;
93         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
94
95         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
96         if(noti_err != NOTIFICATION_ERROR_NONE) {
97                 return;
98         }
99
100         noti_list = notification_list_get_tail(noti_list);
101 }
102  * @endcode
103  */
104 notification_list_h notification_list_get_tail(notification_list_h list);
105
106 /**
107  * @brief This function get previous pointer of the current notification list.
108  * @details 
109  * @remarks
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
114  * @pre 
115  * @post
116  * @see #notification_list_h
117  * @par Sample code:
118  * @code
119 #include <notification.h>
120 ...
121 {
122         notification_list_h noti_list = NULL;
123         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
124
125         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
126         if(noti_err != NOTIFICATION_ERROR_NONE) {
127                 return;
128         }
129
130         noti_list = notification_list_get_prev(noti_list);
131 }
132  * @endcode
133  */
134 notification_list_h notification_list_get_prev(notification_list_h list);
135
136 /**
137  * @brief This function get next pointer of the current notification list.
138  * @details 
139  * @remarks
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
144  * @pre 
145  * @post
146  * @see #notification_list_h
147  * @par Sample code:
148  * @code
149 #include <notification.h>
150 ...
151 {
152         notification_list_h noti_list = NULL;
153         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
154
155         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
156         if(noti_err != NOTIFICATION_ERROR_NONE) {
157                 return;
158         }
159
160         noti_list = notification_list_get_next(noti_list);
161 }
162  * @endcode
163  */
164 notification_list_h notification_list_get_next(notification_list_h list);
165
166 /**
167  * @brief This function get notification handle that list has.
168  * @details 
169  * @remarks
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
174  * @pre 
175  * @post
176  * @see #notification_list_h
177  * @see #notification_h
178  * @par Sample code:
179  * @code
180 #include <notification.h>
181 ...
182 {
183         notification_h noti = NULL;
184         notification_list_h noti_list = NULL;
185         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
186
187         noti_err  = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, &noti_list);
188         if(noti_err != NOTIFICATION_ERROR_NONE) {
189                 return;
190         }
191
192         noti = notification_list_get_data(noti_list);
193 }
194  * @endcode
195  */
196 notification_h notification_list_get_data(notification_list_h list);
197
198 /**
199  * @brief This function append notification data in notification list.
200  * @details 
201  * @remarks
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
207  * @pre 
208  * @post
209  * @see #notification_list_h
210  * @see #notification_h
211  * @par Sample code:
212  * @code
213 #include <notification.h>
214 ...
215 {
216         notification_h noti = NULL;
217         notification_list_h noti_list = NULL;
218         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
219
220         noti = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
221         if(noti == NULL) {
222                 return;
223         }
224
225         noti_list = notification_list_append(noti_list, noti);
226 }
227  * @endcode
228  */
229 notification_list_h notification_list_append(notification_list_h list,
230                                              notification_h noti);
231
232 /**
233  * @brief This function remove notification data from notification list.
234  * @details 
235  * @remarks
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
241  * @pre 
242  * @post
243  * @see #notification_list_h
244  * @see #notification_h
245  * @par Sample code:
246  * @code
247 #include <notification.h>
248 ...
249 {
250         notification_h noti = NULL;
251         notification_list_h noti_list = NULL;
252         notification_error_e noti_err = NOTIFICATION_ERROR_NONE;
253         
254         ...
255         
256         noti_list = notification_list_remove(noti_list, noti);
257 }
258  * @endcode
259  */
260 notification_list_h notification_list_remove(notification_list_h list,
261                                              notification_h noti);
262
263 /** 
264  * @}
265  */
266
267 #ifdef __cplusplus
268 }
269 #endif
270 #endif                          /* __NOTIFICATION_LIST_H__ */