|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef CXEFAKECAMERADEVICECONTROL_H |
|
18 #define CXEFAKECAMERADEVICECONTROL_H |
|
19 |
|
20 // Include Files |
|
21 |
|
22 #include <QObject> |
|
23 |
|
24 #include "cxecameradevicecontrol.h" |
|
25 #include "cxenamespace.h" |
|
26 #include "cxeerror.h" |
|
27 |
|
28 #include "ecam.h" |
|
29 |
|
30 class CxeFakeCameraDeviceControl : public CxeCameraDeviceControl, |
|
31 public MCameraObserver2 |
|
32 { |
|
33 Q_OBJECT |
|
34 |
|
35 public: |
|
36 |
|
37 CxeFakeCameraDeviceControl(); |
|
38 virtual ~CxeFakeCameraDeviceControl(); |
|
39 |
|
40 public: // from CxeCameraDeviceControl |
|
41 Cxe::CameraMode mode() const; |
|
42 void setMode(Cxe::CameraMode mode); |
|
43 void init(); |
|
44 void reserve(); |
|
45 void release(); |
|
46 Cxe::CameraIndex cameraIndex() const; |
|
47 CxeError::Id switchCamera(Cxe::CameraIndex index); |
|
48 CxeCameraDeviceControl::State state() const; |
|
49 |
|
50 public: // methods for unit testing |
|
51 enum MethodIndex |
|
52 { |
|
53 SetMode, |
|
54 Reserve, |
|
55 Release, |
|
56 SwitchCamera |
|
57 }; |
|
58 |
|
59 void setState(CxeCameraDeviceControl::State newState); |
|
60 QList<MethodIndex> callHistory() const; |
|
61 void resetCallHistory(); |
|
62 |
|
63 protected: // from MCameraObserver2 |
|
64 void HandleEvent(const TECAMEvent &aEvent); |
|
65 void ViewFinderReady(MCameraBuffer &aCameraBuffer, TInt aError); |
|
66 void ImageBufferReady(MCameraBuffer &aCameraBuffer, TInt aError); |
|
67 void VideoBufferReady(MCameraBuffer &aCameraBuffer, TInt aError); |
|
68 |
|
69 private: |
|
70 Cxe::CameraIndex mCameraIndex; |
|
71 Cxe::CameraMode mCameraMode; |
|
72 QList<MethodIndex> mCallHistory; |
|
73 CxeCameraDeviceControl::State mState; |
|
74 }; |
|
75 |
|
76 #endif // CXEFAKECAMERADEVICECONTROL_H |
|
77 |