Git Init
[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
40         /* generic filter parameters */
41         Tizen::FilterPtr                        m_genericFilter;
42         Tizen::SortModeArrayPtr m_sortModes;
43         std::vector<std::string>                m_attributesOfInterest;
44         bool    m_genericFilterIsSet;
45         bool    m_sortModesIsSet;
46         bool    m_attributesOfInterestIsSet;
47
48   public:
49     void                        setFilter(EventFilterPtr value)
50     {
51         m_filter = value;
52     }
53     EventFilterPtr              getFilter() const
54     {
55         return m_filter;
56     }
57
58     void                        setResult(bool value)
59     {
60         m_result = value;
61     }
62     bool                        getResult() const
63     {
64         return m_result;
65     }
66
67     void                        addEvent(CalendarEventPtr value)
68     {
69         m_events->push_back(value);
70     }
71
72     CalendarEventListPtr getEvents()
73     {
74         return m_events;
75     }
76
77         Tizen::FilterPtr getGenericFilter() const
78         {
79                 return m_genericFilter;
80         }
81
82         void setGenericFilter(const Tizen::FilterPtr &value)
83         {
84                 m_genericFilter = value;
85                 m_genericFilterIsSet = true;
86         }
87
88         Tizen::SortModeArrayPtr getSortModes() const
89         {
90                 return m_sortModes;
91         }
92
93         void setSortModes(const Tizen::SortModeArrayPtr &value)
94         {
95                 m_sortModes = value;
96                 m_sortModesIsSet = true;
97         }
98
99         std::vector<std::string> getAttributesOfInterest() const
100         {
101                 return m_attributesOfInterest;
102         }
103
104         void setAttributesOfInterest(const std::vector<std::string> &value)
105         {
106                 m_attributesOfInterest = value;
107                 m_attributesOfInterestIsSet = true;
108         }
109
110         bool getGenericFilterIsSet() const
111         {
112                 return m_genericFilterIsSet;
113         }
114
115         bool getSortModesIsSet() const
116         {
117                 return m_sortModesIsSet;
118         }
119
120         bool getAttributesOfInterestIsSet() const
121         {
122                 return m_attributesOfInterestIsSet;
123         }
124
125     IEventFindEvents() : m_result(false),
126         m_genericFilterIsSet(false),
127         m_sortModesIsSet(false),
128         m_attributesOfInterestIsSet(false)
129     {
130         CalendarEventListPtr events(new CalendarEventList());
131         m_events = events;
132     }
133     ~IEventFindEvents()
134     {
135     }
136     virtual void clearOnCancel()
137     {
138     }
139 };
140
141 typedef DPL::SharedPtr<IEventFindEvents> IEventFindEventsPtr;
142
143 }
144 }
145 }
146 #endif /* _ABSTRACT_LAYER_IEVENT_FIND_EVENTS_H_ */