31a78e927d10efef157f4005b1449fc2e73c705f
[framework/web/wrt-plugins-tizen.git] / src / Calendar / EventRecurrenceRule.cpp
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 #include "EventRecurrenceRule.h"
20 #include <Commons/Exception.h>
21 #include <dpl/log/log.h>
22
23 namespace DeviceAPI {
24 namespace Calendar {
25
26 EventRecurrenceRule::EventRecurrenceRule()
27 {
28     m_frequency = NO_RECURRENCE;
29     m_interval = DEFAULT_INTERVAL;
30     m_endDate = UNDEFINED_TIME;
31     m_occurrenceCount = -1;
32     StringArrayPtr stringArrayPtr(new StringArray());
33     m_daysOfTheWeek = stringArrayPtr;
34     NumberArrayPtr numberArraySetPositionsPtr(new NumberArray());
35     m_setPositions = numberArraySetPositionsPtr;
36     NumberArrayPtr numberArrayExceptionsPtr(new NumberArray());
37     m_exceptions = numberArrayExceptionsPtr;
38     m_timeZone = DEFAULT_TIMEZONE;
39 }
40
41 EventRecurrenceRule::~EventRecurrenceRule()
42 {
43 }
44
45 EventRecurrenceRule::EventRecurrence EventRecurrenceRule::getFrequency() const
46 {
47     return m_frequency;
48 }
49
50 void EventRecurrenceRule::setFrequency(const EventRecurrenceRule::EventRecurrence &value)
51 {
52     m_frequency = value;
53 }
54
55 int EventRecurrenceRule::getInterval() const
56 {
57     return m_interval;
58 }
59
60 void EventRecurrenceRule::setInterval(const int &value)
61 {
62     m_interval = value;
63 }
64
65 long long int EventRecurrenceRule::getEndDate() const
66 {
67     return m_endDate;
68 }
69
70 void EventRecurrenceRule::setEndDate(long long int value)
71 {
72     m_endDate = value;
73 }
74
75 long EventRecurrenceRule::getOccurrenceCount() const
76 {
77     return m_occurrenceCount;
78 }
79 void EventRecurrenceRule::setOccurrenceCount(long value)
80 {
81     m_occurrenceCount = value;
82 }
83
84 std::vector<int> EventRecurrenceRule::getDaysOfTheMonth() const
85 {
86     return m_daysOfTheMonth;
87 }
88
89 void EventRecurrenceRule::setDaysOfTheMonth(std::vector<int> value)
90 {
91     m_daysOfTheMonth = value;
92 }
93
94 StringArrayPtr EventRecurrenceRule::getDaysOfTheWeek() const
95 {
96     return m_daysOfTheWeek;
97 }
98
99 void EventRecurrenceRule::setDaysOfTheWeek(StringArrayPtr value)
100 {
101     m_daysOfTheWeek = value;
102 }
103
104 std::vector<int> EventRecurrenceRule::getDaysOfTheYear() const
105 {
106     return m_daysOfTheYear;
107 }
108
109 void EventRecurrenceRule::setDaysOfTheYear(std::vector<int> value)
110 {
111     m_daysOfTheYear = value;
112 }
113
114 std::vector<int> EventRecurrenceRule::getWeeksOfTheYear() const
115 {
116     return m_weeksOfTheYear;
117 }
118
119 void EventRecurrenceRule::setWeeksOfTheYear(std::vector<int> value)
120 {
121     m_weeksOfTheYear = value;
122 }
123
124 NumberArrayPtr EventRecurrenceRule::getSetPositions() const
125 {
126     return m_setPositions;
127 }
128
129 void EventRecurrenceRule::setSetPositions(NumberArrayPtr value)
130 {
131     m_setPositions = value;
132 }
133
134 NumberArrayPtr EventRecurrenceRule::getExceptions() const
135 {
136     return m_exceptions;
137 }
138
139 void EventRecurrenceRule::setExceptions(NumberArrayPtr value)
140 {
141     m_exceptions = value;
142 }
143
144 std::string EventRecurrenceRule::getTimeZone() const
145 {
146     return m_timeZone;
147 }
148
149 void EventRecurrenceRule::setTimeZone(std::string value)
150 {
151     m_timeZone = value;
152 }
153
154 }
155 }