b9d732ef12dde3928720f434ead9bfad965ce499
[framework/web/wrt-plugins-common.git] / src / modules / API / Camera / ICameraManager.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      Karol Majewski (k.majewski@samsung.com)
18  * @version     0.1
19  * @brief
20  */
21
22 #ifndef WRTDEVICEAPIS_CAMERA_API_ICAMERAMANAGER_H_
23 #define WRTDEVICEAPIS_CAMERA_API_ICAMERAMANAGER_H_
24
25 #include <vector>
26 #include <dpl/log/log.h>
27 #include <Commons/ThreadPool.h>
28 #include <Commons/EventReceiver.h>
29 #include "EventGetCameras.h"
30 #include "ICamera.h"
31
32 namespace WrtDeviceApis {
33 namespace Camera {
34 namespace Api {
35
36 typedef Commons::EventRequestReceiver<EventGetCameras>
37     EventSupportGetCameras;
38
39 class ICameraManager : public EventSupportGetCameras
40 {
41 public:
42     /**
43      * Gets cameras
44      */
45     virtual void getCameras(const EventGetCamerasPtr &event)
46     {
47         LogDebug(__FUNCTION__);
48         PostRequest(event);
49     }
50
51     virtual ~ICameraManager() {}
52
53 protected:
54     ICameraManager() : EventSupportGetCameras(Thread::CAMERA_THREAD)
55     {}
56
57     virtual void OnRequestReceived(const EventGetCamerasPtr &event) = 0;
58
59 protected:
60     std::vector< ICameraSharedPtr > m_cameras;
61 };
62
63 }//namespace
64 }//namespace
65 }//namespace
66
67 #endif /* */