|
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 CxeSnapshotControl; |
|
27 class CxeCameraDevice; |
|
28 |
|
29 |
|
30 /*! |
|
31 * Snapshot control private implementation. |
|
32 */ |
|
33 class CxeSnapshotControlPrivate : public CxeStateMachine |
|
34 { |
|
35 private: |
|
36 CxeSnapshotControlPrivate(CxeSnapshotControl *parent, CxeCameraDevice &device); |
|
37 virtual ~CxeSnapshotControlPrivate(); |
|
38 |
|
39 protected: // from CxeStateMachine |
|
40 void handleStateChanged(int newStateId, CxeError::Id error); |
|
41 |
|
42 private: |
|
43 CxeSnapshotControl::State state() const; |
|
44 void initializeStates(); |
|
45 QSize calculateSnapshotSize(const QSize &displaySize, Cxe::AspectRatio aspectRatio) const; |
|
46 void start(const QSize &size); |
|
47 void stop(); |
|
48 void handleCameraEvent(int id, int error); |
|
49 QImage snapshot(); |
|
50 |
|
51 private: |
|
52 CxeSnapshotControl *q; |
|
53 CxeCameraDevice &mDevice; |
|
54 |
|
55 friend class CxeSnapshotControl; |
|
56 }; |
|
57 |
|
58 #endif // CXESNAPSHOTCONTROLPRIVATE_H |