b8693c0faea500fff2fd2ecc0814cfc9f9ed60fc
[framework/web/wrt-plugins-tizen.git] / src / Calendar / EventRecurrenceRule.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18
19 #ifndef _EVENT_RECURRENCE_RULE_H_
20 #define _EVENT_RECURRENCE_RULE_H_
21
22 #include <string>
23 #include <vector>
24 #include <ctime>
25 #include <dpl/shared_ptr.h>
26
27 namespace DeviceAPI {
28 namespace Calendar {
29
30 typedef std::vector<std::string> StringArray;
31 typedef DPL::SharedPtr<StringArray> StringArrayPtr;
32
33 typedef std::vector<long long int> NumberArray;
34 typedef DPL::SharedPtr<NumberArray> NumberArrayPtr;
35
36 #define UNDEFINED_TIME -1
37 #define DEFAULT_TIMEZONE ""
38 #define DEFAULT_INTERVAL 1
39
40 class EventRecurrenceRule
41 {
42   public:
43
44     typedef enum
45     {
46         NO_RECURRENCE,
47         DAILY_RECURRENCE,
48         WEEKLY_RECURRENCE,
49         MONTHLY_RECURRENCE,
50         YEARLY_RECURRENCE,
51         UNDEFINED_RECURRENCE
52     } EventRecurrence;
53
54     EventRecurrenceRule();
55     virtual ~EventRecurrenceRule();
56
57     EventRecurrence getFrequency() const;
58     void setFrequency(const EventRecurrence &value);
59
60     int getInterval() const;
61     void setInterval(const int &value);
62
63     long long int getEndDate() const;
64     void setEndDate(long long int value);
65
66     long getOccurrenceCount() const;
67     void setOccurrenceCount(long value);
68
69     std::vector<int> getDaysOfTheMonth() const;
70     void setDaysOfTheMonth(std::vector<int> value);
71
72     StringArrayPtr getDaysOfTheWeek() const;
73     void setDaysOfTheWeek(StringArrayPtr value);
74
75     std::vector<int> getDaysOfTheYear() const;
76     void setDaysOfTheYear(std::vector<int> value);
77
78     std::vector<int> getWeeksOfTheYear() const;
79     void setWeeksOfTheYear(std::vector<int> value);
80
81     NumberArrayPtr getSetPositions() const;
82     void setSetPositions(NumberArrayPtr value);
83
84     NumberArrayPtr getExceptions() const;
85     void setExceptions(NumberArrayPtr value);
86
87     std::string getTimeZone() const;
88     void setTimeZone(std::string value);
89
90   protected:
91     EventRecurrence m_frequency;
92     int m_interval;
93     long long int m_endDate;
94     long m_occurrenceCount;
95     std::vector<int> m_daysOfTheMonth;
96     StringArrayPtr m_daysOfTheWeek;
97     std::vector<int> m_daysOfTheYear;
98     std::vector<int> m_weeksOfTheYear;
99     NumberArrayPtr m_setPositions;
100     NumberArrayPtr m_exceptions;
101     std::string m_timeZone;
102 };
103
104 typedef DPL::SharedPtr<EventRecurrenceRule> EventRecurrenceRulePtr;
105
106 }
107 }
108
109 #endif /* _EVENT_RECURRENCE_RULE_H_ */