Tizen 2.1 base
[platform/core/system/sync-agent.git] / src / fw-plugins / common-public / vobject-tizen / src / cals-typedef.h
1 /*
2  * sync-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef _CALENDAR_SVC_TYPEDEF_H_
19 #define _CALENDAR_SVC_TYPEDEF_H_
20
21 #include <time.h>
22
23 #include "calendar-svc-provider.h"
24
25 #define BENCHMARK_YEAR                          1900L           /**< tm_year's benchmark */
26
27 typedef enum {
28         CAL_STRUCT_TYPE_SCHEDULE = 0,   /**< schedule type */
29         CAL_STRUCT_TYPE_CALENDAR,       /**< calendar type */
30         CAL_STRUCT_TYPE_TODO,    /**< task type   */
31         CAL_STRUCT_TYPE_TIMEZONE,
32         CAL_STRUCT_TYPE_SCHEDULE_LIST,
33         CAL_STRUCT_TYPE_TODO_LIST,
34         CAL_STRUCT_TYPE_UPDATED_LIST,
35 } cal_struct_type;
36
37 typedef enum {
38         CAL_EVENT_PATICIPANT = 0,       /**< CAL_STRUCT_PARTICIPANT */
39         CAL_EVENT_CATEGORY,             /**< CAL_STRUCT_CATEFORY */
40         CAL_EVENT_RECURRENCY,   /**< CAL_STRUCT_RECURRENCY */
41         CAL_EVENT_DELETE,               /**< CAL_STRUCT_DELETE */
42         CAL_EVENT_SYNC_STATUS,  /**< CAL_STRUCT_SYNC_STATUS */
43         CAL_EVENT_CALENDAR,     /**< CAL_STRUCT_CALENDAR */
44         CAL_EVENT_ALARM,
45         CAL_EVENT_MAX,
46
47 } cal_data_type_t;
48
49 struct _cal_struct {
50         cal_struct_type event_type;
51         void *user_data;
52 };
53
54 struct _cal_value {
55         cal_data_type_t v_type;
56         void *user_data;
57 };
58
59 /**
60  * @enum calendar_type_t
61  * This enumeration defines calendar type.
62  */
63 typedef enum {
64         CAL_ALL_CALENDAR = 0,                                   /**< all calendar type */
65         CAL_PHONE_CALENDAR,                                             /**< phone calendar type */
66         CAL_ACTIVESYNC_CALENDAR,                                /**< activesync calendar type*/
67         CAL_GOOGLE_CALENDAR                                             /**< google calendar type*/
68 } calendar_type_t;
69
70 /**
71  * @enum cal_type_t
72  * This enumeration defines calendar event type.
73  */
74 typedef enum {
75         CALS_SCH_TYPE_NONE = 0,                 /**< None type */
76         CALS_SCH_TYPE_EVENT,    /**< schedule event type */
77         CALS_SCH_TYPE_TODO,             /**< task event type */
78         CALS_SCH_TYPE_MAX,              /**< max type */
79 } cals_sch_type;
80
81 /**
82  * @enum cal_vCal_ver_t
83  * This enumeration defines vCalendar version.
84  */
85 typedef enum {
86         CAL_VCAL_VER_1_0 = 0,   /**< vCalendar ver 1.0 */
87         CAL_VCAL_VER_2_0,               /**< vCalendar ver 2.0 */
88         CAL_VCAL_VER_UNKNOWN    /**< vCalendar ver unknown */
89 } cal_vCal_ver_t;
90
91 /**
92  * @enum cal_priority_t
93  * This enumeration defines priority for todo data.
94  */
95 typedef enum {
96         CAL_PRIORITY_LOW,       /**< priority low */
97         CAL_PRIORITY_MID,       /**< priority middle */
98         CAL_PRIORITY_HIGH       /**< priority high */
99 } cal_priority_t;
100
101 /**
102  * @enum cal_starting_day_type_t
103  * This enumeration defines starting day.
104  */
105 typedef enum {
106         CAL_STARTING_DAY_SUNDAY = 0,    /**< starting day is sunday */
107         CAL_STARTING_DAY_MONDAY         /**< starting day is monday */
108 } cal_starting_day_type_t;
109
110 /**
111  * This structure defines schedule information.
112  */
113 typedef struct {
114         int index;                              /**< Record index */
115         int account_id;                 /**< Account_id */
116         cals_sch_type cal_type;                 /**< Calendar event type */
117
118         char *summary;                  /**< Summary, appointment, task: subject, birthday:Name */
119         char *description;              /**< Description,appointment, task: description, anniversary,holiday:occasion*/
120         char *location;                 /**< Location */
121         char *categories;
122         GList *meeting_category;        /**< collection of categories */
123         bool all_day_event;             /**< All day event flag */
124         struct tm start_date_time;      /**< schedule:start time, anniv,holiday,birthday,memo,todo: date */
125         struct tm end_date_time;                /**< end time */
126         GList *alarm_list;
127         cal_repeat_term_t repeat_term;          /**< Repeat term */
128         int repeat_interval;    /**< Interval of repeat term */
129         int repeat_until_type;  /**< repeat until type */
130         int repeat_occurrences; /**< occurrences of repeat */
131         struct tm repeat_end_date;      /**< End date for repeat */
132         cal_date_type_t sun_moon;                       /**< Using sun or lunar calendar */
133         cal_starting_day_type_t week_start;                     /**< Start day of a week */
134         char *week_flag;        //[DAY_OF_A_WEEK + 1]; /**< Indicate which day is select in a week */
135         int day_date;                   /**< 0- for weekday(sun,mon,etc.), 1- for specific day(1,2.. Etc) */
136         struct tm last_modified_time;   /**< for PC Sync */
137         bool missed;                            /**< Miss alarm flag */
138         cals_status_t task_status;              /**< current task status */
139         cal_priority_t priority;                /**< Priority */
140         int timezone;                   /**< timezone of task */
141         int file_id;                    /**< file id for attach or alarm tone*/
142         int contact_id;                 /**< contact id for birthday in contact list */
143         GList *attendee_list;   /**< collection of attendee */
144         int busy_status;                /**< ACS, G : Flag of busy or not */
145         int sensitivity;                /**< ACS, G : The sensitivity (public, private, confidential). #cal_visibility_type_t*/
146         int meeting_status;             /**< ACS, G : The status of the meeting. */
147         char *uid;                              /**< ACS, G : Unique ID of the meeting item */
148         char *organizer_name;           /**< ACS, G : Name of organizer(author) */
149         char *organizer_email;  /**< ACS, G : Email of organizer */
150         calendar_type_t calendar_type;          /**< ACS, G : Type(all,phone,google) of calendar */
151         char *gcal_id;                  /**< G : Server id of calendar */
152         char *updated;                  /**< G : Updated time stamp */
153         int location_type;              /**< G : Location type */
154         char *location_summary; /**< G : A simple string value that can be used as a representation of this location */
155         char *etag;                             /**< G : ETAG of this event */
156         int calendar_id;                        /**< G : id to map from calendar table */
157         cal_sync_status_t sync_status;          /**< G : Indication for event entry whether added/ modified/ deleted */
158         char *edit_uri;      /**< G : EditUri for google calendar */
159         char *gevent_id;                        /**< G : Server id of an event */
160         int dst;                                        /**< dst of event */
161         GList *exception_date_list;                    /**< exception dates */
162         int original_event_id;        /**< original event id for recurrency exception */
163         double latitude;
164         double longitude;
165         char *tz_name;
166         char *tz_city_name;
167         int email_id;
168         int availability;
169         struct tm created_date_time; /**< created time */
170         struct tm completed_date_time; /**< completed time */
171         int progress;
172 } cal_sch_full_t;
173
174 /**
175  * This structure defines exception information of alarm.
176  */
177 typedef struct {
178         int alarm_id;                   /**< Alarm id */
179         int event_id;
180         cal_alert_type_t alarm_type;                    /**< Alert type(see 'cal_alert_type_t') */
181         int is_deleted;
182
183         /* audio */
184         /* -- trigger */
185         struct tm alarm_time;
186         int remind_tick;
187         cal_sch_remind_tick_unit_t remind_tick_unit;
188         /* --attach */
189         char *alarm_tone;                       /**< Alert Sound File Name */
190
191         /* display */
192         char *alarm_description;                        /**< Alert description */
193
194         /* email */
195
196 } cal_alarm_info_t;
197
198 #endif                          // _CALENDAR_SVC_TYPEDEF_H_