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 __CALENDAR_SERVICE_TYPEDEF_H__
21 #define __CALENDAR_SERVICE_TYPEDEF_H__
27 #include "cal_record.h"
28 #include <tzplatform_config.h>
30 #define CAL_STR_SHORT_LEN32 32
31 #define CAL_STR_SHORT_LEN64 64
32 #define CAL_STR_MIDDLE_LEN 1024
33 #define CAL_STR_LONG_LEN 2048
34 #define CAL_STRING_EQUAL 0
36 #define CAL_TZID_GMT "Etc/GMT"
37 #define CAL_SOCK_PATH "/run/user/%d"
38 #define CAL_NOTI_FILE_EVENT tzplatform_mkpath(TZ_USER_DATA, "calendar-svc/.CALENDAR_SVC_EVENT_CHANGED")
39 #define CAL_NOTI_FILE_TODO tzplatform_mkpath(TZ_USER_DATA, "calendar-svc/.CALENDAR_SVC_TODO_CHANGED")
40 #define CAL_NOTI_FILE_BOOK tzplatform_mkpath(TZ_USER_DATA, "calendar-svc/.CALENDAR_SVC_CALENDAR_CHANGED")
41 #define CAL_NOTI_REMINDER_CAHNGED "reminder"
42 #define CAL_FORMAT_LOCAL_DATETIME "%04d-%02d-%02dT%02d:%02d:%02d"
43 #define CAL_DATETIME_FORMAT_YYYYMMDD "%04d%02d%02d"
44 #define CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS "%04d%02d%02dT%02d%02d%02d"
45 #define CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ "%04d%02d%02dT%02d%02d%02dZ"
48 * @enum cal_priority_e
49 * This enumeration defines priority for todo data.
52 CAL_PRIORITY_LOW, /**< priority low */
53 CAL_PRIORITY_MID, /**< priority middle */
54 CAL_PRIORITY_HIGH /**< priority high */
58 CAL_PERMISSION_NONE = 0x00,
59 CAL_PERMISSION_READ = 0x01,
60 CAL_PERMISSION_WRITE = 0x02,
63 #define LOCAL_ACCOUNT_ID -1
65 #define CAL_INVALID_ID (-1)
68 CAL_SCH_TYPE_NONE = 0, /**< None type */
69 CAL_SCH_TYPE_EVENT, /**< schedule event type */
70 CAL_SCH_TYPE_TODO, /**< task event type */
71 CAL_SCH_TYPE_MAX, /**< max type */
81 * This structure defines schedule information.
85 int index; /**< Record index */
88 char *summary; /**< Summary, appointment, task: subject, birthday:Name */
89 char *description; /**< Description,appointment, task: description, anniversary,holiday:occasion*/
90 char *location; /**< Location */
94 calendar_event_status_e event_status; /**< current task status */
95 cal_priority_e priority; /**< Priority */
96 int timezone; /**< timezone of task */
98 int contact_id; /**< contact id for birthday in contact list */
100 int busy_status; /**< ACS, G : Flag of busy or not */
101 int sensitivity; /**< ACS, G : The sensitivity (public, private, confidential). #cal_visibility_type_t*/
102 int meeting_status; /**< ACS, G : The status of the meeting. */
103 char *uid; /**< ACS, G : Unique ID of the meeting item */
104 char *organizer_name; /**< ACS, G : Name of organizer(author) */
105 char *organizer_email; /**< ACS, G : Email of organizer */
107 int original_event_id; /**< original event id for recurrency exception */
111 long long int created_time;
112 int is_deleted; /**< for sync */
113 long long int last_mod;
116 calendar_time_s until;
140 calendar_time_s start;
145 cal_list_s *alarm_list;
146 cal_list_s *attendee_list;
147 cal_list_s *exception_list;
148 cal_list_s *extended_list;
159 calendar_todo_status_e todo_status;
160 cal_priority_e priority;
165 long long int created_time;
166 long long int completed_time;
168 int is_deleted; /**< for sync */
169 long long int last_mod;
172 calendar_time_s until;
192 calendar_time_s start;
196 char *organizer_name;
197 char *organizer_email;
201 cal_list_s *alarm_list;
202 cal_list_s *attendee_list;
203 cal_list_s *extended_list;
209 calendar_time_s until;
225 * This structure defines participant information of a meetting.
226 * ical: cutype, member, role, partstat, rsvp, delto, delfrom, sentby, cn, dir, language
230 int id; /* Internal property. Do not add to view_uri property */
232 char *attendee_number;
234 int attendee_ct_index;
237 /* ical spec from here */
238 char *attendee_group; /* cutype */
239 char *attendee_email; /* member */
240 int attendee_role; /* role */
241 int attendee_status; /* partstat: ACCEPTED, DECLINED.. */
242 int attendee_rsvp; /* rsvp */
243 char *attendee_delegatee_uri; /* delfrom */
244 char *attendee_delegator_uri; /* delto */
246 char *attendee_name; /* cn */
247 char *attendee_member; /* member */
252 * This structure defines exception information of alarm.
256 int id; /* Internal property. Do not add to view_uri property */
261 int remind_tick_unit;
263 char *alarm_description; /**< Alert description */
267 calendar_time_s alarm;
270 /* This is the calendar schema */
293 /* type for timezone information save */
297 int tz_offset_from_gmt;
301 int std_start_position_of_week;
306 char *day_light_name;
307 int day_light_start_month;
308 int day_light_start_position_of_week;
309 int day_light_start_day;
310 int day_light_start_hour;
319 calendar_time_s start;
328 int has_rrule; /* rrule_id */
332 int original_event_id;
333 long long int last_mod;
335 } cal_instance_utime_s;
341 calendar_time_s start;
350 int has_rrule; /* rrule_id */
354 int original_event_id;
355 long long int last_mod;
358 } cal_instance_localtime_s;
364 calendar_time_s start;
373 int has_rrule; /*rrule_id */
377 int original_event_id;
378 long long int last_mod;
379 char *organizer_name;
386 } cal_instance_utime_extended_s;
392 calendar_time_s start;
401 int has_rrule; /* rrule_id */
405 int original_event_id;
406 long long int last_mod;
408 char *organizer_name;
415 } cal_instance_localtime_extended_s;
423 } cal_updated_info_s;
426 CAL_NOTI_TYPE_EVENT = 0x0,
432 unsigned int property_id;
433 const char* fields; /* DB field */
434 } cal_property_info_s;
442 CAL_FILTER_COMPOSITE,
446 int filter_type; /* composite */
452 GSList *filter_ops; /* calendar_filter_operator_e op */
453 GSList *filters; /* calendar_filter_h l_filter */
454 cal_property_info_s *properties;
456 } cal_composite_filter_s;
459 int filter_type; /* cal_filter_type_e */
461 int match; /* calendar_match_str_flag_e or calendar_match_int_flag_e */
467 calendar_time_s caltime;
469 } cal_attribute_filter_s;
473 cal_composite_filter_s* filter;
474 int projection_count;
475 unsigned int *projection;
476 int sort_property_id;
478 cal_property_info_s *properties;
490 calendar_time_s caltime;
492 } cal_search_value_s;
512 #endif /* __CALENDAR_SERVICE_TYPEDEF_H__ */