4 * Copyright (c) 2012 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
20 #ifndef __TIZEN_SOCIAL_CALENDAR_LIST_H__
21 #define __TIZEN_SOCIAL_CALENDAR_LIST_H__
23 #include <calendar_types.h>
30 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_LIST_MODULE
35 * @brief Creates a calendar list handle.
37 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
39 * @remarks You must release @a calendar_list using calendar_list_destroy().
41 * @param[out] out_list The calendar list handle
43 * @return @c 0 on success,
44 * otherwise a negative error value
45 * @retval #CALENDAR_ERROR_NONE Successful
46 * @retval #CALENDAR_ERROR_OUT_OF_MEMORY Out of memory
47 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
49 * @see calendar_list_destroy()
51 int calendar_list_create(calendar_list_h* out_list);
54 * @brief Destroys a calendar list handle and releases all its resources.
56 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
58 * @param[in] list The calendar list handle
59 * @param[in] delete_record If @c true, child records are destroyed automatically,
62 * @return @c 0 on success,
63 * otherwise a negative error value
64 * @retval #CALENDAR_ERROR_NONE Successful
65 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
67 * @see calendar_list_create()
69 int calendar_list_destroy(calendar_list_h list, bool delete_record);
73 * @brief Retrieves the number of calendar entities in a calendar list.
75 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
77 * @param[in] list The calendar list handle
78 * @param[out] count The count of the calendar entity
80 * @return @c 0 on success,
81 * otherwise a negative error value
82 * @retval #CALENDAR_ERROR_NONE Successful
83 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
85 * @see calendar_list_add()
87 int calendar_list_get_count(calendar_list_h list, int *count);
90 * @brief Adds a record to the calendar list.
92 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
94 * @param[in] list The calendar list handle
95 * @param[in] record The record handle
97 * @return @c 0 on success,
98 * otherwise a negative error value
99 * @retval #CALENDAR_ERROR_NONE Successful
100 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
102 * @see calendar_list_remove()
104 int calendar_list_add(calendar_list_h list, calendar_record_h record);
107 * @brief Removes a record from the calendar list.
108 * @details If the record is the current record, then the current record is changed to the next record.\n
109 * If the record is the last record then the current record will be @c NULL.
111 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
113 * @param[in] list The calendar list handle
114 * @param[in] record The record handle
116 * @return @c 0 on success,
117 * otherwise a negative error value
118 * @retval #CALENDAR_ERROR_NONE Successful
119 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
120 * @retval #CALENDAR_ERROR_NO_DATA Requested data does not exist
122 * @see calendar_list_add()
124 int calendar_list_remove(calendar_list_h list, calendar_record_h record);
127 * @brief Retrieves a record from the calendar list.
128 * @details The default current record is the first record.
130 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
132 * @remarks You MUST NOT destroy the @a record handle.
133 * It is destroyed automatically when the @a list is destroyed.
135 * @param[in] list The calendar list handle
136 * @param[out] record The record handle
138 * @return @c 0 on success,
139 * otherwise a negative error value
140 * @retval #CALENDAR_ERROR_NONE Successful
141 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
142 * @retval #CALENDAR_ERROR_NO_DATA Requested data does not exist
144 int calendar_list_get_current_record_p(calendar_list_h list, calendar_record_h* record);
147 * @brief Moves a calendar list to the previous position.
149 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
151 * @param[in] list The calendar list handle
153 * @return @c 0 on success,
154 * otherwise a negative error value
155 * @retval #CALENDAR_ERROR_NONE Successful
156 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
157 * @retval #CALENDAR_ERROR_NO_DATA Requested data does not exist
159 * @see calendar_list_next()
161 int calendar_list_prev(calendar_list_h list);
164 * @brief Moves a calendar list to the next position.
166 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
168 * @param[in] list The calendar list handle
170 * @return @c 0 on success,
171 * otherwise a negative error value
172 * @retval #CALENDAR_ERROR_NONE Successful
173 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
174 * @retval #CALENDAR_ERROR_NO_DATA Requested data does not exist
176 * @see calendar_list_prev()
178 int calendar_list_next(calendar_list_h list);
181 * @brief Moves a calendar list to the first position.
183 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
185 * @param[in] list The calendar list handle
187 * @return @c 0 on success,
188 * otherwise a negative error value
189 * @retval #CALENDAR_ERROR_NONE Successful
190 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
192 * @see calendar_list_last()
194 int calendar_list_first(calendar_list_h list);
197 * @brief Moves a calendar list to the last position.
199 * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
201 * @param[in] list The calendar list handle
203 * @return @c 0 on success,
204 * otherwise a negative error value
205 * @retval #CALENDAR_ERROR_NONE Successful
206 * @retval #CALENDAR_ERROR_INVALID_PARAMETER Invalid parameter
208 * @see calendar_list_first()
210 int calendar_list_last(calendar_list_h list);
220 #endif /* __TIZEN_SOCIAL_CALENDAR_LIST_H__ */