tizen beta release
[framework/web/wrt-plugins-common.git] / src / Commons / WrtWrapper / WrtCamera.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      Grzegorz Krawczyk (g.krawczyk@samsung.com)
18  * @version     0.1
19  * @brief
20  */
21
22 #ifndef WRT_PLUGINS_WRT_CAMERA_H_
23 #define WRT_PLUGINS_WRT_CAMERA_H_
24
25 #include <string>
26 #include <dpl/shared_ptr.h>
27 #include <wrt_plugin_export.h>
28 #include "IWrtCamera.h"
29 //#include <API/Camera/ICamera.h>
30
31 namespace WrtDeviceApis {
32 namespace Commons {
33
34 class WrtCamera : public IWrtCamera
35 {
36
37 public:
38     typedef void* CameraInstance;
39
40 public:
41     WrtCamera(int widgetId,
42               const engine_interface_t* interface,
43               CameraInstance camera,
44               camera_type type);
45
46     virtual void createPreviewNode(CameraPreviewSuccessCb successCallback,
47                                    CameraErrorCb errorCallback,
48                                    SetPendingOperationCb setPendingOperationCb,
49                                    void* user_data);
50
51     virtual void captureImage(const std::string& filename,
52                               bool highRes,
53                               CameraCaptureSuccessCb successCallback,
54                               CameraErrorCb errorCallback,
55                               SetPendingOperationCb setPendingOperationCb,
56                               void* user_data);
57
58     virtual void startVideoCapture(const std::string& filename,
59                            bool highRes,
60                            CameraCaptureSuccessCb successCallback,
61                            CameraErrorCb errorCallback,
62                            SetPendingOperationCb setPendingOperationCb,
63                            void* user_data);
64
65     virtual void stopVideoCapture();
66
67     virtual void cancelAsyncOperation(const CameraPendingOperation& operation);
68
69     /**
70      * virtual destructor
71      */
72     virtual ~WrtCamera();
73
74 private:
75     int m_widgetId;
76
77     const engine_interface_t* m_wrt;
78
79     CameraInstance m_camera;
80 };
81
82 typedef DPL::SharedPtr<WrtCamera> WrtCameraPtr;
83
84 }
85 } // WrtDeviceApisCommon
86
87 #endif
88