a829570c397f71d6d6bacb890263e941d3cf2520
[framework/web/wrt-plugins-common.git] / src / modules / API / Calendar / EventFilter.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  * @file        EventFilter.h
18  * @author      Lukasz Marek (l.marek@samsung.com)
19  * @version     0.1
20  */
21
22 #ifndef WRTDEVICEAPIS_CALENDAR_IEVENT_FILTER_H_
23 #define WRTDEVICEAPIS_CALENDAR_IEVENT_FILTER_H_
24
25 #include <ctime>
26 #include <string>
27 #include <vector>
28 #include <dpl/shared_ptr.h>
29 #include <dpl/optional.h>
30 #include <Calendar/CalendarEvent.h>
31
32 namespace WrtDeviceApis {
33 namespace Calendar {
34 namespace Api {
35
36 class EventFilter
37 {
38   public:
39
40     EventFilter();
41     virtual ~EventFilter();
42
43     std::string getIdFilter() const;
44     void setIdFilter(const std::string &value);
45
46     int getCalendarIdFilter() const;
47     void setCalendarIdFilter(int value);
48
49     std::string getDescriptionFilter() const;
50     void setDescriptionFilter(const std::string &value);
51
52     std::string getSubjectFilter() const;
53     void setSubjectFilter(const std::string &value);
54
55     std::time_t getStartTimeMinFilter() const;
56     std::time_t getStartTimeMaxFilter() const;
57     void setStartTimeMinFilter(std::time_t value);
58     void setStartTimeMaxFilter(std::time_t value);
59     void setStartTimeFilter(std::time_t value);
60
61     std::time_t getEndTimeMinFilter() const;
62     std::time_t getEndTimeMaxFilter() const;
63     void setEndTimeMinFilter(std::time_t value);
64     void setEndTimeMaxFilter(std::time_t value);
65     void setEndTimeFilter(std::time_t value);
66
67     std::string getLocationFilter() const;
68     void setLocationFilter(const std::string &value);
69
70     std::vector<CalendarEvent::EventRecurrence> getRecurrenceFilter() const;
71     void addRecurrenceFilter(CalendarEvent::EventRecurrence value);
72
73     std::vector<CalendarEvent::EventStatus> getStatusFilter() const;
74     void addStatusFilter(CalendarEvent::EventStatus value);
75
76     std::time_t getAlarmTimeMinFilter() const;
77     std::time_t getAlarmTimeMaxFilter() const;
78     void setAlarmTimeMinFilter(std::time_t value);
79     void setAlarmTimeMaxFilter(std::time_t value);
80     void setAlarmTimeFilter(std::time_t value);
81
82     std::vector<CalendarEvent::EventAlarmType> getAlarmTypeFilter() const;
83     void addAlarmTypeFilter(CalendarEvent::EventAlarmType value);
84
85     std::string getCategoryFilter() const;
86     void setCategoryFilter(const std::string &category);
87
88     bool getIdIsSet() const;
89     bool getCalendarIdIsSet() const;
90     bool getDescriptionIsSet() const;
91     bool getSubjectIsSet() const;
92     bool getStartTimeMinIsSet() const;
93     bool getStartTimeMaxIsSet() const;
94     bool getEndTimeMinIsSet() const;
95     bool getEndTimeMaxIsSet() const;
96     bool getLocationIsSet() const;
97     bool getRecurrenceIsSet() const;
98     bool getStatusIsSet() const;
99     bool getAlarmTimeMinIsSet() const;
100     bool getAlarmTimeMaxIsSet() const;
101     bool getAlarmTypeIsSet() const;
102     bool getCategoryIsSet() const;
103
104   protected:
105     DPL::Optional<std::string> m_id;
106     DPL::Optional<int>         m_calendarId;
107     DPL::Optional<std::string> m_description;
108     DPL::Optional<std::string> m_subject;
109     DPL::Optional<std::time_t> m_startTimeMin;
110     DPL::Optional<std::time_t> m_startTimeMax;
111     DPL::Optional<std::time_t> m_endTimeMin;
112     DPL::Optional<std::time_t> m_endTimeMax;
113     DPL::Optional<std::string> m_location;
114     std::vector<CalendarEvent::EventRecurrence> m_recurrence;
115     std::vector<CalendarEvent::EventStatus>     m_status;
116     std::vector<CalendarEvent::EventAlarmType>  m_alarmType;
117     DPL::Optional<std::time_t> m_alarmTimeMin;
118     DPL::Optional<std::time_t> m_alarmTimeMax;
119     DPL::Optional<std::string> m_category;
120 };
121
122 typedef DPL::SharedPtr<EventFilter> EventFilterPtr;
123
124 }
125 }
126 }
127
128 #endif // WRTDEVICEAPIS_CALENDAR_IEVENT_FILTER_H_