f287ad4a5bf7516685a959828ef8b102ce1c17c0
[framework/web/wrt-plugins-common.git] / src / modules / API / Task / IEventFindTasks.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        IEventFindTasks.h
18  * @author      Shi Hezhang (hezhang.shi@samsung.com)
19  * @author      Pan Rui (r.pan@samsung.com)
20  * @version     0.1
21  */
22
23 #ifndef WRTDEVICEAPIS_TASK_IEVENT_FIND_TASKS_H_
24 #define WRTDEVICEAPIS_TASK_IEVENT_FIND_TASKS_H_
25
26 #include <vector>
27 #include <dpl/shared_ptr.h>
28 #include <Commons/IEvent.h>
29 #include <Task/CalendarTask.h>
30 #include <Task/TaskFilter.h>
31
32 namespace WrtDeviceApis {
33 namespace Task {
34 namespace Api {
35
36 class IEventFindTasks : public Commons::IEvent<IEventFindTasks>
37 {
38     /* user is responsible to free objects inside list */
39     std::vector<CalendarTaskPtr> m_tasks; //OUTPUT: result list
40     bool m_result;                        //OUTPUT: operation result
41     TaskFilterPtr m_filter;               //INPUT: filters
42     int m_firstTask;                      //INPUT: index of first found event to include on list
43     int m_lastTask;                       //INPUT: index of last found event to include on list
44   public:
45     void setFirstTask(int value)
46     {
47         m_firstTask = value;
48     }
49     int getFirstTask() const
50     {
51         return m_firstTask;
52     }
53     void setLastTask(int value)
54     {
55         m_lastTask = value;
56     }
57     int getLastTask() const
58     {
59         return m_lastTask;
60     }
61     void setFilter(TaskFilterPtr value)
62     {
63         m_filter = value;
64     }
65     TaskFilterPtr getFilter() const
66     {
67         return m_filter;
68     }
69     void setResult(bool value)
70     {
71         m_result = value;
72     }
73     bool getResult() const
74     {
75         return m_result;
76     }
77     void addTask(CalendarTaskPtr value)
78     {
79         m_tasks.push_back(value);
80     }
81     std::vector<CalendarTaskPtr> getTasks()
82     {
83         return m_tasks;
84     }
85     IEventFindTasks() : m_result(false),
86         m_firstTask(0),
87         m_lastTask(-1)
88     {
89     }
90     ~IEventFindTasks()
91     {
92     }
93     virtual void clearOnCancel()
94     {
95     }
96 };
97
98 typedef DPL::SharedPtr<IEventFindTasks> IEventFindTasksPtr;
99
100 }
101 }
102 }
103 #endif // WRTDEVICEAPIS_TASK_IEVENT_FIND_TASKS_H_