64 /*! |
64 /*! |
65 * CxuiView::construct |
65 * CxuiView::construct |
66 */ |
66 */ |
67 void CxuiView::construct(HbMainWindow *mainWindow, CxeEngine *engine, |
67 void CxuiView::construct(HbMainWindow *mainWindow, CxeEngine *engine, |
68 CxuiDocumentLoader *documentLoader, |
68 CxuiDocumentLoader *documentLoader, |
69 CxuiCaptureKeyHandler * keyHandler, |
69 CxuiCaptureKeyHandler * keyHandler) |
70 HbActivityManager *activityManager) |
|
71 { |
70 { |
72 CX_DEBUG_ENTER_FUNCTION(); |
71 CX_DEBUG_ENTER_FUNCTION(); |
73 |
72 |
74 //Minimum requirements to construct the view |
73 //Minimum requirements to construct the view |
75 CX_ASSERT_ALWAYS(mainWindow); |
74 CX_ASSERT_ALWAYS(mainWindow); |
76 CX_ASSERT_ALWAYS(engine); |
75 CX_ASSERT_ALWAYS(engine); |
77 CX_ASSERT_ALWAYS(documentLoader); |
76 CX_ASSERT_ALWAYS(documentLoader); |
78 CX_ASSERT_ALWAYS(activityManager); |
|
79 |
77 |
80 mMainWindow = mainWindow; |
78 mMainWindow = mainWindow; |
81 mDocumentLoader = documentLoader; |
79 mDocumentLoader = documentLoader; |
82 mCaptureKeyHandler = keyHandler; |
80 mCaptureKeyHandler = keyHandler; |
83 mEngine = engine; |
81 mEngine = engine; |
84 mActivityManager = activityManager; |
|
85 |
82 |
86 // adjust the timer, and connect it to correct slot |
83 // adjust the timer, and connect it to correct slot |
87 connect(&mHideControlsTimeout, SIGNAL(timeout()), this, SLOT(hideControls())); |
84 connect(&mHideControlsTimeout, SIGNAL(timeout()), this, SLOT(hideControls())); |
88 mHideControlsTimeout.setSingleShot(true); |
85 mHideControlsTimeout.setSingleShot(true); |
89 mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT); |
86 mHideControlsTimeout.setInterval(CXUI_HIDE_CONTROLS_TIMEOUT); |
192 * Slot for entering standby mode. |
189 * Slot for entering standby mode. |
193 * By default, release camera. |
190 * By default, release camera. |
194 */ |
191 */ |
195 void CxuiView::enterStandby() |
192 void CxuiView::enterStandby() |
196 { |
193 { |
197 CX_DEBUG_IN_FUNCTION(); |
194 CX_DEBUG_ENTER_FUNCTION(); |
198 releaseCamera(); |
195 releaseCamera(); |
199 CX_DEBUG_IN_FUNCTION(); |
196 CX_DEBUG_EXIT_FUNCTION(); |
200 } |
197 } |
201 |
198 |
202 /*! |
199 /*! |
203 * Slot for exiting standby mode. |
200 * Slot for exiting standby mode. |
204 * By default, no action needed. |
201 * By default, no action needed. |
266 */ |
263 */ |
267 void CxuiView::hideControls() |
264 void CxuiView::hideControls() |
268 { |
265 { |
269 CX_DEBUG_ENTER_FUNCTION(); |
266 CX_DEBUG_ENTER_FUNCTION(); |
270 |
267 |
271 if (mHideControlsTimeout.isActive()) { |
268 if (mMainWindow->currentView() == this) { |
272 mHideControlsTimeout.stop(); |
269 if (mHideControlsTimeout.isActive()) { |
273 } |
270 mHideControlsTimeout.stop(); |
274 |
271 } |
275 setTitleBarVisible(false); |
272 |
276 setStatusBarVisible(false); |
273 setTitleBarVisible(false); |
277 |
274 setStatusBarVisible(false); |
278 hideZoom(); |
275 |
279 |
276 hideZoom(); |
280 hideToolbar(); |
277 |
281 |
278 hideToolbar(); |
282 // show indicators when controls are hidden |
279 |
283 showIndicators(); |
280 // show indicators when controls are hidden |
284 |
281 showIndicators(); |
285 mControlsVisible = false; |
282 |
286 |
283 mControlsVisible = false; |
287 // give the keyboard focus back to the view |
284 |
288 // for the view to receive key events |
285 // give the keyboard focus back to the view |
289 setFocus(); |
286 // for the view to receive key events |
290 |
287 setFocus(); |
|
288 |
|
289 } |
291 CX_DEBUG_EXIT_FUNCTION(); |
290 CX_DEBUG_EXIT_FUNCTION(); |
292 } |
291 } |
293 |
292 |
294 /*! |
293 /*! |
295 * CxuiView::showControls |
294 * CxuiView::showControls |
296 */ |
295 */ |
297 void CxuiView::showControls() |
296 void CxuiView::showControls() |
298 { |
297 { |
299 if (allowShowControls()) { |
298 if (mMainWindow->currentView() == this && allowShowControls()) { |
300 // show toolbar |
299 // show toolbar |
301 showToolbar(); |
300 showToolbar(); |
302 |
301 |
303 // show zoom |
302 // show zoom |
304 showZoom(); |
303 showZoom(); |