2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef __TIZEN_SOCIAL_CALENDAR_TYPES_H__
18 #define __TIZEN_SOCIAL_CALENDAR_TYPES_H__
22 #include <calendar_errors.h>
30 #define API __attribute__ ((visibility("default")))
33 #define _CALENDAR_HANDLE(A) typedef struct __##A* A;
35 #define _CALENDAR_BEGIN_VIEW() \
38 #define _CALENDAR_PROPERTY_INT(property_id_name) unsigned int property_id_name;
39 #define _CALENDAR_PROPERTY_STR(property_id_name) unsigned int property_id_name;
40 #define _CALENDAR_PROPERTY_DOUBLE(property_id_name) unsigned int property_id_name;
41 #define _CALENDAR_PROPERTY_LLI(property_id_name) unsigned int property_id_name;
42 #define _CALENDAR_PROPERTY_CALTIME(property_id_name) unsigned int property_id_name;
43 #define _CALENDAR_PROPERTY_CHILD_MULTIPLE(property_id_name) unsigned int property_id_name;
44 #define _CALENDAR_END_VIEW(name) } name##_property_ids; \
45 extern API const name##_property_ids name;
47 #define _CALENDAR_BEGIN_READ_ONLY_VIEW() \
50 #define _CALENDAR_PROPERTY_PROJECTION_INT(property_id_name) unsigned int property_id_name;
51 #define _CALENDAR_PROPERTY_PROJECTION_STR(property_id_name) unsigned int property_id_name;
52 #define _CALENDAR_PROPERTY_PROJECTION_DOUBLE(property_id_name) unsigned int property_id_name;
53 #define _CALENDAR_PROPERTY_PROJECTION_LLI(property_id_name) unsigned int property_id_name;
54 #define _CALENDAR_PROPERTY_PROJECTION_CALTIME(property_id_name) unsigned int property_id_name;
55 #define _CALENDAR_PROPERTY_FILTER_INT(property_id_name) unsigned int property_id_name;
56 #define _CALENDAR_PROPERTY_FILTER_STR(property_id_name) unsigned int property_id_name;
57 #define _CALENDAR_PROPERTY_FILTER_DOUBLE(property_id_name) unsigned int property_id_name;
58 #define _CALENDAR_PROPERTY_FILTER_LLI(property_id_name) unsigned int property_id_name;
59 #define _CALENDAR_PROPERTY_FILTER_CALTIME(property_id_name) unsigned int property_id_name;
60 #define _CALENDAR_END_READ_ONLY_VIEW(name) } name##_property_ids; \
61 extern API const name##_property_ids name;
63 _CALENDAR_HANDLE( calendar_record_h )
64 _CALENDAR_HANDLE( calendar_filter_h )
65 _CALENDAR_HANDLE( calendar_list_h )
66 _CALENDAR_HANDLE( calendar_query_h )
69 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_DATABASE_MODULE
74 * @brief The callback function to get the result of batch operation.
76 * @param[in] error Error code for batch operation
77 * @param[in] user_data The user data passed from the batch operation
79 * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
81 * @pre calendar_db_update_records() will invoke this callback.
83 * @see calendar_db_update_records()
85 typedef void (*calendar_db_result_cb)( int error, void *user_data);
88 * @brief The callback function to get the result of batch operation.
90 * @param[in] error Error code for batch operation
91 * @param[in] record_id_array The record IDs for batch operation
92 * @param[in] count The number of record ID array
93 * @param[in] user_data The user data passed from the batch operation
95 * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
97 * @pre calendar_db_insert_records() will invoke this callback.
99 * @see calendar_db_insert_records()
101 typedef void (*calendar_db_insert_result_cb)( int error, int* record_id_array, int count, void *user_data);
104 * @brief Called when designated view changes.
106 * @param[in] view_uri The view uri
107 * @param[in] user_data The user data passed from the callback registration function
109 * @see calendar_db_add_changed_cb()
111 typedef void (*calendar_db_changed_cb)(const char* view_uri, void* user_data);
114 * @brief Called when alarm is alerted.
116 * @param[in] b bundle
117 * @param[in] user_data The user data passed from the callback registration function
119 * @see calendar_db_add_changed_cb()
121 typedef void (*calendar_reminder_cb)(bundle *b, void* user_data);
124 * @brief Definition for calendar connect flag
126 #define CALENDAR_CONNECT_FLAG_NONE 0x00000000
127 #define CALENDAR_CONNECT_FLAG_RETRY 0x00000001
130 * @brief Definition for default event calendar book database ID
132 #define DEFAULT_EVENT_CALENDAR_BOOK_ID 1
135 * @brief Definition for default to-do calendar book database ID
137 #define DEFAULT_TODO_CALENDAR_BOOK_ID 2
140 * @brief Definition for default birthday calendar book database ID
142 #define DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID 3
145 * @brief Definition for no due date of a to-do
147 #define CALENDAR_TODO_NO_DUE_DATE INT64_MAX
150 * @brief Definition for no start date of a to-do
152 #define CALENDAR_TODO_NO_START_DATE (-INT64_MAX)
155 * @brief Definition for no until of a record
157 #define CALENDAR_RECORD_NO_UNTIL INT64_MAX
160 * @brief Definition for no coordinate(latitude/longitude) of a record
162 #define CALENDAR_RECORD_NO_COORDINATE 1000
169 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_FILTER_MODULE
174 * @brief Definition for all calendar book
176 #define CALENDAR_BOOK_FILTER_ALL -1
179 * @brief Enumerations of filter match type for string
183 CALENDAR_MATCH_EXACTLY, /**< . */
184 CALENDAR_MATCH_FULLSTRING, /**< . */
185 CALENDAR_MATCH_CONTAINS, /**< . */
186 CALENDAR_MATCH_STARTSWITH, /**< . */
187 CALENDAR_MATCH_ENDSWITH, /**< . */
188 CALENDAR_MATCH_EXISTS /**< . */
189 } calendar_match_str_flag_e;
192 * @brief Enumerations of filter match type for integer
196 CALENDAR_MATCH_EQUAL, /**< . */
197 CALENDAR_MATCH_GREATER_THAN, /**< . */
198 CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, /**< . */
199 CALENDAR_MATCH_LESS_THAN, /**< . */
200 CALENDAR_MATCH_LESS_THAN_OR_EQUAL, /**< . */
201 CALENDAR_MATCH_NOT_EQUAL, /**< this flag can yield poor performance */
202 CALENDAR_MATCH_NONE /**< . */
203 } calendar_match_int_flag_e;
206 * @brief Enumerations of filter combine type
209 CALENDAR_FILTER_OPERATOR_AND, /**< . */
210 CALENDAR_FILTER_OPERATOR_OR /**< . */
211 } calendar_filter_operator_e;
218 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_RECORD_MODULE
223 * @brief Enumerations for calendar book type. "OR"ing supported.
227 CALENDAR_BOOK_TYPE_NONE = 0, /**< Calendar book type default */
228 CALENDAR_BOOK_TYPE_EVENT = 1<<0, /**< Event calendar book type */
229 CALENDAR_BOOK_TYPE_TODO = 1<<1 /**< To-do Calendar book type */
230 } calendar_book_type_e;
233 * @brief Enumerations for calendar sensitivity type.
237 CALENDAR_SENSITIVITY_PUBLIC = 0, /**< Public Sensitivity */
238 CALENDAR_SENSITIVITY_PRIVATE, /**< Private Sensitivity */
239 CALENDAR_SENSITIVITY_CONFIDENTIAL /**< Confidential Sensitivity */
240 } calendar_sensitivity_e;
243 * @brief Enumerations of attendee status.
247 CALENDAR_ATTENDEE_STATUS_PENDING = 0, /**< Pending status */
248 CALENDAR_ATTENDEE_STATUS_ACCEPTED, /**< Accepted status */
249 CALENDAR_ATTENDEE_STATUS_DECLINED, /**< Decliend status */
250 CALENDAR_ATTENDEE_STATUS_TENTATIVE, /**< Tentative status */
251 CALENDAR_ATTENDEE_STATUS_DELEGATED, /**< Delegated status */
252 CALENDAR_ATTENDEE_STATUS_COMPLETED, /**< Completed status */
253 CALENDAR_ATTENDEE_STATUS_IN_PROCESS, /**< In process status */
254 CALENDAR_ATTENDEE_STATUS_MAX,
255 }calendar_attendee_status_e;
258 * @brief Enumerations of attendee role.
262 CALENDAR_ATTENDEE_ROLE_REQ_PARTICIPANT = 0, /**< Participation is required */
263 CALENDAR_ATTENDEE_ROLE_OPT_PARTICIPANT, /**< Accepted status */
264 CALENDAR_ATTENDEE_ROLE_NON_PARTICIPANT, /**< Non-Participant */
265 CALENDAR_ATTENDEE_ROLE_CHAIR, /**< Chairperson */
266 CALENDAR_ATTENDEE_ROLE_MAX,
267 }calendar_attendee_role_e;
270 * @brief Alarm time unit type of event such as minutes, hours, days, or etc.
274 CALENDAR_ALARM_NONE = -1, /**< No reminder set */
275 CALENDAR_ALARM_TIME_UNIT_SPECIFIC = 1, /**< specific in sec */
276 CALENDAR_ALARM_TIME_UNIT_MINUTE = 60, /**< Alarm time unit in minutes */
277 CALENDAR_ALARM_TIME_UNIT_HOUR = 3600, /**< Alarm time unit in hours */
278 CALENDAR_ALARM_TIME_UNIT_DAY = 86400, /**< Alarm time unit in days */
279 CALENDAR_ALARM_TIME_UNIT_WEEK = 604800, /**< Alarm time unit in weeks */
280 CALENDAR_ALARM_TIME_UNIT_MONTH = 18144000, /**< Alarm time unit in months */
281 } calendar_alarm_time_unit_type_e;
284 * @brief Enumerations of the frequency of event recurrence.
288 CALENDAR_RECURRENCE_NONE, /**< No recurrence event */
289 CALENDAR_RECURRENCE_DAILY, /**< A Event occurs every day */
290 CALENDAR_RECURRENCE_WEEKLY, /**< A Event occurs on the same day of every week \n According to week flag, the event will recurrence every days of week */
291 CALENDAR_RECURRENCE_MONTHLY, /**< A Event occurs on the same day of every month */
292 CALENDAR_RECURRENCE_YEARLY /**< A Event occurs on the same day of every year */
293 } calendar_recurrence_frequency_e;
296 * @brief Enumerations of status for event.
300 CALENDAR_EVENT_STATUS_NONE = 0x01, /**< None */
301 CALENDAR_EVENT_STATUS_TENTATIVE = 0x02, /**< The event is tentative */
302 CALENDAR_EVENT_STATUS_CONFIRMED = 0x04, /**< The event is confirmed */
303 CALENDAR_EVENT_STATUS_CANCELLED = 0x08 /**< The event is cancelled */
304 }calendar_event_status_e;
307 * @brief Enumerations of busy status for event.
311 CALENDAR_EVENT_BUSY_STATUS_FREE = 0, /**< The free status */
312 CALENDAR_EVENT_BUSY_STATUS_BUSY, /**< The busy status */
313 CALENDAR_EVENT_BUSY_STATUS_UNAVAILABLE, /**< The unavailable status */
314 CALENDAR_EVENT_BUSY_STATUS_TENTATIVE /**< The tentative status */
315 }calendar_event_busy_status_e;
317 * @brief Calendar event item priority
321 CALENDAR_EVENT_PRIORITY_LOW = 0, /**< Low priority */
322 CALENDAR_EVENT_PRIORITY_NORMAL, /**< Normal priority */
323 CALENDAR_EVENT_PRIORITY_HIGH /**< High priority */
324 } calendar_event_priority_e;
327 * @brief Calendar to-do item priority
331 CALENDAR_TODO_PRIORITY_NONE = 0x01, /**< Priority none */
332 CALENDAR_TODO_PRIORITY_LOW = 0x08, /**< Low priority */
333 CALENDAR_TODO_PRIORITY_NORMAL = 0x04, /**< Normal priority */
334 CALENDAR_TODO_PRIORITY_HIGH = 0x02, /**< High priority */
335 } calendar_todo_priority_e;
338 * @brief Enumerations of status for to-do.
342 CALENDAR_TODO_STATUS_NONE = 0x0100, /**< None */
343 CALENDAR_TODO_STATUS_NEEDS_ACTION = 0x0200, /**< Needs action status */
344 CALENDAR_TODO_STATUS_COMPLETED = 0x0400, /**< Completed status */
345 CALENDAR_TODO_STATUS_IN_PROCESS = 0x0800, /**< Work in process status */
346 CALENDAR_TODO_STATUS_CANCELED = 0x1000 /**< Canceled status */
347 } calendar_todo_status_e;
351 CALENDAR_TIME_UTIME = 0, /**< . */
352 CALENDAR_TIME_LOCALTIME, /**< . */
353 } calendar_time_type_e;
357 CALENDAR_RANGE_UNTIL, /**< . */
358 CALENDAR_RANGE_COUNT, /**< . */
359 CALENDAR_RANGE_NONE, /**< . */
360 } calendar_range_type_e;
364 CALENDAR_SYSTEM_NONE, /**< . */
365 CALENDAR_SYSTEM_GREGORIAN, /**< . */
366 CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR, /**< . */
367 } calendar_system_type_e;
371 CALENDAR_MEETING_STATUS_NOTMEETING = 0, /**< . */
372 CALENDAR_MEETING_STATUS_MEETING, /**< . */
373 CALENDAR_MEETING_STATUS_RECEIVED, /**< . */
374 CALENDAR_MEETING_STATUS_CANCELED, /**< . */
375 } calendar_meeting_status_e;
378 * @brief Enumerations of weekday of month(Same value as UCalendarDaysOfWeek in ICU).
389 }calendar_days_of_week_e;
392 #define CALENDAR_EVENT_MODIFIED_STATUS_INSERTED 0
393 #define CALENDAR_EVENT_MODIFIED_STATUS_UPDATED 1
394 #define CALENDAR_EVENT_MODIFIED_STATUS_DELETED 2
396 * @brief Enumerations of modified status for record.
400 CALENDAR_RECORD_MODIFIED_STATUS_INSERTED = 0, /**< The record is inserted */
401 CALENDAR_RECORD_MODIFIED_STATUS_UPDATED, /**< The record is updated */
402 CALENDAR_RECORD_MODIFIED_STATUS_DELETED /**< The record is deleted */
403 }calendar_record_modified_status_e;
406 * @brief The structure of time
410 calendar_time_type_e type;
422 * @brief Enumerations of type for record.
426 CALENDAR_RECORD_TYPE_NONE = 0, /**< . */
427 CALENDAR_RECORD_TYPE_CALENDAR_BOOK, /**< . */
428 CALENDAR_RECORD_TYPE_EVENT, /**< . */
429 CALENDAR_RECORD_TYPE_TODO, /**< . */
430 }calendar_record_type_e;
440 #endif //__TIZEN_SOCIAL_CALENDAR_TYPES_H__