328d4172ba7d26f310d9c01b9a0c75a7fabd5bb2
[framework/web/wrt-plugins-common.git] / src / modules / tizen / Task / TaskManager.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        TaskManager.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_TASKMANAGER_H_
24 #define WRTDEVICEAPIS_TASK_TASKMANAGER_H_
25
26 #include <vector>
27 #include <list>
28 #include <dpl/mutex.h>
29 #include <Task/ITaskManager.h>
30 #include "Task.h"
31
32 namespace WrtDeviceApis {
33 namespace Task {
34
35 class TaskManager : public Api::ITaskManager
36 {
37   public:
38     TaskManager();
39     virtual ~TaskManager();
40     static int getAccountId();
41     static const char* getServiceProviderName();
42   protected:
43     std::list<Api::ITaskPtr> getTasksInternal();
44     virtual void OnRequestReceived(const Api::IEventGetTasksPtr &task);
45
46   private:
47     static int m_instanceCount;
48     DPL::Mutex m_constructorMutex;
49 };
50
51 }
52 }
53
54 #endif // WRTDEVICEAPIS_TASK_TASKMANAGER_H_