tizen beta release
[framework/web/wrt-plugins-common.git] / src / Commons / WrtWrapper / IWrtCamera.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_INTERFACE_H_
23 #define WRT_PLUGINS_WRT_CAMERA_INTERFACE_H_
24
25 #include<string>
26
27 #include <dpl/shared_ptr.h>
28
29 namespace WrtDeviceApis {
30 namespace Commons {
31
32 class IWrtCamera{
33
34 public:
35     typedef int CameraPendingOperation;
36     typedef void (*SetPendingOperationCb)(CameraPendingOperation,
37                                           void* user_data);
38
39     typedef void* CameraPreviewNode;
40     typedef void (*CameraCaptureSuccessCb)(const char* filename, void* data);
41     typedef void (*CameraPreviewSuccessCb)(CameraPreviewNode node, void* data);
42     typedef void (*CameraErrorCb)(int errorCode, void*);
43
44 public:
45     virtual void createPreviewNode(CameraPreviewSuccessCb successCallback,
46                                    CameraErrorCb errorCallback,
47                                    SetPendingOperationCb setPendingOperationCb,
48                                    void* user_data) = 0;
49
50     virtual void captureImage(const std::string& filename,
51                               bool highRes,
52                               CameraCaptureSuccessCb successCallback,
53                               CameraErrorCb errorCallback,
54                               SetPendingOperationCb setPendingOperationCb,
55                               void* user_data) = 0;
56
57     virtual void startVideoCapture(const std::string& filename,
58                            bool highRes,
59                            CameraCaptureSuccessCb successCallback,
60                            CameraErrorCb errorCallback,
61                            SetPendingOperationCb setPendingOperationCb,
62                            void* user_data) = 0;
63
64     virtual void stopVideoCapture() = 0;
65
66     virtual void cancelAsyncOperation(
67        const IWrtCamera::CameraPendingOperation& pendingOperation) = 0;
68
69     /**
70      * virtual destructor
71      */
72     virtual ~IWrtCamera(){}
73 };
74
75 typedef DPL::SharedPtr<IWrtCamera> IWrtCameraPtr;
76
77 }
78 } // WrtDeviceApisCommon
79
80 #endif