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 #ifndef CXESTILLCAPTURECONTROLDESKTOP_H |
|
18 #define CXESTILLCAPTURECONTROLDESKTOP_H |
|
19 |
|
20 #include <QList> |
|
21 #include <QVariant> |
|
22 |
|
23 #include "cxestillcapturecontrol.h" |
|
24 #include "cxeimagedataqueuedesktop.h" |
|
25 #include "cxenamespace.h" |
|
26 #include "cxeerror.h" |
|
27 #include "cxeautofocuscontrol.h" |
|
28 |
|
29 class CxeFilenameGenerator; |
|
30 class CxeFileSaveThread; |
|
31 class CxeStillImageDesktop; |
|
32 class CxeViewfinderControl; |
|
33 class CxeCameraDeviceControl; |
|
34 class CxeCameraDeviceDesktop; |
|
35 |
|
36 |
|
37 |
|
38 /** |
|
39 * Class CxeStillCaptureControlSymbian. |
|
40 * Inherits/implements CxeStillCaptureControl. |
|
41 */ |
|
42 class CxeStillCaptureControlDesktop : public CxeStillCaptureControl |
|
43 { |
|
44 Q_OBJECT |
|
45 |
|
46 public: // constructors |
|
47 |
|
48 CxeStillCaptureControlDesktop(CxeCameraDeviceDesktop &cameraDevice, |
|
49 CxeViewfinderControl &viewfinderControl, |
|
50 CxeCameraDeviceControl &cameraDeviceControl, |
|
51 CxeFilenameGenerator &nameGenerator, |
|
52 CxeAutoFocusControl &autoFocusControl, |
|
53 CxeFileSaveThread &saveThread); |
|
54 |
|
55 virtual ~CxeStillCaptureControlDesktop(); |
|
56 |
|
57 public: // from CxeStillCaptureControl |
|
58 |
|
59 void capture(); |
|
60 State state() const; |
|
61 int imageCount() const; |
|
62 void reset(); |
|
63 void cancelAll(); |
|
64 void setMode(CaptureMode mode); |
|
65 CaptureMode mode() const; |
|
66 CxeStillImage &operator[](int index); |
|
67 CxeImageDataQueue &imageDataQueue(); |
|
68 QList<CxeImageDetails> supportedImageQualities(); |
|
69 int imagesLeft(); |
|
70 |
|
71 signals: |
|
72 void imagePrepareComplete(CxeError::Id error); |
|
73 void prepareZoomForStill(int ecamStillResolutionIndex); |
|
74 |
|
75 public slots: |
|
76 void init(); |
|
77 void deinit(); |
|
78 |
|
79 protected slots: |
|
80 // notifications when camera reference is changed |
|
81 void prepareForCameraDelete(); |
|
82 void handleCameraAllocated(CxeError::Id error); |
|
83 |
|
84 // notification for when camera is released |
|
85 void prepareForRelease(); |
|
86 |
|
87 // settings call back |
|
88 void handleSettingValueChanged(const QString &settingId, QVariant newValue); |
|
89 void handleSceneChanged(CxeScene &scene); |
|
90 |
|
91 // Autofocus events |
|
92 void handleAutofocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error); |
|
93 |
|
94 private: // helper functions |
|
95 void updateFlashSetting(QVariant newValue); |
|
96 void updateISOSetting(QVariant newValue); |
|
97 void updateEVCompensationSetting(QVariant newValue); |
|
98 CxeError::Id prepareFilename(CxeStillImageDesktop *stillImage); |
|
99 void setOrientation(QVariant sensorData); |
|
100 CxeStillImageDesktop *getImageForIndex(int index); |
|
101 int prepareStillSnapshot(); |
|
102 CxeError::Id getImageQualityDetails(CxeImageDetails &imageInfo); |
|
103 void handleSnapshotEvent(CxeError::Id error); |
|
104 void initializeStates(); |
|
105 void prepare(); |
|
106 |
|
107 private: // private data |
|
108 |
|
109 State mState; |
|
110 CxeImageDataQueueDesktop *mImageDataQueue; // own |
|
111 CxeCameraDeviceDesktop &mCameraDevice; |
|
112 CxeViewfinderControl &mViewfinderControl; |
|
113 CxeCameraDeviceControl &mCameraDeviceControl; |
|
114 CxeFilenameGenerator &mFilenameGenerator; //! @todo could be shared with video capture control? |
|
115 CxeAutoFocusControl &mAutoFocusControl; |
|
116 CaptureMode mMode; |
|
117 CxeAutoFocusControl::State mAfState; |
|
118 QList<CxeStillImageDesktop*> mImages; |
|
119 CxeFileSaveThread &mSaveThread; |
|
120 |
|
121 int mNextSnapshotIndex; |
|
122 int mNextImageDataIndex; |
|
123 //still resolutions supported by ICM |
|
124 QList<CxeImageDetails> mSupportedImageQualities; |
|
125 //still resolutions supported by ecam |
|
126 //current image quality details |
|
127 CxeImageDetails mCurrentImageDetails; |
|
128 }; |
|
129 |
|
130 #endif // CXESTILLCAPTURECONTROLDESKTOP_H |
|