59fb856247e22f59f6046876861f43d3ffb99650
[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/optional.h>
25 #include <dpl/shared_ptr.h>
26
27 #include "CalendarItemGeo.h"
28 #include "EventAttendee.h"
29 #include "EventRecurrenceRule.h"
30
31 namespace TizenApis {
32 namespace Api {
33 namespace Calendar {
34
35 typedef std::vector<std::string> CategoryList;
36 typedef DPL::SharedPtr<CategoryList> CategoryListPtr;
37
38 typedef std::vector<std::string> AttributeList;
39 typedef DPL::SharedPtr<AttributeList> AttributeListPtr;
40
41 /* This object represents a single calendar event */
42 class CalendarEvent
43 {
44   public:
45
46     static const int UNDEFINED_CALENDAR_ID = -1;
47
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         INVALID_STATUS = 10000,
57         UNDEFINED_STATUS
58     } EventStatus;
59
60     typedef enum
61     {
62         NO_ALARM,
63         SILENT_ALARM,
64         SOUND_ALARM,
65         INVALID_ALARM_TYPE = 10000,
66         UNDEFINED_ALARM_TYPE
67     } EventAlarmType;
68
69     typedef enum
70     {
71         PUBLIC_VISIBILITY,
72         PRIVATE_VISIBILITY,
73         CONFIDENTIAL_VISIBILITY,
74         INVALID_VISIBILITY = 10000,
75         UNDEFINED_VISIBILITY
76     } EventVisibility;
77
78     typedef enum
79     {
80         BUSY_FB,
81         BUSY_UNAVAILABLE_FB,
82         FREE_FB,
83         BUSY_TENTATIVE_FB,
84         INVALID_AVAILABILITY = 10000,
85         UNDEFINED_AVAILABILITY
86     } EventAvailability;
87
88     typedef enum
89     {
90         LOW_PRIORITY,
91         MEDIUM_PRIORITY,
92         HIGH_PRIORITY,
93         INVALID_PRIORITY = 10000,
94         UNDEFINED_PRIORITY
95     } TaskPriority;
96
97     typedef enum
98     {
99         ICALENDAR_20,
100         VCALENDAR_10,
101         INVALID_FORMAT = 10000,
102         UNDEFINED_FORMAT
103     } VObjectFormat;
104
105     typedef enum
106     {
107         EVENT_TYPE = 0,
108         TASK_TYPE,
109     } CalendarType;
110
111
112     CalendarEvent();
113     virtual ~CalendarEvent();
114
115     int getId() const;
116     void setId(int value);
117     void resetId();
118     bool getIdIsSet() const;
119
120     int getCalendarId() const;
121     void setCalendarId(int value);
122
123     std::string getDescription() const;
124     void setDescription(const std::string &value);
125
126     std::string getSubject() const;
127     void setSubject(const std::string &value);
128
129     std::time_t getStartTime() const;
130     void setStartTime(std::time_t value);
131
132     std::time_t getEndTime() const;
133     void setEndTime(std::time_t value);
134
135     std::string getLocation() const;
136     void setLocation(const std::string &value);
137
138     EventRecurrenceRulePtr getRecurrenceRule() const;
139     void setRecurrenceRule(EventRecurrenceRulePtr value);
140
141     EventStatus getStatus() const;
142     void setStatus(EventStatus value);
143
144     std::vector<long> getAlarmsTick() const;
145     void setAlarmsTick(std::vector<long> &value);
146
147     std::vector<EventAlarmType> getAlarmsType() const;
148     void setAlarmsType(std::vector<EventAlarmType> &value);
149
150     CategoryListPtr getCategories() const;
151     void setCategories(const CategoryListPtr &value);
152
153     void display() const;
154     bool validate() const;
155
156     bool getIsAllDay() const;
157     void setIsAllDay(bool value);
158
159     std::time_t getLastModifiedDate() const;
160     void setLastModifiedDate(std::time_t value);
161
162     std::string getOrganizer() const;
163     void setOrganizer(const std::string &value);
164
165     EventVisibility getVisibility() const;
166     void setVisibility(EventVisibility value);
167
168     EventAvailability getAvailability() const;
169     void setAvailability(EventAvailability value);
170
171     std::string getUId() const;
172     void setUId(const std::string &value);
173
174     std::time_t getRecurrenceId() const;
175     void setRecurrenceId(std::time_t value);
176
177     EventAttendeeListPtr getAttendees() const;
178     void setAttendees(const EventAttendeeListPtr &value);
179
180     bool getIsDetached() const;
181     void setIsDetached(bool value);
182
183     void setAttributesOfInterest(AttributeListPtr value);
184     AttributeListPtr getAttributesOfInterest() const;
185
186     void setGeolocation(CalendarItemGeoPtr value);
187     CalendarItemGeoPtr getGeolocation() const;
188
189     void setTimeZone(std::string value);
190     std::string getTimeZone() const;
191
192     TaskPriority getPriority() const;
193     void setPriority(TaskPriority value);
194
195     std::time_t getCreatedDate() const;
196     void setCreatedDate(std::time_t value);
197
198     std::time_t getCompletedDate() const;
199     void setCompletedDate(std::time_t value);
200
201     int getProgress() const;
202     void setProgress(int value);
203
204     CalendarType getCalendarType() const;
205     void setCalendarType(CalendarType type);
206
207   protected:
208     DPL::Optional<int> m_id;
209     int m_calendarId;
210     std::string m_description;
211     std::string m_subject;
212     std::time_t m_startTime;
213     std::time_t m_endTime;
214     std::string m_location;
215     EventRecurrenceRulePtr m_recurrence;
216     EventStatus m_status;
217     std::vector<long> m_alarmsTick;
218     std::vector<EventAlarmType> m_alarmsType;
219     CategoryListPtr m_categories;
220     bool m_isAllDay;
221     std::string m_organizer;
222     std::time_t m_lastModifiedDate;
223     EventVisibility m_visibility;
224     EventAvailability m_availability;
225     std::string m_uid;
226     std::time_t m_recurrenceId;
227     EventAttendeeListPtr m_attendees;
228     bool m_isDetached;
229     AttributeListPtr m_attributesOfInterest;
230     CalendarItemGeoPtr m_geolocation;
231     std::string m_timeZone;
232     TaskPriority m_priority;
233     std::time_t m_createdDate;
234     std::time_t m_completedDate;
235     int m_progress;
236     CalendarType m_calendarType;
237 };
238
239 typedef DPL::SharedPtr<CalendarEvent> CalendarEventPtr;
240 typedef std::vector<CalendarEventPtr> CalendarEventList;
241 typedef DPL::SharedPtr<CalendarEventList> CalendarEventListPtr;
242
243 }
244 }
245 }
246
247 #endif /* _ABSTRACT_LAYER_CALENDAR_EVENT_H_ */
248