merge wrt-plugins-tizen_0.2.0-12
[profile/ivi/wrt-plugins-tizen.git] / src / platform / API / Calendar / IEventFindEvents.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
18 #ifndef _ABSTRACT_LAYER_IEVENT_FIND_EVENTS_H_
19 #define _ABSTRACT_LAYER_IEVENT_FIND_EVENTS_H_
20
21 #include <vector>
22 #include <Commons/IEvent.h>
23 #include "CalendarEvent.h"
24 #include "EventFilter.h"
25 #include <API/Filter/IFilter.h>
26 #include <API/Filter/SortMode.h>
27 #include <dpl/shared_ptr.h>
28
29 namespace TizenApis {
30 namespace Api {
31 namespace Calendar {
32
33 class IEventFindEvents : public WrtDeviceApis::Commons::IEvent<IEventFindEvents>
34 {
35     /* user is responsible to free objects inside list */
36     CalendarEventListPtr m_events;
37     bool m_result;
38     EventFilterPtr m_filter;
39     CalendarEvent::CalendarType m_calendarType;
40
41         /* generic filter parameters */
42         Tizen::FilterPtr                        m_genericFilter;
43         Tizen::SortModeArrayPtr m_sortModes;
44         std::vector<std::string>                m_attributesOfInterest;
45         bool    m_genericFilterIsSet;
46         bool    m_sortModesIsSet;
47         bool    m_attributesOfInterestIsSet;
48
49   public:
50     void                        setFilter(EventFilterPtr value)
51     {
52         m_filter = value;
53     }
54     EventFilterPtr              getFilter() const
55     {
56         return m_filter;
57     }
58
59     void                        setResult(bool value)
60     {
61         m_result = value;
62     }
63     bool                        getResult() const
64     {
65         return m_result;
66     }
67
68     void setCalendarType(CalendarEvent::CalendarType value)
69     {
70         m_calendarType = value;
71     }
72     CalendarEvent::CalendarType getCalendarType() const
73     {
74         return m_calendarType;
75     }
76
77     void                        addEvent(CalendarEventPtr value)
78     {
79         m_events->push_back(value);
80     }
81
82     CalendarEventListPtr getEvents()
83     {
84         return m_events;
85     }
86
87         Tizen::FilterPtr getGenericFilter() const
88         {
89                 return m_genericFilter;
90         }
91
92         void setGenericFilter(const Tizen::FilterPtr &value)
93         {
94                 m_genericFilter = value;
95                 m_genericFilterIsSet = true;
96         }
97
98         Tizen::SortModeArrayPtr getSortModes() const
99         {
100                 return m_sortModes;
101         }
102
103         void setSortModes(const Tizen::SortModeArrayPtr &value)
104         {
105                 m_sortModes = value;
106                 m_sortModesIsSet = true;
107         }
108
109         std::vector<std::string> getAttributesOfInterest() const
110         {
111                 return m_attributesOfInterest;
112         }
113
114         void setAttributesOfInterest(const std::vector<std::string> &value)
115         {
116                 m_attributesOfInterest = value;
117                 m_attributesOfInterestIsSet = true;
118         }
119
120         bool getGenericFilterIsSet() const
121         {
122                 return m_genericFilterIsSet;
123         }
124
125         bool getSortModesIsSet() const
126         {
127                 return m_sortModesIsSet;
128         }
129
130         bool getAttributesOfInterestIsSet() const
131         {
132                 return m_attributesOfInterestIsSet;
133         }
134
135     IEventFindEvents() : m_result(false),
136             m_calendarType(CalendarEvent::EVENT_TYPE),
137         m_genericFilterIsSet(false),
138         m_sortModesIsSet(false),
139         m_attributesOfInterestIsSet(false)
140     {
141         CalendarEventListPtr events(new CalendarEventList());
142         m_events = events;
143     }
144     ~IEventFindEvents()
145     {
146     }
147     virtual void clearOnCancel()
148     {
149     }
150 };
151
152 typedef DPL::SharedPtr<IEventFindEvents> IEventFindEventsPtr;
153
154 }
155 }
156 }
157 #endif /* _ABSTRACT_LAYER_IEVENT_FIND_EVENTS_H_ */