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>
29 #define API __attribute__ ((visibility("default")))
32 #define _CALENDAR_HANDLE(A) typedef struct __##A* A;
34 #define _CALENDAR_BEGIN_VIEW() \
37 #define _CALENDAR_PROPERTY_INT(property_id_name) unsigned int property_id_name;
38 #define _CALENDAR_PROPERTY_STR(property_id_name) unsigned int property_id_name;
39 #define _CALENDAR_PROPERTY_DOUBLE(property_id_name) unsigned int property_id_name;
40 #define _CALENDAR_PROPERTY_LLI(property_id_name) unsigned int property_id_name;
41 #define _CALENDAR_PROPERTY_CALTIME(property_id_name) unsigned int property_id_name;
42 #define _CALENDAR_PROPERTY_CHILD_MULTIPLE(property_id_name) unsigned int property_id_name;
43 #define _CALENDAR_END_VIEW(name) } name##_property_ids; \
44 extern API const name##_property_ids name;
46 #define _CALENDAR_BEGIN_READ_ONLY_VIEW() \
49 #define _CALENDAR_PROPERTY_PROJECTION_INT(property_id_name) unsigned int property_id_name;
50 #define _CALENDAR_PROPERTY_PROJECTION_STR(property_id_name) unsigned int property_id_name;
51 #define _CALENDAR_PROPERTY_PROJECTION_DOUBLE(property_id_name) unsigned int property_id_name;
52 #define _CALENDAR_PROPERTY_PROJECTION_LLI(property_id_name) unsigned int property_id_name;
53 #define _CALENDAR_PROPERTY_PROJECTION_CALTIME(property_id_name) unsigned int property_id_name;
54 #define _CALENDAR_PROPERTY_FILTER_INT(property_id_name) unsigned int property_id_name;
55 #define _CALENDAR_PROPERTY_FILTER_STR(property_id_name) unsigned int property_id_name;
56 #define _CALENDAR_PROPERTY_FILTER_DOUBLE(property_id_name) unsigned int property_id_name;
57 #define _CALENDAR_PROPERTY_FILTER_LLI(property_id_name) unsigned int property_id_name;
58 #define _CALENDAR_PROPERTY_FILTER_CALTIME(property_id_name) unsigned int property_id_name;
59 #define _CALENDAR_END_READ_ONLY_VIEW(name) } name##_property_ids; \
60 extern API const name##_property_ids name;
62 _CALENDAR_HANDLE( calendar_record_h )
63 _CALENDAR_HANDLE( calendar_filter_h )
64 _CALENDAR_HANDLE( calendar_list_h )
65 _CALENDAR_HANDLE( calendar_query_h )
68 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_DATABASE_MODULE
73 * @brief The callback function to get the result of batch operation.
75 * @param[in] error Error code for batch operation
76 * @param[in] user_data The user data passed from the batch operation
78 * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
80 * @pre calendar_db_update_records() will invoke this callback.
82 * @see calendar_db_update_records()
84 typedef void (*calendar_db_result_cb)( int error, void *user_data);
87 * @brief The callback function to get the result of batch operation.
89 * @param[in] error Error code for batch operation
90 * @param[in] record_id_array The record IDs for batch operation
91 * @param[in] count The number of record ID array
92 * @param[in] user_data The user data passed from the batch operation
94 * @return @c true to continue with the next iteration of the loop or @c false to break out of the loop.
96 * @pre calendar_db_insert_records() will invoke this callback.
98 * @see calendar_db_insert_records()
100 typedef void (*calendar_db_insert_result_cb)( int error, int* record_id_array, int count, void *user_data);
103 * @brief Called when designated view changes.
105 * @param[in] view_uri The view uri
106 * @param[in] user_data The user data passed from the callback registration function
108 * @see calendar_db_add_changed_cb()
110 typedef void (*calendar_db_changed_cb)(const char* view_uri, void* user_data);
113 * @brief Called when alarm is alerted.
115 * @param[in] consta char *param
116 * @param[in] user_data The user data passed from the callback registration function
118 * @see calendar_db_add_changed_cb()
120 typedef void (*calendar_reminder_cb)(const char *param, void* user_data);
123 * @brief Definition for calendar connect flag
125 #define CALENDAR_CONNECT_FLAG_NONE 0x00000000
126 #define CALENDAR_CONNECT_FLAG_RETRY 0x00000001
129 * @brief Definition for default event calendar book database ID
131 #define DEFAULT_EVENT_CALENDAR_BOOK_ID 1
134 * @brief Definition for default to-do calendar book database ID
136 #define DEFAULT_TODO_CALENDAR_BOOK_ID 2
139 * @brief Definition for default birthday calendar book database ID
141 #define DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID 3
144 * @brief Definition for no due date of a to-do
146 #define CALENDAR_TODO_NO_DUE_DATE INT64_MAX
149 * @brief Definition for no start date of a to-do
151 #define CALENDAR_TODO_NO_START_DATE (-INT64_MAX)
154 * @brief Definition for no until of a record
156 #define CALENDAR_RECORD_NO_UNTIL INT64_MAX
159 * @brief Definition for no coordinate(latitude/longitude) of a record
161 #define CALENDAR_RECORD_NO_COORDINATE 1000
168 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_FILTER_MODULE
173 * @brief Definition for all calendar book
175 #define CALENDAR_BOOK_FILTER_ALL -1
178 * @brief Enumerations of filter match type for string
182 CALENDAR_MATCH_EXACTLY, /**< . */
183 CALENDAR_MATCH_FULLSTRING, /**< . */
184 CALENDAR_MATCH_CONTAINS, /**< . */
185 CALENDAR_MATCH_STARTSWITH, /**< . */
186 CALENDAR_MATCH_ENDSWITH, /**< . */
187 CALENDAR_MATCH_EXISTS /**< . */
188 } calendar_match_str_flag_e;
191 * @brief Enumerations of filter match type for integer
195 CALENDAR_MATCH_EQUAL, /**< . */
196 CALENDAR_MATCH_GREATER_THAN, /**< . */
197 CALENDAR_MATCH_GREATER_THAN_OR_EQUAL, /**< . */
198 CALENDAR_MATCH_LESS_THAN, /**< . */
199 CALENDAR_MATCH_LESS_THAN_OR_EQUAL, /**< . */
200 CALENDAR_MATCH_NOT_EQUAL, /**< this flag can yield poor performance */
201 CALENDAR_MATCH_NONE /**< . */
202 } calendar_match_int_flag_e;
205 * @brief Enumerations of filter combine type
208 CALENDAR_FILTER_OPERATOR_AND, /**< . */
209 CALENDAR_FILTER_OPERATOR_OR /**< . */
210 } calendar_filter_operator_e;
217 * @addtogroup CAPI_SOCIAL_CALENDAR_SVC_RECORD_MODULE
222 * @brief Enumerations for calendar book type. "OR"ing supported.
226 CALENDAR_BOOK_TYPE_NONE = 0, /**< Calendar book type default */
227 CALENDAR_BOOK_TYPE_EVENT = 1<<0, /**< Event calendar book type */
228 CALENDAR_BOOK_TYPE_TODO = 1<<1 /**< To-do Calendar book type */
229 } calendar_book_type_e;
232 * @brief Enumerations for calendar sensitivity type.
236 CALENDAR_SENSITIVITY_PUBLIC = 0, /**< Public Sensitivity */
237 CALENDAR_SENSITIVITY_PRIVATE, /**< Private Sensitivity */
238 CALENDAR_SENSITIVITY_CONFIDENTIAL /**< Confidential Sensitivity */
239 } calendar_sensitivity_e;
242 * @brief Enumerations of attendee status.
246 CALENDAR_ATTENDEE_STATUS_PENDING = 0, /**< Pending status */
247 CALENDAR_ATTENDEE_STATUS_ACCEPTED, /**< Accepted status */
248 CALENDAR_ATTENDEE_STATUS_DECLINED, /**< Decliend status */
249 CALENDAR_ATTENDEE_STATUS_TENTATIVE, /**< Tentative status */
250 CALENDAR_ATTENDEE_STATUS_DELEGATED, /**< Delegated status */
251 CALENDAR_ATTENDEE_STATUS_COMPLETED, /**< Completed status */
252 CALENDAR_ATTENDEE_STATUS_IN_PROCESS, /**< In process status */
253 CALENDAR_ATTENDEE_STATUS_MAX,
254 }calendar_attendee_status_e;
257 * @brief Enumerations of attendee role.
261 CALENDAR_ATTENDEE_ROLE_REQ_PARTICIPANT = 0, /**< Participation is required */
262 CALENDAR_ATTENDEE_ROLE_OPT_PARTICIPANT, /**< Accepted status */
263 CALENDAR_ATTENDEE_ROLE_NON_PARTICIPANT, /**< Non-Participant */
264 CALENDAR_ATTENDEE_ROLE_CHAIR, /**< Chairperson */
265 CALENDAR_ATTENDEE_ROLE_MAX,
266 }calendar_attendee_role_e;
269 * @brief Alarm time unit type of event such as minutes, hours, days, or etc.
273 CALENDAR_ALARM_NONE = -1, /**< No reminder set */
274 CALENDAR_ALARM_TIME_UNIT_SPECIFIC = 1, /**< specific in sec */
275 CALENDAR_ALARM_TIME_UNIT_MINUTE = 60, /**< Alarm time unit in minutes */
276 CALENDAR_ALARM_TIME_UNIT_HOUR = 3600, /**< Alarm time unit in hours */
277 CALENDAR_ALARM_TIME_UNIT_DAY = 86400, /**< Alarm time unit in days */
278 CALENDAR_ALARM_TIME_UNIT_WEEK = 604800, /**< Alarm time unit in weeks */
279 CALENDAR_ALARM_TIME_UNIT_MONTH = 18144000, /**< Alarm time unit in months */
280 } calendar_alarm_time_unit_type_e;
283 * @brief Enumerations of the frequency of event recurrence.
287 CALENDAR_RECURRENCE_NONE, /**< No recurrence event */
288 CALENDAR_RECURRENCE_DAILY, /**< A Event occurs every day */
289 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 */
290 CALENDAR_RECURRENCE_MONTHLY, /**< A Event occurs on the same day of every month */
291 CALENDAR_RECURRENCE_YEARLY /**< A Event occurs on the same day of every year */
292 } calendar_recurrence_frequency_e;
295 * @brief Enumerations of status for event.
299 CALENDAR_EVENT_STATUS_NONE = 0x01, /**< None */
300 CALENDAR_EVENT_STATUS_TENTATIVE = 0x02, /**< The event is tentative */
301 CALENDAR_EVENT_STATUS_CONFIRMED = 0x04, /**< The event is confirmed */
302 CALENDAR_EVENT_STATUS_CANCELLED = 0x08 /**< The event is cancelled */
303 }calendar_event_status_e;
306 * @brief Enumerations of busy status for event.
310 CALENDAR_EVENT_BUSY_STATUS_FREE = 0, /**< The free status */
311 CALENDAR_EVENT_BUSY_STATUS_BUSY, /**< The busy status */
312 CALENDAR_EVENT_BUSY_STATUS_UNAVAILABLE, /**< The unavailable status */
313 CALENDAR_EVENT_BUSY_STATUS_TENTATIVE /**< The tentative status */
314 }calendar_event_busy_status_e;
316 * @brief Calendar event item priority
320 CALENDAR_EVENT_PRIORITY_LOW = 0, /**< Low priority */
321 CALENDAR_EVENT_PRIORITY_NORMAL, /**< Normal priority */
322 CALENDAR_EVENT_PRIORITY_HIGH /**< High priority */
323 } calendar_event_priority_e;
326 * @brief Calendar to-do item priority
330 CALENDAR_TODO_PRIORITY_NONE = 0x01, /**< Priority none */
331 CALENDAR_TODO_PRIORITY_LOW = 0x08, /**< Low priority */
332 CALENDAR_TODO_PRIORITY_NORMAL = 0x04, /**< Normal priority */
333 CALENDAR_TODO_PRIORITY_HIGH = 0x02, /**< High priority */
334 } calendar_todo_priority_e;
337 * @brief Enumerations of status for to-do.
341 CALENDAR_TODO_STATUS_NONE = 0x0100, /**< None */
342 CALENDAR_TODO_STATUS_NEEDS_ACTION = 0x0200, /**< Needs action status */
343 CALENDAR_TODO_STATUS_COMPLETED = 0x0400, /**< Completed status */
344 CALENDAR_TODO_STATUS_IN_PROCESS = 0x0800, /**< Work in process status */
345 CALENDAR_TODO_STATUS_CANCELED = 0x1000 /**< Canceled status */
346 } calendar_todo_status_e;
350 CALENDAR_TIME_UTIME = 0, /**< . */
351 CALENDAR_TIME_LOCALTIME, /**< . */
352 } calendar_time_type_e;
356 CALENDAR_RANGE_UNTIL, /**< . */
357 CALENDAR_RANGE_COUNT, /**< . */
358 CALENDAR_RANGE_NONE, /**< . */
359 } calendar_range_type_e;
363 CALENDAR_SYSTEM_NONE, /**< . */
364 CALENDAR_SYSTEM_GREGORIAN, /**< . */
365 CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR, /**< . */
366 } calendar_system_type_e;
370 CALENDAR_MEETING_STATUS_NOTMEETING = 0, /**< . */
371 CALENDAR_MEETING_STATUS_MEETING, /**< . */
372 CALENDAR_MEETING_STATUS_RECEIVED, /**< . */
373 CALENDAR_MEETING_STATUS_CANCELED, /**< . */
374 } calendar_meeting_status_e;
377 * @brief Enumerations of weekday of month(Same value as UCalendarDaysOfWeek in ICU).
388 }calendar_days_of_week_e;
391 #define CALENDAR_EVENT_MODIFIED_STATUS_INSERTED 0
392 #define CALENDAR_EVENT_MODIFIED_STATUS_UPDATED 1
393 #define CALENDAR_EVENT_MODIFIED_STATUS_DELETED 2
395 * @brief Enumerations of modified status for record.
399 CALENDAR_RECORD_MODIFIED_STATUS_INSERTED = 0, /**< The record is inserted */
400 CALENDAR_RECORD_MODIFIED_STATUS_UPDATED, /**< The record is updated */
401 CALENDAR_RECORD_MODIFIED_STATUS_DELETED /**< The record is deleted */
402 }calendar_record_modified_status_e;
405 * @brief The structure of time
409 calendar_time_type_e type;
421 * @brief Enumerations of type for record.
425 CALENDAR_RECORD_TYPE_NONE = 0, /**< . */
426 CALENDAR_RECORD_TYPE_CALENDAR_BOOK, /**< . */
427 CALENDAR_RECORD_TYPE_EVENT, /**< . */
428 CALENDAR_RECORD_TYPE_TODO, /**< . */
429 }calendar_record_type_e;
439 #endif //__TIZEN_SOCIAL_CALENDAR_TYPES_H__