upload tizen1.0 source
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Calendar / CalendarEvent.h
1 /*
2  * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17
18 #ifndef _ABSTRACT_LAYER_CALENDAR_EVENT_H_
19 #define _ABSTRACT_LAYER_CALENDAR_EVENT_H_
20
21 #include <ctime>
22 #include <string>
23 #include <vector>
24 #include <dpl/shared_ptr.h>
25
26 #include "EventAttendee.h"
27 #include "EventRecurrenceRule.h"
28
29 namespace TizenApis {
30 namespace Api {
31 namespace Calendar {
32
33 #define UNDEFINED_CALENDAR_ID 0
34 #define UNDEFINED_ITEM_ID 0
35 #define UNDEFINED_GEO 0
36 #define UNDEFINED_ID "0"
37
38 typedef std::vector<std::string> CategoryList;
39 typedef DPL::SharedPtr<CategoryList> CategoryListPtr;
40
41 typedef std::vector<std::string> AttributeList;
42 typedef DPL::SharedPtr<AttributeList> AttributeListPtr;
43
44 /* This object represents a single calendar event */
45 class CalendarEvent
46 {
47   public:
48     typedef enum
49     {
50         TENTATIVE_STATUS,
51         CONFIRMED_STATUS,
52         CANCELLED_STATUS,
53         NEEDS_ACTION_STATUS,
54         IN_PROCESS_STATUS,
55         COMPLETED_STATUS,
56         UNDEFINED_STATUS
57     } EventStatus;
58
59     typedef enum
60     {
61         NO_ALARM,
62         SILENT_ALARM,
63         SOUND_ALARM,
64         UNDEFINED_ALARM_TYPE
65     } EventAlarmType;
66
67     typedef enum
68     {
69         PUBLIC_VISIBILITY,
70         PRIVATE_VISIBILITY,
71         CONFIDENTIAL_VISIBILITY,
72         UNDEFINED_VISIBILITY
73     } EventVisibility;
74
75     typedef enum
76     {
77         BUSY_FB,
78         BUSY_UNAVAILABLE_FB,
79         FREE_FB,
80         BUSY_TENTATIVE_FB,
81         UNDEFINED_AVAILABILITY
82     } EventAvailability;
83
84     typedef enum
85     {
86         LOW_PRIORITY,
87         MEDIUM_PRIORITY,
88         HIGH_PRIORITY,
89         UNDEFINED_PRIORITY
90     } TaskPriority;
91
92     typedef enum
93     {
94         ICALENDAR_20,
95         VCALENDAR_10,
96         UNDEFINED_FORMAT
97     } VObjectFormat;
98
99     typedef enum
100     {
101         EVENT_TYPE = 0,
102         TASK_TYPE,
103         UNDEFINED_TYPE
104     } CalendarType;
105
106
107     CalendarEvent();
108     CalendarEvent(const CalendarEvent &original); // copy constructor for clone operation
109     virtual ~CalendarEvent();
110
111     int getId() const;
112     void setId(int value);
113     void resetId();
114     bool getIdIsSet() const;
115
116     int getParentId() const;
117     void setParentId(int value);
118
119     int getCalendarId() const;
120     void setCalendarId(int value);
121
122     std::string getDescription() const;
123     void setDescription(const std::string &value);
124
125     std::string getSubject() const;
126     void setSubject(const std::string &value);
127
128     std::time_t getStartTime() const;
129     void setStartTime(std::time_t value);
130
131     std::time_t getEndTime() const;
132     void setEndTime(std::time_t value);
133
134     std::string getLocation() const;
135     void setLocation(const std::string &value);
136
137     EventRecurrenceRulePtr getRecurrenceRule() const;
138     void setRecurrenceRule(EventRecurrenceRulePtr value);
139
140     EventStatus getStatus() const;
141     void setStatus(EventStatus value);
142
143     std::vector<long> getAlarmsTick() const;
144     void setAlarmsTick(std::vector<long> &value);
145
146     std::vector<EventAlarmType> getAlarmsType() const;
147     void setAlarmsType(std::vector<EventAlarmType> &value);
148
149     std::vector<std::string> getAlarmsDescription() const;
150     void setAlarmsDescription(std::vector<std::string> &value);
151
152     CategoryListPtr getCategories() const;
153     void setCategories(const CategoryListPtr &value);
154
155     void display() const;
156     bool validate() const;
157
158     bool getIsAllDay() const;
159     void setIsAllDay(bool value);
160
161     std::time_t getLastModifiedDate() const;
162     void setLastModifiedDate(std::time_t value);
163
164     std::string getOrganizer() const;
165     void setOrganizer(const std::string &value);
166
167     EventVisibility getVisibility() const;
168     void setVisibility(EventVisibility value);
169
170     EventAvailability getAvailability() const;
171     void setAvailability(EventAvailability value);
172
173     std::string getUId() const;
174     void setUId(const std::string &value);
175
176     std::time_t getRecurrenceId() const;
177     void setRecurrenceId(std::time_t value);
178
179     EventAttendeeListPtr getAttendees() const;
180     void setAttendees(const EventAttendeeListPtr &value);
181
182     bool getIsDetached() const;
183     void setIsDetached(bool value);
184
185     void setAttributesOfInterest(AttributeListPtr value);
186     AttributeListPtr getAttributesOfInterest() const;
187
188     double getLatitude() const;
189     void setLatitude(double value);
190
191     double getLongitude() const;
192     void setLongitude(double value);
193
194     void setTimeZone(std::string value);
195     std::string getTimeZone() const;
196
197     TaskPriority getPriority() const;
198     void setPriority(TaskPriority value);
199
200     std::time_t getCreatedDate() const;
201     void setCreatedDate(std::time_t value);
202
203     std::time_t getCompletedDate() const;
204     void setCompletedDate(std::time_t value);
205
206     int getProgress() const;
207     void setProgress(int value);
208
209     CalendarType getCalendarType() const;
210     void setCalendarType(CalendarType type);
211
212   protected:
213     int m_id;
214     int m_parentId; // the parent id if it's detached.
215     int m_calendarId;
216     std::string m_description;
217     std::string m_subject;
218     std::time_t m_startTime;
219     std::time_t m_endTime;
220     std::string m_location;
221     EventRecurrenceRulePtr m_recurrence;
222     EventStatus m_status;
223     std::vector<long> m_alarmsTick;
224     std::vector<EventAlarmType> m_alarmsType;
225     std::vector<std::string> m_alarmsDescription;
226     CategoryListPtr m_categories;
227     bool m_isAllDay;
228     std::string m_organizer;
229     std::time_t m_lastModifiedDate;
230     EventVisibility m_visibility;
231     EventAvailability m_availability;
232     std::string m_uid; // uid is same with id.
233     std::time_t m_recurrenceId;
234     EventAttendeeListPtr m_attendees;
235     bool m_isDetached;
236     AttributeListPtr m_attributesOfInterest;
237     double m_latitude;
238     double m_longitude;
239     std::string m_timeZone;
240     TaskPriority m_priority;
241     std::time_t m_createdDate;
242     std::time_t m_completedDate;
243     int m_progress;
244     CalendarType m_calendarType;
245 };
246
247 typedef DPL::SharedPtr<CalendarEvent> CalendarEventPtr;
248 typedef std::vector<CalendarEventPtr> CalendarEventList;
249 typedef DPL::SharedPtr<CalendarEventList> CalendarEventListPtr;
250
251 }
252 }
253 }
254
255 #endif /* _ABSTRACT_LAYER_CALENDAR_EVENT_H_ */
256