camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h
changeset 43 0e652f8f1fbd
parent 28 3075d9b614e6
--- a/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h	Thu May 13 21:30:19 2010 +0300
+++ b/camerauis/cameraxui/cxui/inc/cxuiprecaptureview.h	Thu Jul 15 01:55:05 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -25,8 +25,10 @@
 #include <hbframedrawer.h>
 
 #include "cxezoomcontrol.h"
+#include "cxegeotaggingtrail.h"
 #include "cxeviewfindercontrol.h"
 #include "cxuidisplaypropertyhandler.h"
+#include "cxuiview.h"
 
 
 class HbAction;
@@ -46,11 +48,13 @@
 class HbToolBarExtension;
 class HbWidget;
 class CxuiZoomSlider;
+class CxuiFullScreenPopup;
+
 
 /**
  * Pre-capture view
  */
-class CxuiPrecaptureView : public HbView
+class CxuiPrecaptureView : public CxuiView
 {
     Q_OBJECT
 
@@ -61,96 +65,26 @@
 
 public:
 
-    /**
-     * Construct-method handles initialisation tasks for this class.
-     * @param mainwindow
-     * @param engine
-     * @param documentLoader
-     * @param keyHandler
-     */
-    virtual void construct(HbMainWindow *mainWindow, CxeEngine *engine,
+    virtual void construct(HbMainWindow *mainWindow,
+                           CxeEngine *engine,
                            CxuiDocumentLoader *documentLoader,
-                           CxuiCaptureKeyHandler *keyHandler);
-
-    /**
-     * Loads widgets that are not part of the default section in layouts xml.
-     * Widgets are created at the time they are first loaded.
-     */
-    virtual void loadWidgets() = 0;
-    void prepareWindow();
-    virtual void updateOrientation(Qt::Orientation orient) = 0;
-
-public slots:
-
-    void releaseCamera();
-    void initCamera();
-    void requestCameraSwitch();
-
-    // whenever a setting is changed on the engine side, an icon might need updating
-    // connects to the settingValueChanged signal of CxeSettings
-    virtual void handleSettingValueChanged(const QString& key, QVariant newValue);
-
-protected slots:
-
-    // Key events
-    virtual void handleAutofocusKeyPressed();
-
-    // Camera / Engine
-    void handleEngineZoomStateChange(CxeZoomControl::State newState, CxeError::Id error);
-    void handleZoomLevelChange(int);
-    void handleVfStateChanged(CxeViewfinderControl::State newState, CxeError::Id error);
-    virtual void handleFocusGained();
-    virtual void handleFocusLost() = 0;
-    // UI: Zoom slider change notification
-    void zoomTo(int value);
+                           CxuiCaptureKeyHandler *keyHandler,
+                           HbActivityManager *activityManager);
 
-    // Control visibility of all UI items at the same time: toolbar, zoom and titlepane items
-    virtual void hideControls();
-    virtual void showControls();
-    void toggleControls();
-
-    void disableControlsTimeout();
-
-    void toggleZoom();
-    void hideToolbar();
-
-    void launchPhotosApp();
-    void launchVideosApp();
-
-    // Settings related
-    void launchNotSupportedNotification();
-    void launchDiskFullNotification();
-    void showSettingsGrid();
-    void hideSettingsGrid();
-    void launchSliderSetting();
-    void prepareToShowDialog(HbAction *action);
-    void prepareToCloseDialog(HbAction *action);
-
-protected:
-
-   virtual void initializeSettingsGrid() = 0;
-
-    void hideZoom();
-    void showZoom();
-    void hideIndicators();
-    void showIndicators();
-    void showEvent(QShowEvent *event);
-    void hideEvent(QHideEvent *event);
-    void mousePressEvent(QGraphicsSceneMouseEvent *event);
-    virtual void showToolbar();
-    bool eventFilter(QObject *object, QEvent *event);
-    void launchSettingsDialog(QObject *action);
-    bool isPostcaptureOn() const;
-    void addIncreaseDecreaseButtons(CxuiZoomSlider *slider);
-    QString getSettingItemIcon(const QString &key, QVariant value);
-    void updateQualityIcon();
-    void createWidgetBackgroundGraphic(HbWidget *widget,
-                                       const QString &graphicName,
-                                       HbFrameDrawer::FrameType frameType =
-                                       HbFrameDrawer::NinePieces);
+    virtual bool isStandbyModeSupported() const;
+    /**
+    * Loads widgets that are not part of the default section in layouts xml.
+    * Widgets are created at the time they are first loaded.
+    */
+    virtual void loadWidgets() = 0;
 
 signals:
 
+    /*!
+    * Signal that view is ready to be used.
+    */
+    void viewReady();
+
     // signals to switch to post/pre-capture view.
     void changeToPostcaptureView();
     void changeToPrecaptureView();
@@ -163,32 +97,80 @@
     void stopStandbyTimer();
 
     // signal to report error to ErrorManager for further actions.
-    void reportError(CxeError::Id errorId);
-    void showScenesView();
+    void errorEncountered(CxeError::Id id);
+
+public slots:
+
+    void initCamera();
+    void requestCameraSwitch();
+
+    // whenever a setting is changed on the engine side, an icon might need updating
+    // connects to the settingValueChanged signal of CxeSettings
+    virtual void handleSettingValueChanged(const QString& key, QVariant newValue);
+
+    // From CxuiView
+    virtual void enterStandby();
+    virtual void exitStandby();
+
+protected slots:
+
+    // Key events
+    virtual void handleAutofocusKeyPressed();
+
+    // Camera / Engine
+    void handleEngineZoomStateChange(CxeZoomControl::State newState, CxeError::Id error);
+    void handleZoomLevelChange(int);
+    void handleVfStateChanged(CxeViewfinderControl::State newState, CxeError::Id error);
+    // UI: Zoom slider change notification
+    void zoomTo(int value);
+
+    void disableControlsTimeout();
+
+    void toggleZoom();
+
+    // Settings related
+    void showSettingsGrid();
+    void hideSettingsGrid();
+    void launchSliderSetting();
+    void prepareToShowDialog(HbAction *action);
+    void prepareToCloseDialog(HbAction *action);
+    void updateLocationIndicator(CxeGeoTaggingTrail::State newState, CxeError::Id error);
+
+private slots:
+    void disableGeotaggingDisclaimer();
+    void launchGeoTaggingSetting();
 
 protected:
-    CxeEngine *mEngine; // not own
-    HbTransparentWindow *mViewfinder; // not own, owned by the graphics scene
-    HbMainWindow *mMainWindow; // not own
-    CxuiDocumentLoader *mDocumentLoader; // not own
-    CxuiDisplayPropertyHandler *mDisplayHandler;
-    bool   mControlsVisible;
-    QTimer mHideControlsTimeout;
-    CxuiZoomSlider *mSlider; // zoom slider, not own, owned by the graphics scene
-    HbToolBar *mToolBar; // not own, owned by the graphics scene
-    HbToolBarExtension *mSettingsGrid;
-    bool mZoomVisible;
-    bool mWidgetsLoaded;
-    CxuiSettingDialog *mSettingsDialog;
-    CxuiSettingRadioButtonList *mSettingsDialogList;
-    CxuiCaptureKeyHandler *mKeyHandler;
-    HbLabel *mQualityIcon;
-    HbWidget *mIndicators;
+    void toggleControls();
+    virtual void initializeSettingsGrid() = 0;
+    void showEvent(QShowEvent *event);
+    void hideEvent(QHideEvent *event);
+    bool eventFilter(QObject *object, QEvent *event);
+    void launchSettingsDialog(QObject *action);
+    virtual bool isPostcaptureOn() const = 0;
+    void addIncreaseDecreaseButtons(CxuiZoomSlider *slider);
+    QString getSettingItemIcon(const QString &key, QVariant value);
+    virtual void updateQualityIcon() = 0;
+    virtual void updateSceneIcon(const QString& sceneId) = 0;
+    void launchGeoTaggingDisclaimerDialog();
 
 private:
     CxuiSettingDialog* createSettingsDialog();
     CxuiSettingDialog* createSliderSettingsDialog();
     QPointF getDialogPosition();
+
+protected:
+    HbTransparentWindow *mViewfinder; // not own, owned by the graphics scene
+    CxuiDisplayPropertyHandler *mDisplayHandler;
+    HbToolBarExtension *mSettingsGrid;
+    bool mWidgetsLoaded;
+    CxuiSettingDialog *mSettingsDialog;
+    CxuiSettingRadioButtonList *mSettingsDialogList;
+    HbLabel *mQualityIcon;
+    HbLabel *mGeoTaggingIndicatorIcon;
+    HbLabel *mFaceTrackingIcon;
+    CxuiFullScreenPopup *mStandbyPopup;
+
 private:
     HbLabel *mSettingsDialogHeading;
 
@@ -197,7 +179,7 @@
     CxuiSettingSlider *mSettingsSlider;
 
     CxuiSettingsInfo *mSettingsInfo;
-    
+
     HbAction *mSettingsDialogOkAction;
     HbAction *mSliderSettingsDialogOkAction;
 };