2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include "EventFilter.h"
17 #include <dpl/log/log.h>
20 * @file EventFilter.cpp
21 * @author Lukasz Marek (l.marek@samsung.com)
25 namespace WrtDeviceApis {
29 EventFilter::EventFilter()
33 EventFilter::~EventFilter()
37 std::string EventFilter::getIdFilter() const
42 void EventFilter::setIdFilter(const std::string &value)
47 int EventFilter::getCalendarIdFilter() const
52 void EventFilter::setCalendarIdFilter(int value)
57 std::string EventFilter::getDescriptionFilter() const
59 return *m_description;
62 void EventFilter::setDescriptionFilter(const std::string &value)
64 m_description = value;
67 std::string EventFilter::getSubjectFilter() const
72 void EventFilter::setSubjectFilter(const std::string &value)
77 time_t EventFilter::getStartTimeMinFilter() const
79 return *m_startTimeMin;
82 time_t EventFilter::getStartTimeMaxFilter() const
84 return *m_startTimeMax;
87 void EventFilter::setStartTimeMinFilter(time_t value)
89 m_startTimeMin = value;
92 void EventFilter::setStartTimeMaxFilter(time_t value)
94 m_startTimeMax = value;
97 void EventFilter::setStartTimeFilter(time_t value)
99 setStartTimeMinFilter(value);
100 setStartTimeMaxFilter(value);
103 time_t EventFilter::getEndTimeMinFilter() const
105 return *m_endTimeMin;
108 time_t EventFilter::getEndTimeMaxFilter() const
110 return *m_endTimeMax;
113 void EventFilter::setEndTimeMinFilter(time_t value)
115 m_endTimeMin = value;
118 void EventFilter::setEndTimeMaxFilter(time_t value)
120 m_endTimeMax = value;
123 void EventFilter::setEndTimeFilter(time_t value)
125 setEndTimeMinFilter(value);
126 setEndTimeMaxFilter(value);
129 std::string EventFilter::getLocationFilter() const
134 void EventFilter::setLocationFilter(const std::string &value)
139 std::vector<CalendarEvent::EventRecurrence> EventFilter::getRecurrenceFilter()
145 void EventFilter::addRecurrenceFilter(CalendarEvent::EventRecurrence value)
147 m_recurrence.push_back(value);
150 std::vector<CalendarEvent::EventStatus> EventFilter::getStatusFilter() const
155 void EventFilter::addStatusFilter(CalendarEvent::EventStatus value)
157 m_status.push_back(value);
160 time_t EventFilter::getAlarmTimeMinFilter() const
162 return *m_alarmTimeMin;
165 time_t EventFilter::getAlarmTimeMaxFilter() const
167 return *m_alarmTimeMax;
170 void EventFilter::setAlarmTimeMinFilter(time_t value)
172 m_alarmTimeMin = value;
175 void EventFilter::setAlarmTimeMaxFilter(time_t value)
177 m_alarmTimeMax = value;
180 void EventFilter::setAlarmTimeFilter(time_t value)
182 setAlarmTimeMinFilter(value);
183 setAlarmTimeMaxFilter(value);
186 std::vector<CalendarEvent::EventAlarmType> EventFilter::getAlarmTypeFilter()
192 void EventFilter::addAlarmTypeFilter(CalendarEvent::EventAlarmType value)
194 m_alarmType.push_back(value);
197 std::string EventFilter::getCategoryFilter() const
202 void EventFilter::setCategoryFilter(const std::string &category)
204 m_category = category;
207 bool EventFilter::getIdIsSet() const
209 return !m_id.IsNull();
212 bool EventFilter::getCalendarIdIsSet() const
214 return !m_calendarId.IsNull();
217 bool EventFilter::getDescriptionIsSet() const
219 return !m_description.IsNull();
222 bool EventFilter::getSubjectIsSet() const
224 return !m_subject.IsNull();
227 bool EventFilter::getStartTimeMinIsSet() const
229 return !m_startTimeMin.IsNull();
232 bool EventFilter::getStartTimeMaxIsSet() const
234 return !m_startTimeMax.IsNull();
237 bool EventFilter::getEndTimeMinIsSet() const
239 return !m_endTimeMin.IsNull();
242 bool EventFilter::getEndTimeMaxIsSet() const
244 return !m_endTimeMax.IsNull();
247 bool EventFilter::getLocationIsSet() const
249 return !m_location.IsNull();
252 bool EventFilter::getRecurrenceIsSet() const
254 return !m_recurrence.empty();
257 bool EventFilter::getStatusIsSet() const
259 return !m_status.empty();
262 bool EventFilter::getAlarmTimeMinIsSet() const
264 return !m_alarmTimeMin.IsNull();
267 bool EventFilter::getAlarmTimeMaxIsSet() const
269 return !m_alarmTimeMax.IsNull();
272 bool EventFilter::getAlarmTypeIsSet() const
274 return !m_alarmType.empty();
277 bool EventFilter::getCategoryIsSet() const
279 return !m_category.IsNull();