diff -r 2922f70fca82 -r 67457b2ffb33 camerauis/cameraxui/cxui/src/cxuiview.cpp --- a/camerauis/cameraxui/cxui/src/cxuiview.cpp Thu Jul 15 01:49:11 2010 +0300 +++ b/camerauis/cameraxui/cxui/src/cxuiview.cpp Thu Jul 15 01:52:14 2010 +0300 @@ -65,7 +65,8 @@ */ void CxuiView::construct(HbMainWindow *mainWindow, CxeEngine *engine, CxuiDocumentLoader *documentLoader, - CxuiCaptureKeyHandler * keyHandler) + CxuiCaptureKeyHandler * keyHandler, + HbActivityManager *activityManager) { CX_DEBUG_ENTER_FUNCTION(); @@ -73,11 +74,13 @@ CX_ASSERT_ALWAYS(mainWindow); CX_ASSERT_ALWAYS(engine); CX_ASSERT_ALWAYS(documentLoader); + CX_ASSERT_ALWAYS(activityManager); mMainWindow = mainWindow; mDocumentLoader = documentLoader; mCaptureKeyHandler = keyHandler; mEngine = engine; + mActivityManager = activityManager; // adjust the timer, and connect it to correct slot connect(&mHideControlsTimeout, SIGNAL(timeout()), this, SLOT(hideControls())); @@ -86,6 +89,18 @@ } /*! +* Is standby mode supported / needed by this view. +* Default implementation returns false. +* Inherited classes need to re-implement this if standby mode is needed. +* @return True if standby mode is supported, false otherwise. +*/ +bool CxuiView::isStandbyModeSupported() const +{ + return false; +} + + +/*! * CxuiView::updateOrientation */ void CxuiView::updateOrientation(Qt::Orientation orientation) @@ -106,6 +121,32 @@ CX_DEBUG_EXIT_FUNCTION(); } + +/*! + * Restore view state from activity. Default implementation does nothing. + */ +void CxuiView::restoreActivity(const QString &activityId, const QVariant &data) +{ + Q_UNUSED(activityId); + Q_UNUSED(data); +} + +/*! + * Save view state to activity. Default implementation does nothing. + */ +void CxuiView::saveActivity() +{ + +} + +/*! + * Clear activity from activity manager. Default implementation does nothing. + */ +void CxuiView::clearActivity() +{ + +} + /*! * Allow showing UI controls? * Default behaviour is that controls can be shown at any time. @@ -116,6 +157,15 @@ } /*! + * Play feedback when touching view outside of any widget? + * Default behaviour is that feedback is always played. + */ +bool CxuiView::isFeedbackEnabled() const +{ + return true; +} + +/*! * Toggle visibility of UI controls. */ void CxuiView::toggleControls() @@ -132,6 +182,26 @@ } /*! +* Slot for entering standby mode. +* By default, release camera. +*/ +void CxuiView::enterStandby() +{ + CX_DEBUG_IN_FUNCTION(); + releaseCamera(); + CX_DEBUG_IN_FUNCTION(); +} + +/*! +* Slot for exiting standby mode. +* By default, no action needed. +*/ +void CxuiView::exitStandby() +{ + CX_DEBUG_IN_FUNCTION(); +} + +/*! * CxuiView::launchNotSupportedNotification * Show "not supported" notification. */ @@ -158,6 +228,8 @@ */ void CxuiView::launchPhotosApp() { + // Release camera device in order to free resources for Photos application + releaseCamera(); QProcess::startDetached(PhotosAppExe); } @@ -167,8 +239,7 @@ */ void CxuiView::launchVideosApp() { - //Releasing cameda device in order to free - //graphical memory + // Release camera device in order to free resources for Videos application releaseCamera(); QProcess::startDetached(VideosAppExe); } @@ -367,7 +438,8 @@ void CxuiView::mousePressEvent(QGraphicsSceneMouseEvent *event) { //! @todo temporary workaround for title bar mouse event handling bug - if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70) { + if (event->type() == QEvent::GraphicsSceneMousePress && event->scenePos().y() > 70 && + isFeedbackEnabled()) { mControlsFeedback.setModalities(HbFeedback::All); mControlsFeedback.play(); event->accept(); @@ -382,7 +454,8 @@ void CxuiView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { //! @todo temporary workaround for title bar mouse event handling bug - if (event->type() == QEvent::GraphicsSceneMouseRelease && event->scenePos().y() > 70) { + if (event->type() == QEvent::GraphicsSceneMouseRelease && event->scenePos().y() > 70 && + isFeedbackEnabled()) { // todo: sound disabling doesn't work in orbit yet so don't do feedback on release // needs to be enabled when orbit support is done //mControlsFeedback.setModalities(HbFeedback::Tactile); @@ -391,4 +464,5 @@ event->accept(); } } + // End of file