f8b4e3ce663afc32c65c141d0a8b36e8eb867dcf
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Calendar / EventRecurrenceRule.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 _EVENT_RECURRENCE_RULE_H_
19 #define _EVENT_RECURRENCE_RULE_H_
20
21 #include <string>
22 #include <vector>
23 #include <dpl/shared_ptr.h>
24 #include <dpl/optional.h>
25
26 namespace TizenApis {
27 namespace Api {
28 namespace Calendar {
29
30 class EventRecurrenceRule
31 {
32   public:
33
34     typedef enum
35     {
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 */
45     } EventRecurrence;
46
47     EventRecurrenceRule();
48     virtual ~EventRecurrenceRule();
49
50     EventRecurrence getFrequency() const;
51     void setFrequency(const EventRecurrence &value);
52
53     int getInterval() const;
54     void setInterval(const int &value);
55
56     bool isEndDateSet() const;
57     time_t getEndDate() const;
58     void setEndDate(time_t value);
59     void resetEndDate();
60
61     long getOccurrenceCount() const;
62     void setOccurrenceCount(long value);
63
64     std::vector<int> getDaysOfTheMonth() const;
65     void setDaysOfTheMonth(std::vector<int> value);
66
67     std::vector<std::string> getDaysOfTheWeek() const;
68     void setDaysOfTheWeek(std::vector<std::string> value);
69
70     std::vector<int> getDaysOfTheYear() const;
71     void setDaysOfTheYear(std::vector<int> value);
72
73     std::vector<int> getWeeksOfTheYear() const;
74     void setWeeksOfTheYear(std::vector<int> value);
75
76     bool getSetPosition() const;
77     void setSetPosition(bool value);
78
79     std::vector<time_t> getExceptions() const;
80     void setExceptions(std::vector<time_t> value);
81
82     std::string getTimeZone() const;
83     void setTimeZone(std::string value);
84
85   protected:
86     EventRecurrence m_frequency;
87     int m_interval;
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;
94     bool m_setPosition;
95     std::vector<time_t> m_exceptions;
96     std::string m_timeZone;
97 };
98
99 typedef DPL::SharedPtr<EventRecurrenceRule> EventRecurrenceRulePtr;
100
101 }
102 }
103 }
104
105 #endif /* _EVENT_RECURRENCE_RULE_H_ */