|
1 /* |
|
2 * Copyright (c) 2010 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 CXESNAPSHOTCONTROLPRIVATE_H |
|
19 #define CXESNAPSHOTCONTROLPRIVATE_H |
|
20 |
|
21 |
|
22 #include <QObject> |
|
23 #include "cxeerror.h" |
|
24 #include "cxestatemachine.h" |
|
25 |
|
26 class QPixmap; |
|
27 class CxeSnapshotControl; |
|
28 class CxeCameraDevice; |
|
29 |
|
30 |
|
31 /*! |
|
32 * Snapshot control private implementation. |
|
33 */ |
|
34 class CxeSnapshotControlPrivate : public CxeStateMachine |
|
35 { |
|
36 private: |
|
37 CxeSnapshotControlPrivate(CxeSnapshotControl *parent, CxeCameraDevice &device); |
|
38 virtual ~CxeSnapshotControlPrivate(); |
|
39 |
|
40 protected: // from CxeStateMachine |
|
41 void handleStateChanged(int newStateId, CxeError::Id error); |
|
42 |
|
43 private: |
|
44 CxeSnapshotControl::State state() const; |
|
45 void initializeStates(); |
|
46 QSize calculateSnapshotSize(const QSize &displaySize, const QSize &outputResolution) const; |
|
47 void start(const QSize &size); |
|
48 void stop(); |
|
49 void handleCameraEvent(int id, int error); |
|
50 QPixmap snapshot(); |
|
51 |
|
52 private: |
|
53 CxeSnapshotControl *q; |
|
54 CxeCameraDevice &mDevice; |
|
55 |
|
56 friend class CxeSnapshotControl; |
|
57 }; |
|
58 |
|
59 #endif // CXESNAPSHOTCONTROLPRIVATE_H |