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 |
|
18 #ifndef CXEFAKEVIDEOCAPTURECONTROL_H |
|
19 #define CXEFAKEVIDEOCAPTURECONTROL_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QMetaType> |
|
23 #include "cxeerror.h" |
|
24 #include "cxevideocapturecontrol.h" |
|
25 #include "cxestatemachine.h" |
|
26 |
|
27 class QPixmap; |
|
28 |
|
29 class CxeFakeVideoCaptureControl : public CxeVideoCaptureControl, |
|
30 public CxeStateMachine |
|
31 { |
|
32 Q_OBJECT |
|
33 public: |
|
34 CxeFakeVideoCaptureControl(); |
|
35 virtual ~CxeFakeVideoCaptureControl(); |
|
36 |
|
37 State state() const; |
|
38 void record(); |
|
39 void pause(); |
|
40 void stop(); |
|
41 void remainingTime(int &time); |
|
42 bool elapsedTime(int &time); |
|
43 void reset(); |
|
44 QString filename() const; |
|
45 QPixmap snapshot() const; |
|
46 QList<CxeVideoDetails> supportedVideoQualities(); |
|
47 |
|
48 protected: |
|
49 void handleStateChanged(int newStateId, CxeError::Id error); |
|
50 void initializeStates(); |
|
51 |
|
52 public slots: |
|
53 void init(); |
|
54 void deinit(); |
|
55 |
|
56 public: // methods for unit testing |
|
57 enum MethodIndex |
|
58 { |
|
59 Capture, |
|
60 Reset, |
|
61 CancelAll, |
|
62 SetMode, |
|
63 Init, |
|
64 Deinit |
|
65 }; |
|
66 |
|
67 void setState(CxeVideoCaptureControl::State newState); |
|
68 QList<MethodIndex> callHistory() const; |
|
69 void resetCallHistory(); |
|
70 |
|
71 private: // data |
|
72 QList<MethodIndex> mCallHistory; |
|
73 }; |
|
74 |
|
75 #endif // CXEFAKEVIDEOCAPTURECONTROL_H |
|