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.
18 #ifndef _EVENT_RECURRENCE_RULE_H_
19 #define _EVENT_RECURRENCE_RULE_H_
23 #include <dpl/shared_ptr.h>
24 #include <dpl/optional.h>
30 class EventRecurrenceRule
36 NO_RECURRENCE, //The calendar entry occurs once
37 DAILY_RECURRENCE, //The calendar entry occurs every day
38 WEEKLY_RECURRENCE, //The calendar entry occurs every week e.g. every Monday
39 MONTHLY_RECURRENCE, //The calendar entry occurs every month e.g. every 3rd day of month
40 YEARLY_RECURRENCE, //The calendar entry occurs every year e.g. every June 1st
41 WEEKDAY_RECURRENCE, //The calendar entry occurs Mon-Fri every week
42 MONTHLY_ON_DAY_RECURRENCE, //The calendar entry occurs on the same weekday or weekend every month, e.g., every second Tuesday each month.
43 INVALID_RECURRENCE = 10000,
44 UNDEFINED_RECURRENCE /* should be used only to mark a fact filter is not set */
47 EventRecurrenceRule();
48 virtual ~EventRecurrenceRule();
50 EventRecurrence getFrequency() const;
51 void setFrequency(const EventRecurrence &value);
53 int getInterval() const;
54 void setInterval(const int &value);
56 bool isEndDateSet() const;
57 time_t getEndDate() const;
58 void setEndDate(time_t value);
61 long getOccurrenceCount() const;
62 void setOccurrenceCount(long value);
64 std::vector<int> getDaysOfTheMonth() const;
65 void setDaysOfTheMonth(std::vector<int> value);
67 std::vector<std::string> getDaysOfTheWeek() const;
68 void setDaysOfTheWeek(std::vector<std::string> value);
70 std::vector<int> getDaysOfTheYear() const;
71 void setDaysOfTheYear(std::vector<int> value);
73 std::vector<int> getWeeksOfTheYear() const;
74 void setWeeksOfTheYear(std::vector<int> value);
76 bool getSetPosition() const;
77 void setSetPosition(bool value);
79 std::vector<time_t> getExceptions() const;
80 void setExceptions(std::vector<time_t> value);
82 std::string getTimeZone() const;
83 void setTimeZone(std::string value);
86 EventRecurrence m_frequency;
88 DPL::Optional<time_t> m_endDate;
89 long m_occurrenceCount;
90 std::vector<int> m_daysOfTheMonth;
91 std::vector<std::string> m_daysOfTheWeek;
92 std::vector<int> m_daysOfTheYear;
93 std::vector<int> m_weeksOfTheYear;
95 std::vector<time_t> m_exceptions;
96 std::string m_timeZone;
99 typedef DPL::SharedPtr<EventRecurrenceRule> EventRecurrenceRulePtr;
105 #endif /* _EVENT_RECURRENCE_RULE_H_ */