1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
51 |
50 |
52 virtual ~CxuiStillPrecaptureView(); |
51 virtual ~CxuiStillPrecaptureView(); |
53 |
52 |
54 public: |
53 public: |
55 |
54 |
56 /** |
55 virtual void construct(HbMainWindow *mainwindow, |
57 * Construct-method handles initialisation tasks for this class. Needs to be called |
56 CxeEngine *engine, |
58 * before the instance of this class is used. |
57 CxuiDocumentLoader *documentLoader, |
59 * @param mainwindow |
58 CxuiCaptureKeyHandler *keyHandler, |
60 * @param engine |
59 HbActivityManager *activityManager); |
61 * @param documentLoader |
|
62 * @param keyHandler |
|
63 */ |
|
64 virtual void construct(HbMainWindow *mainwindow, CxeEngine *engine, |
|
65 CxuiDocumentLoader *documentLoader, CxuiCaptureKeyHandler *keyHandler = NULL); |
|
66 |
60 |
67 /** |
|
68 * Loads default widgets in layouts xml. |
|
69 */ |
|
70 virtual void loadDefaultWidgets(); |
61 virtual void loadDefaultWidgets(); |
71 |
|
72 /** |
|
73 * Loads widgets that are not part of the default section in layouts xml. |
|
74 * Widgets are created at the time they are first loaded. |
|
75 */ |
|
76 virtual void loadWidgets(); |
62 virtual void loadWidgets(); |
77 |
63 |
78 void updateOrientation(Qt::Orientation orientation); |
64 void restoreActivity(const QString &activityId, const QVariant &data); |
|
65 void saveActivity(); |
|
66 void clearActivity(); |
79 |
67 |
80 protected: |
68 protected: |
81 |
69 |
82 void showEvent(QShowEvent *event); |
70 void showEvent(QShowEvent *event); |
83 virtual void showToolbar(); |
71 virtual bool allowShowControls() const; |
84 |
72 |
85 public slots: |
73 public slots: |
86 |
74 |
87 // from CxuiPrecaptureView |
75 // from CxuiPrecaptureView |
88 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
76 virtual void handleSettingValueChanged(const QString& key, QVariant newValue); |
89 |
77 |
90 // whenever a scene setting is changed on the engine side, an icon might need updating on the toolbar |
78 // whenever a scene setting is changed on the engine side, an icon might need updating on the toolbar |
91 // connects to the sceneChanged signal of CxeSettings |
79 // connects to the sceneChanged signal of CxeSettings |
92 void handleSceneChanged(CxeScene &scene); |
80 void handleSceneChanged(CxeScene &scene); |
93 |
81 |
|
82 // From CxuiPrecaptureView |
|
83 virtual void enterStandby(); |
|
84 |
94 protected slots: |
85 protected slots: |
95 void focusAndCapture(); |
86 void focusAndCapture(); |
96 void capture(); |
87 void capture(); |
97 void setCapturePending(); |
88 void setCapturePending(); |
98 void goToVideo(); |
89 void goToVideo(); |
99 |
|
100 void launchSceneModesPopup(); |
|
101 |
90 |
102 // Key events |
91 // Key events |
103 void handleCaptureKeyPressed(); |
92 void handleCaptureKeyPressed(); |
104 void handleAutofocusKeyPressed(); |
93 void handleAutofocusKeyPressed(); |
105 void handleAutofocusKeyReleased(); |
94 void handleAutofocusKeyReleased(); |
108 void handleAutoFocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error); |
97 void handleAutoFocusStateChanged(CxeAutoFocusControl::State newState, CxeError::Id error); |
109 void handleViewfinderStateChanged(CxeViewfinderControl::State newState, CxeError::Id error); |
98 void handleViewfinderStateChanged(CxeViewfinderControl::State newState, CxeError::Id error); |
110 void handleStillCaptureStateChanged(CxeStillCaptureControl::State newState, CxeError::Id error); |
99 void handleStillCaptureStateChanged(CxeStillCaptureControl::State newState, CxeError::Id error); |
111 void handleSnapshot(CxeError::Id error); |
100 void handleSnapshot(CxeError::Id error); |
112 |
101 |
113 /** |
|
114 * Signal used to reset mCapturePending after a short timeout. If the image |
|
115 * cannot be captured within a given time of the key press, it is better to cancel |
|
116 * the whole operation. |
|
117 */ |
|
118 void resetCapturePendingFlag(); |
102 void resetCapturePendingFlag(); |
119 |
103 |
120 void showControls(); |
|
121 |
|
122 /** |
|
123 * Application focus slots are called if focus state is changed. |
|
124 * Camera is released or reserved according to new state. |
|
125 */ |
|
126 void handleFocusLost(); |
|
127 void handleFocusGained(); |
|
128 void launchSetting(); |
104 void launchSetting(); |
129 void updateImagesLeftLabel(); |
105 void updateImagesLeftLabel(); |
130 |
106 |
131 protected: |
107 protected: |
132 void initializeSettingsGrid(); |
108 void initializeSettingsGrid(); |
|
109 bool isPostcaptureOn() const; |
|
110 void updateSceneIcon(const QString& sceneId); |
|
111 void updateQualityIcon(); |
133 void closeDialogs(); |
112 void closeDialogs(); |
|
113 void updateFaceTrackingIcon(); |
|
114 |
|
115 private: |
|
116 void reloadIndicatorWidgets(); |
134 |
117 |
135 protected: |
118 protected: |
136 CxuiSelfTimer *mSelfTimer; |
119 CxuiSelfTimer *mSelfTimer; |
137 HbAction *mFlashSetting; |
120 HbAction *mFlashSetting; |
138 HbDialog *mStillSettingsPopup; |
121 HbDialog *mStillSettingsPopup; |