2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 * @file CalendarEvent.h
18 * @author Lukasz Marek (l.marek@samsung.com)
22 #ifndef WRTDEVICEAPIS_CALENDAR_CALENDAR_EVENT_H_
23 #define WRTDEVICEAPIS_CALENDAR_CALENDAR_EVENT_H_
28 #include <dpl/optional.h>
29 #include <dpl/shared_ptr.h>
31 namespace WrtDeviceApis {
35 typedef std::vector<std::string> CategoryList;
36 typedef DPL::SharedPtr<CategoryList> CategoryListPtr;
38 /* This object represents a single calendar event */
43 static const int UNDEFINED_CALENDAR_ID = -1;
47 NO_RECURRENCE, //The calendar entry occurs once
48 DAILY_RECURRENCE, //The calendar entry occurs every day
49 WEEKLY_RECURRENCE, //The calendar entry occurs every week e.g. every Monday
50 MONTHLY_RECURRENCE, //The calendar entry occurs every month e.g. every 3rd day of month
51 YEARLY_RECURRENCE, //The calendar entry occurs every year e.g. every June 1st
52 WEEKDAY_RECURRENCE, //The calendar entry occurs Mon-Fri every week
53 MONTHLY_ON_DAY_RECURRENCE, //The calendar entry occurs on the same weekday or weekend every month, e.g., every second Tuesday each month.
54 INVALID_RECURRENCE = 10000,
55 UNDEFINED_RECURRENCE /* should be used only to mark a fact filter is not set */
63 INVALID_STATUS = 10000,
64 UNDEFINED_STATUS /* should be used only to mark a fact filter is not set */
72 INVALID_ALARM_TYPE = 10000,
73 UNDEFINED_ALARM_TYPE /* should be used only to mark a fact filter is not set */
77 virtual ~CalendarEvent();
80 void setId(int value);
83 int getCalendarId() const;
84 void setCalendarId(int value);
86 std::string getDescription() const;
87 void setDescription(const std::string &value);
89 std::string getSubject() const;
90 void setSubject(const std::string &value);
92 time_t getStartTime() const;
93 void setStartTime(time_t value);
95 time_t getEndTime() const;
96 void setEndTime(time_t value);
98 std::string getLocation() const;
99 void setLocation(const std::string &value);
101 EventRecurrence getRecurrence() const;
102 void setRecurrence(EventRecurrence value);
104 EventStatus getStatus() const;
105 void setStatus(EventStatus value);
107 time_t getAlarmTime() const;
108 void setAlarmTime(time_t value);
109 void resetAlarmTime();
111 EventAlarmType getAlarmType() const;
112 void setAlarmType(EventAlarmType value);
114 CategoryListPtr getCategories() const;
115 void setCategories(const CategoryListPtr &value);
117 time_t getExpires() const;
118 void setExpires(time_t value);
121 int getInterval() const;
122 void setInterval(int value);
124 void display() const;
125 bool validate() const;
127 bool getIdIsSet() const;
128 bool getAlarmTimeIsSet() const;
129 bool getExpiresIsSet() const;
132 DPL::Optional<int> m_id;
134 std::string m_description;
135 std::string m_subject;
136 std::time_t m_startTime;
137 std::time_t m_endTime;
138 std::string m_location;
139 EventRecurrence m_recurrence;
140 EventStatus m_status;
141 DPL::Optional<std::time_t> m_alarmTime;
142 EventAlarmType m_alarmType;
143 CategoryListPtr m_categories;
144 DPL::Optional<std::time_t> m_expires;
148 typedef DPL::SharedPtr<CalendarEvent> CalendarEventPtr;
154 #endif // WRTDEVICEAPIS_CALENDAR_CALENDAR_EVENT_H_