2cf25de65598a978138fdc73c9557a2e9dc1642e
[framework/web/wrt-plugins-common.git] / src / modules / API / Calendar / EventFilter.cpp
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 #include "EventFilter.h"
17 #include <dpl/log/log.h>
18
19 /**
20  * @file        EventFilter.cpp
21  * @author      Lukasz Marek (l.marek@samsung.com)
22  * @version     0.1
23  */
24
25 namespace WrtDeviceApis {
26 namespace Calendar {
27 namespace Api {
28
29 EventFilter::EventFilter()
30 {
31 }
32
33 EventFilter::~EventFilter()
34 {
35 }
36
37 std::string EventFilter::getIdFilter() const
38 {
39     return *m_id;
40 }
41
42 void EventFilter::setIdFilter(const std::string &value)
43 {
44     m_id = value;
45 }
46
47 int EventFilter::getCalendarIdFilter() const
48 {
49     return *m_calendarId;
50 }
51
52 void EventFilter::setCalendarIdFilter(int value)
53 {
54     m_calendarId = value;
55 }
56
57 std::string EventFilter::getDescriptionFilter() const
58 {
59     return *m_description;
60 }
61
62 void EventFilter::setDescriptionFilter(const std::string &value)
63 {
64     m_description = value;
65 }
66
67 std::string EventFilter::getSubjectFilter() const
68 {
69     return *m_subject;
70 }
71
72 void EventFilter::setSubjectFilter(const std::string &value)
73 {
74     m_subject = value;
75 }
76
77 time_t EventFilter::getStartTimeMinFilter() const
78 {
79     return *m_startTimeMin;
80 }
81
82 time_t EventFilter::getStartTimeMaxFilter() const
83 {
84     return *m_startTimeMax;
85 }
86
87 void EventFilter::setStartTimeMinFilter(time_t value)
88 {
89     m_startTimeMin = value;
90 }
91
92 void EventFilter::setStartTimeMaxFilter(time_t value)
93 {
94     m_startTimeMax = value;
95 }
96
97 void EventFilter::setStartTimeFilter(time_t value)
98 {
99     setStartTimeMinFilter(value);
100     setStartTimeMaxFilter(value);
101 }
102
103 time_t EventFilter::getEndTimeMinFilter() const
104 {
105     return *m_endTimeMin;
106 }
107
108 time_t EventFilter::getEndTimeMaxFilter() const
109 {
110     return *m_endTimeMax;
111 }
112
113 void EventFilter::setEndTimeMinFilter(time_t value)
114 {
115     m_endTimeMin = value;
116 }
117
118 void EventFilter::setEndTimeMaxFilter(time_t value)
119 {
120     m_endTimeMax = value;
121 }
122
123 void EventFilter::setEndTimeFilter(time_t value)
124 {
125     setEndTimeMinFilter(value);
126     setEndTimeMaxFilter(value);
127 }
128
129 std::string EventFilter::getLocationFilter() const
130 {
131     return *m_location;
132 }
133
134 void EventFilter::setLocationFilter(const std::string &value)
135 {
136     m_location = value;
137 }
138
139 std::vector<CalendarEvent::EventRecurrence> EventFilter::getRecurrenceFilter()
140 const
141 {
142     return m_recurrence;
143 }
144
145 void EventFilter::addRecurrenceFilter(CalendarEvent::EventRecurrence value)
146 {
147     m_recurrence.push_back(value);
148 }
149
150 std::vector<CalendarEvent::EventStatus> EventFilter::getStatusFilter() const
151 {
152     return m_status;
153 }
154
155 void EventFilter::addStatusFilter(CalendarEvent::EventStatus value)
156 {
157     m_status.push_back(value);
158 }
159
160 time_t EventFilter::getAlarmTimeMinFilter() const
161 {
162     return *m_alarmTimeMin;
163 }
164
165 time_t EventFilter::getAlarmTimeMaxFilter() const
166 {
167     return *m_alarmTimeMax;
168 }
169
170 void EventFilter::setAlarmTimeMinFilter(time_t value)
171 {
172     m_alarmTimeMin = value;
173 }
174
175 void EventFilter::setAlarmTimeMaxFilter(time_t value)
176 {
177     m_alarmTimeMax = value;
178 }
179
180 void EventFilter::setAlarmTimeFilter(time_t value)
181 {
182     setAlarmTimeMinFilter(value);
183     setAlarmTimeMaxFilter(value);
184 }
185
186 std::vector<CalendarEvent::EventAlarmType> EventFilter::getAlarmTypeFilter()
187 const
188 {
189     return m_alarmType;
190 }
191
192 void EventFilter::addAlarmTypeFilter(CalendarEvent::EventAlarmType value)
193 {
194     m_alarmType.push_back(value);
195 }
196
197 std::string EventFilter::getCategoryFilter() const
198 {
199     return *m_category;
200 }
201
202 void EventFilter::setCategoryFilter(const std::string &category)
203 {
204     m_category = category;
205 }
206
207 bool EventFilter::getIdIsSet() const
208 {
209     return !m_id.IsNull();
210 }
211
212 bool EventFilter::getCalendarIdIsSet() const
213 {
214     return !m_calendarId.IsNull();
215 }
216
217 bool EventFilter::getDescriptionIsSet() const
218 {
219     return !m_description.IsNull();
220 }
221
222 bool EventFilter::getSubjectIsSet() const
223 {
224     return !m_subject.IsNull();
225 }
226
227 bool EventFilter::getStartTimeMinIsSet() const
228 {
229     return !m_startTimeMin.IsNull();
230 }
231
232 bool EventFilter::getStartTimeMaxIsSet() const
233 {
234     return !m_startTimeMax.IsNull();
235 }
236
237 bool EventFilter::getEndTimeMinIsSet() const
238 {
239     return !m_endTimeMin.IsNull();
240 }
241
242 bool EventFilter::getEndTimeMaxIsSet() const
243 {
244     return !m_endTimeMax.IsNull();
245 }
246
247 bool EventFilter::getLocationIsSet() const
248 {
249     return !m_location.IsNull();
250 }
251
252 bool EventFilter::getRecurrenceIsSet() const
253 {
254     return !m_recurrence.empty();
255 }
256
257 bool EventFilter::getStatusIsSet() const
258 {
259     return !m_status.empty();
260 }
261
262 bool EventFilter::getAlarmTimeMinIsSet() const
263 {
264     return !m_alarmTimeMin.IsNull();
265 }
266
267 bool EventFilter::getAlarmTimeMaxIsSet() const
268 {
269     return !m_alarmTimeMax.IsNull();
270 }
271
272 bool EventFilter::getAlarmTypeIsSet() const
273 {
274     return !m_alarmType.empty();
275 }
276
277 bool EventFilter::getCategoryIsSet() const
278 {
279     return !m_category.IsNull();
280 }
281
282 }
283 }
284 }