1 /* |
|
2 * Copyright (c) 2009-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 CXUISTILLPRECAPTUREVIEW_H |
|
18 #define CXUISTILLPRECAPTUREVIEW_H |
|
19 |
|
20 #include <QMetaType> |
|
21 |
|
22 #include "cxuiprecaptureview.h" |
|
23 #include "cxeautofocuscontrol.h" |
|
24 #include "cxeviewfindercontrol.h" |
|
25 #include "cxestillcapturecontrol.h" |
|
26 #include "cxeerror.h" |
|
27 #include "cxenamespace.h" |
|
28 class HbListWidgetItem; |
|
29 class HbListWidget; |
|
30 class CxuiCaptureKeyHandler; |
|
31 class CxuiDocumentLoader; |
|
32 class HbAction; |
|
33 class HbDialog; |
|
34 class CxuiSelfTimer; |
|
35 class HbPushButton; |
|
36 class HbLabel; |
|
37 class CxuiSelfTimerRadioButtonList; |
|
38 class HbToolBarExtension; |
|
39 class HbWidget; |
|
40 |
|
41 /** |
|
42 * Pre-capture view for still image mode |
|
43 */ |
|
44 class CxuiStillPrecaptureView : public CxuiPrecaptureView |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 CxuiStillPrecaptureView(QGraphicsItem *parent = 0); |
|
50 |
|
51 virtual ~CxuiStillPrecaptureView(); |
|
52 |
|
53 public: |
|
54 |
|
55 virtual void construct(HbMainWindow *mainwindow, |
|
56 CxeEngine *engine, |
|
57 CxuiDocumentLoader *documentLoader, |
|
58 CxuiCaptureKeyHandler *keyHandler, |
|
59 HbActivityManager *activityManager); |
|
60 |
|
61 virtual void loadDefaultWidgets(); |
|
62 virtual void loadWidgets(); |
|
63 |
|
64 void restoreActivity(const QString &activityId, const QVariant &data); |
|
65 void saveActivity(); |
|
66 void clearActivity(); |
|
67 |
|
68 protected: |
|
69 |
|
70 void showEvent(QShowEvent *event); |
|
71 virtual bool allowShowControls() const; |
|
72 |
|
73 public slots: |
|
74 |
|
75 // from CxuiPrecaptureView |
|
76 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
|
77 |
|
78 void handleSceneChanged(const QVariant &newSceneData); |
|
79 |
|
80 // From CxuiPrecaptureView |
|
81 virtual void enterStandby(); |
|
82 |
|
83 protected slots: |
|
84 void focusAndCapture(); |
|
85 void capture(); |
|
86 void setCapturePending(); |
|
87 void goToVideo(); |
|
88 |
|
89 // Key events |
|
90 void handleCaptureKeyPressed(); |
|
91 void handleAutofocusKeyPressed(); |
|
92 void handleAutofocusKeyReleased(); |
|
93 |
|
94 // Engine signals |
|
95 void handleAutoFocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error); |
|
96 void handleViewfinderStateChanged(CxeViewfinderControl::State newState, CxeError::Id error); |
|
97 void handleStillCaptureStateChanged(CxeStillCaptureControl::State newState, CxeError::Id error); |
|
98 void handleSnapshot(CxeError::Id error); |
|
99 |
|
100 void resetCapturePendingFlag(); |
|
101 |
|
102 void launchSetting(); |
|
103 void updateImagesLeftLabel(); |
|
104 |
|
105 protected: |
|
106 void initializeSettingsGrid(); |
|
107 bool isPostcaptureOn() const; |
|
108 void updateSceneIcon(const QString& sceneId); |
|
109 void updateQualityIcon(); |
|
110 void closeDialogs(); |
|
111 void updateFaceTrackingIcon(); |
|
112 |
|
113 private: |
|
114 void reloadIndicatorWidgets(); |
|
115 |
|
116 protected: |
|
117 CxuiSelfTimer *mSelfTimer; |
|
118 HbAction *mFlashSetting; |
|
119 HbDialog *mStillSettingsPopup; |
|
120 HbDialog *mSceneModePopup; |
|
121 |
|
122 /** |
|
123 * Capture key was pressed while engine was not ready... Capture when possible. |
|
124 * This flag is reset after a short delay at resetCapturePendingFlag(). |
|
125 */ |
|
126 bool mCapturePending; |
|
127 HbLabel *mImagesLeft; |
|
128 HbWidget *mImagesLeftContainer; |
|
129 |
|
130 private: |
|
131 bool mPendingAfCanceling; |
|
132 }; |
|
133 |
|
134 Q_DECLARE_METATYPE(QList<int>) |
|
135 |
|
136 #endif // CXUISTILLPRECAPTUREVIEW_H |
|