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