790e6302f52cd382b39bd15e72fa91d218addb2c
[framework/web/wrt-plugins-common.git] / src / modules / API / Calendar / EventFindEvents.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  * @author      Lukasz Marek (l.marek@samsung.com)
18  * @version     0.1
19  * @brief
20  */
21
22 #ifndef WRTDEVICEAPIS_CALENDAR_IEVENT_FIND_EVENTS_H_
23 #define WRTDEVICEAPIS_CALENDAR_IEVENT_FIND_EVENTS_H_
24
25 #include <vector>
26 #include <dpl/shared_ptr.h>
27 #include <Commons/IEvent.h>
28 #include <Calendar/CalendarEvent.h>
29 #include <Calendar/EventFilter.h>
30
31 namespace WrtDeviceApis {
32 namespace Calendar {
33 namespace Api {
34
35 class EventFindEvents : public Commons::IEvent<EventFindEvents>
36 {
37     /* user is responsible to free objects inside list */
38     std::vector<CalendarEventPtr> m_events;           //OUTPUT: result list
39     bool m_result;                                  //OUTPUT: operation result
40     EventFilterPtr m_filter;                        //INPUT: filters
41     int m_firstEvent;                               //INPUT: index of first found event to include on list
42     int m_lastEvent;                                //INPUT: index of last found event to include on list
43   public:
44     void                        setFirstEvent(int value)
45     {
46         m_firstEvent = value;
47     }
48     int                         getFirstEvent() const
49     {
50         return m_firstEvent;
51     }
52     void                        setLastEvent(int value)
53     {
54         m_lastEvent = value;
55     }
56     int                         getLastEvent() const
57     {
58         return m_lastEvent;
59     }
60     void                        setFilter(EventFilterPtr value)
61     {
62         m_filter = value;
63     }
64     EventFilterPtr              getFilter() const
65     {
66         return m_filter;
67     }
68     void                        setResult(bool value)
69     {
70         m_result = value;
71     }
72     bool                        getResult() const
73     {
74         return m_result;
75     }
76     void                        addEvent(CalendarEventPtr value)
77     {
78         m_events.push_back(value);
79     }
80     std::vector<CalendarEventPtr> getEvents()
81     {
82         return m_events;
83     }
84     EventFindEvents() : m_result(false),
85         m_firstEvent(0),
86         m_lastEvent(-1)
87     {
88     }
89     ~EventFindEvents()
90     {
91     }
92     virtual void clearOnCancel()
93     {
94     }
95 };
96
97 typedef DPL::SharedPtr<EventFindEvents> EventFindEventsPtr;
98
99 }
100 }
101 }
102
103 #endif // WRTDEVICEAPIS_CALENDAR_IEVENT_FIND_EVENTS_H_