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