Beta merge 2
[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
25 namespace TizenApis {
26 namespace Api {
27 namespace Calendar {
28
29 class EventRecurrenceRule
30 {
31   public:
32
33     typedef enum
34     {
35         NO_RECURRENCE,                  //The calendar entry occurs once
36         DAILY_RECURRENCE,               //The calendar entry occurs every day
37         WEEKLY_RECURRENCE,              //The calendar entry occurs every week e.g. every Monday
38         MONTHLY_RECURRENCE,             //The calendar entry occurs every month e.g. every 3rd day of month
39         YEARLY_RECURRENCE,              //The calendar entry occurs every year  e.g. every June 1st
40         WEEKDAY_RECURRENCE,             //The calendar entry occurs Mon-Fri every week
41         MONTHLY_ON_DAY_RECURRENCE,      //The calendar entry occurs on the same weekday or weekend every month, e.g., every second Tuesday each month.
42         INVALID_RECURRENCE = 10000,
43         UNDEFINED_RECURRENCE            /* should be used only to mark a fact filter is not set */
44     } EventRecurrence;
45
46     EventRecurrenceRule();
47     virtual ~EventRecurrenceRule();
48
49     EventRecurrence getFrequency() const;
50     void setFrequency(const EventRecurrence &value);
51
52     int getInterval() const;
53     void setInterval(const int &value);
54
55     time_t getEndDate() const;
56     void setEndDate(time_t value);
57
58     long getOccurrenceCount() const;
59     void setOccurrenceCount(long value);
60
61     std::vector<int> getDaysOfTheMonth() const;
62     void setDaysOfTheMonth(std::vector<int> value);
63
64     std::vector<std::string> getDaysOfTheWeek() const;
65     void setDaysOfTheWeek(std::vector<std::string> value);
66
67     std::vector<int> getDaysOfTheYear() const;
68     void setDaysOfTheYear(std::vector<int> value);
69
70     std::vector<int> getWeeksOfTheYear() const;
71     void setWeeksOfTheYear(std::vector<int> value);
72
73     bool getSetPosition() const;
74     void setSetPosition(bool value);
75
76     std::vector<time_t> getExceptions() const;
77     void setExceptions(std::vector<time_t> value);
78
79     std::string getTimeZone() const;
80     void setTimeZone(std::string value);
81
82   protected:
83     EventRecurrence m_frequency;
84     int m_interval;
85     time_t m_endDate;
86     long m_occurrenceCount;
87     std::vector<int> m_daysOfTheMonth;
88     std::vector<std::string> m_daysOfTheWeek;
89     std::vector<int> m_daysOfTheYear;
90     std::vector<int> m_weeksOfTheYear;
91     bool m_setPosition;
92     std::vector<time_t> m_exceptions;
93     std::string m_timeZone;
94 };
95
96 typedef DPL::SharedPtr<EventRecurrenceRule> EventRecurrenceRulePtr;
97
98 }
99 }
100 }
101
102 #endif /* _EVENT_RECURRENCE_RULE_H_ */