camerauis/cameraxui/cxui/inc/cxuiviewmanager.h
changeset 28 3075d9b614e6
parent 19 d9aefe59d544
child 36 b12f3922a74f
child 43 0e652f8f1fbd
equal deleted inserted replaced
19:d9aefe59d544 28:3075d9b614e6
     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".
    22 #include <QList>
    22 #include <QList>
    23 
    23 
    24 #include "cxeviewfindercontrol.h"
    24 #include "cxeviewfindercontrol.h"
    25 #include "cxenamespace.h"
    25 #include "cxenamespace.h"
    26 #include "cxeerror.h"
    26 #include "cxeerror.h"
       
    27 #include "cxuiapplicationframeworkmonitor.h"
       
    28 
    27 
    29 
    28 class QGraphicsSceneMouseEvent;
    30 class QGraphicsSceneMouseEvent;
       
    31 class HbMainWindow;
       
    32 class CxuiApplication;
    29 class CxuiCaptureKeyHandler;
    33 class CxuiCaptureKeyHandler;
    30 class XQSettingsManager;
       
    31 class XQSettingsKey;
       
    32 class HbMainWindow;
       
    33 
       
    34 class CxuiPrecaptureView;
    34 class CxuiPrecaptureView;
    35 class CxuiStillPrecaptureView;
    35 class CxuiStillPrecaptureView;
    36 class CxuiStillPrecaptureView2;
       
    37 class CxuiVideoPrecaptureView;
    36 class CxuiVideoPrecaptureView;
    38 class CxuiVideoPrecaptureView2;
       
    39 class CxuiPostcaptureView;
    37 class CxuiPostcaptureView;
    40 class CxeEngine;
    38 class CxeEngine;
    41 class CxuiDocumentLoader;
    39 class CxuiDocumentLoader;
    42 class CxuiErrorManager; // class that handles all errors in ui.
    40 class CxuiErrorManager; // class that handles all errors in ui.
    43 class CxuiStandby;
    41 class CxuiStandby;
       
    42 class CxuiSceneModeView;
    44 
    43 
    45 class CxuiViewManager : public QObject
    44 class CxuiViewManager : public QObject
    46 {
    45 {
    47     Q_OBJECT
    46     Q_OBJECT
    48 
    47 
    49 public:
    48 public:
    50     CxuiViewManager(HbMainWindow &mainWindow, CxeEngine &engine, CxuiCaptureKeyHandler &keyHandler);
    49     CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine);
    51     ~CxuiViewManager();
    50     ~CxuiViewManager();
    52 
    51 
    53     void prepareWindow();
    52     void prepareWindow();
    54 
    53 
    55     /**
    54     /**
    58     CxuiDocumentLoader* documentLoader();
    57     CxuiDocumentLoader* documentLoader();
    59 
    58 
    60 public slots:
    59 public slots:
    61     void changeToPostcaptureView();
    60     void changeToPostcaptureView();
    62     void changeToPrecaptureView();
    61     void changeToPrecaptureView();
    63 
       
    64     /**
       
    65      * Switch camera from primary to secondary or vise versa.
       
    66      */
       
    67     void switchCamera();
    62     void switchCamera();
    68 
       
    69     /**
       
    70      * Event monitor can be used to monitor changes in cenrep and PS values.
       
    71      */
       
    72     void eventMonitor(const XQSettingsKey& key, const QVariant& value);
       
    73 
       
    74     void createPostcaptureView();
    63     void createPostcaptureView();
       
    64     void showScenesView();
    75 
    65 
    76 private slots:
    66 private slots:
       
    67     void toForeground();
       
    68     void handleForegroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState state);
       
    69     void handleBatteryEmpty();
    77     void aboutToLooseFocus();
    70     void aboutToLooseFocus();
    78     void aboutToGainFocus();
    71     void aboutToGainFocus();
    79 
    72 
    80 signals:
    73 signals:
    81     void focusGained();
    74     void focusGained();
    82     void focusLost();
    75     void focusLost();
    83     void batteryEmpty();
    76     void batteryEmpty();
       
    77     void disableStandbyTimer();
       
    78     void startStandbyTimer();
    84 
    79 
    85 protected:
    80 protected:
    86     bool eventFilter(QObject *object, QEvent *event);
    81     bool eventFilter(QObject *object, QEvent *event);
    87 
    82 
    88 private:
    83 private:
    89     void startEventMonitors();
       
    90     void createStillPrecaptureView();
    84     void createStillPrecaptureView();
    91     void createStillPrecaptureView2();
       
    92     void createVideoPrecaptureView();
    85     void createVideoPrecaptureView();
    93     void createVideoPrecaptureView2();
       
    94     CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera);
    86     CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera);
       
    87 
       
    88     void createSceneModesView();
    95 
    89 
    96     /*
    90     /*
    97     * connects all necessary signals for precapture view
    91     * connects all necessary signals for precapture view
    98     */
    92     */
    99     void connectPreCaptureSignals();
    93     void connectPreCaptureSignals();
   115     void connectCaptureKeySignals();
   109     void connectCaptureKeySignals();
   116 
   110 
   117 private:
   111 private:
   118 
   112 
   119     //data
   113     //data
       
   114     CxuiApplication &mApplication;
   120     HbMainWindow &mMainWindow;
   115     HbMainWindow &mMainWindow;
   121     CxuiStillPrecaptureView *mStillPrecaptureView;
   116     CxuiStillPrecaptureView *mStillPrecaptureView;
   122     CxuiVideoPrecaptureView *mVideoPrecaptureView;
   117     CxuiVideoPrecaptureView *mVideoPrecaptureView;
   123     CxuiPostcaptureView *mPostcaptureView;
   118     CxuiPostcaptureView *mPostcaptureView;
   124 
   119 
   125     CxuiStillPrecaptureView2 *mStillPrecaptureView2;
       
   126     CxuiVideoPrecaptureView2 *mVideoPrecaptureView2;
       
   127 
       
   128     CxeEngine &mEngine;
   120     CxeEngine &mEngine;
   129     CxuiCaptureKeyHandler &mKeyHandler;
   121     CxuiCaptureKeyHandler *mKeyHandler;
       
   122     CxuiApplicationFrameworkMonitor *mApplicationMonitor;
   130 
   123 
   131 private:
   124 private:
   132     XQSettingsManager *mSettingsManager;
       
   133     int mKeyLockState; //! @todo: Needed due to Settings manager error: valueChanged is emmitted with same value repeatedly
       
   134     int mBatteryStatus;
       
   135     bool mFocused;
       
   136     CxuiDocumentLoader *mCameraDocumentLoader;
   125     CxuiDocumentLoader *mCameraDocumentLoader;
   137     CxuiStandby *mStandbyHandler;
   126     CxuiStandby *mStandbyHandler;
   138     CxuiErrorManager *mErrorManager;
   127     CxuiErrorManager *mErrorManager;
       
   128     CxuiSceneModeView *mSceneModeView;
   139 };
   129 };
   140 
   130 
   141 #endif // CXUIVIEWMANAGER_H
   131 #endif // CXUIVIEWMANAGER_H