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 CXUIPRECAPTUREVIEW_H |
|
18 #define CXUIPRECAPTUREVIEW_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <QTimer> |
|
22 #include <QList> |
|
23 #include <hbview.h> |
|
24 #include <hbradiobuttonlist.h> |
|
25 #include <hbframedrawer.h> |
|
26 |
|
27 #include "cxezoomcontrol.h" |
|
28 #include "cxegeotaggingtrail.h" |
|
29 #include "cxeviewfindercontrol.h" |
|
30 #include "cxuidisplaypropertyhandler.h" |
|
31 #include "cxuiview.h" |
|
32 |
|
33 |
|
34 class HbAction; |
|
35 class HbLabel; |
|
36 class HbSlider; |
|
37 class CxeEngine; |
|
38 class HbMainWindow; |
|
39 class CxuiSettingsInfo; |
|
40 class HbToolBarExtension; |
|
41 class CxuiDocumentLoader; |
|
42 class HbTransparentWindow; |
|
43 class CxuiCaptureKeyHandler; |
|
44 class CxuiCaptureKeyHandler; |
|
45 class CxuiSettingDialog; |
|
46 class CxuiSettingRadioButtonList; |
|
47 class CxuiSettingSlider; |
|
48 class HbToolBarExtension; |
|
49 class HbWidget; |
|
50 class CxuiZoomSlider; |
|
51 class CxuiFullScreenPopup; |
|
52 |
|
53 |
|
54 /** |
|
55 * Pre-capture view |
|
56 */ |
|
57 class CxuiPrecaptureView : public CxuiView |
|
58 { |
|
59 Q_OBJECT |
|
60 |
|
61 public: |
|
62 CxuiPrecaptureView(QGraphicsItem *parent = 0); |
|
63 |
|
64 virtual ~CxuiPrecaptureView(); |
|
65 |
|
66 public: |
|
67 |
|
68 virtual void construct(HbMainWindow *mainWindow, |
|
69 CxeEngine *engine, |
|
70 CxuiDocumentLoader *documentLoader, |
|
71 CxuiCaptureKeyHandler *keyHandler, |
|
72 HbActivityManager *activityManager); |
|
73 |
|
74 virtual bool isStandbyModeSupported() const; |
|
75 /** |
|
76 * Loads widgets that are not part of the default section in layouts xml. |
|
77 * Widgets are created at the time they are first loaded. |
|
78 */ |
|
79 virtual void loadWidgets() = 0; |
|
80 |
|
81 signals: |
|
82 |
|
83 /*! |
|
84 * Signal that view is ready to be used. |
|
85 */ |
|
86 void viewReady(); |
|
87 |
|
88 // signals to switch to post/pre-capture view. |
|
89 void changeToPostcaptureView(); |
|
90 void changeToPrecaptureView(); |
|
91 |
|
92 // Switching between cameras |
|
93 void switchCamera(); |
|
94 |
|
95 // signals to start and stop standby timer |
|
96 void startStandbyTimer(); |
|
97 void stopStandbyTimer(); |
|
98 |
|
99 // signal to report error to ErrorManager for further actions. |
|
100 void errorEncountered(CxeError::Id id); |
|
101 |
|
102 public slots: |
|
103 |
|
104 void initCamera(); |
|
105 void requestCameraSwitch(); |
|
106 |
|
107 // whenever a setting is changed on the engine side, an icon might need updating |
|
108 // connects to the settingValueChanged signal of CxeSettings |
|
109 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
|
110 |
|
111 void toolbarExtensionDisappearEffectFinished(const HbEffect::EffectStatus &status); |
|
112 void toolbarExtensionAppearEffectFinished(const HbEffect::EffectStatus &status); |
|
113 |
|
114 // From CxuiView |
|
115 virtual void enterStandby(); |
|
116 virtual void exitStandby(); |
|
117 |
|
118 protected slots: |
|
119 |
|
120 // Key events |
|
121 virtual void handleAutofocusKeyPressed(); |
|
122 |
|
123 // Camera / Engine |
|
124 void handleEngineZoomStateChange(CxeZoomControl::State newState, CxeError::Id error); |
|
125 void handleZoomLevelChange(int); |
|
126 void handleVfStateChanged(CxeViewfinderControl::State newState, CxeError::Id error); |
|
127 // UI: Zoom slider change notification |
|
128 void zoomTo(int value); |
|
129 |
|
130 void disableControlsTimeout(); |
|
131 |
|
132 void toggleZoom(); |
|
133 |
|
134 // Settings related |
|
135 void showSettingsGrid(); |
|
136 void hideSettingsGrid(); |
|
137 void launchSliderSetting(); |
|
138 void prepareToShowDialog(HbAction *action); |
|
139 void prepareToCloseDialog(HbAction *action); |
|
140 void updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error); |
|
141 |
|
142 private slots: |
|
143 void disableGeotaggingDisclaimer(); |
|
144 void launchGeoTaggingSetting(); |
|
145 |
|
146 protected: |
|
147 void toggleControls(); |
|
148 virtual void initializeSettingsGrid() = 0; |
|
149 void showEvent(QShowEvent *event); |
|
150 void hideEvent(QHideEvent *event); |
|
151 bool eventFilter(QObject *object, QEvent *event); |
|
152 void launchSettingsDialog(QObject *action); |
|
153 virtual bool isPostcaptureOn() const = 0; |
|
154 void addIncreaseDecreaseButtons(CxuiZoomSlider *slider); |
|
155 QString getSettingItemIcon(const QString &key, QVariant value); |
|
156 virtual void updateQualityIcon() = 0; |
|
157 virtual void updateSceneIcon(const QString& sceneId) = 0; |
|
158 void launchGeoTaggingDisclaimerDialog(); |
|
159 |
|
160 private: |
|
161 CxuiSettingDialog* createSettingsDialog(); |
|
162 CxuiSettingDialog* createSliderSettingsDialog(); |
|
163 QPointF getDialogPosition(); |
|
164 |
|
165 protected: |
|
166 HbTransparentWindow *mViewfinder; // not own, owned by the graphics scene |
|
167 CxuiDisplayPropertyHandler *mDisplayHandler; |
|
168 HbToolBarExtension *mSettingsGrid; |
|
169 bool mWidgetsLoaded; |
|
170 CxuiSettingDialog *mSettingsDialog; |
|
171 CxuiSettingRadioButtonList *mSettingsDialogList; |
|
172 HbLabel *mQualityIcon; |
|
173 HbLabel *mGeoTaggingIndicatorIcon; |
|
174 HbLabel *mFaceTrackingIcon; |
|
175 CxuiFullScreenPopup *mStandbyPopup; |
|
176 |
|
177 private: |
|
178 HbLabel *mSettingsDialogHeading; |
|
179 |
|
180 CxuiSettingDialog *mSliderSettingsDialog; |
|
181 HbLabel *mSliderSettingsDialogHeading; |
|
182 CxuiSettingSlider *mSettingsSlider; |
|
183 |
|
184 CxuiSettingsInfo *mSettingsInfo; |
|
185 |
|
186 HbAction *mSettingsDialogOkAction; |
|
187 HbAction *mSliderSettingsDialogOkAction; |
|
188 }; |
|
189 |
|
190 #endif // CXUIPRECAPTUREVIEW_H |
|