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" |
27 #include "cxuiapplicationstate.h" |
28 |
|
29 |
28 |
30 class QGraphicsSceneMouseEvent; |
29 class QGraphicsSceneMouseEvent; |
31 class HbMainWindow; |
30 class HbMainWindow; |
32 class CxuiApplication; |
31 class CxuiApplication; |
33 class CxuiCaptureKeyHandler; |
32 class CxuiCaptureKeyHandler; |
34 class CxuiPrecaptureView; |
33 class CxuiPrecaptureView; |
35 class CxuiStillPrecaptureView; |
|
36 class CxuiVideoPrecaptureView; |
|
37 class CxuiPostcaptureView; |
|
38 class CxeEngine; |
34 class CxeEngine; |
39 class CxuiDocumentLoader; |
35 class CxuiDocumentLoader; |
40 class CxuiErrorManager; // class that handles all errors in ui. |
36 class CxuiErrorManager; |
41 class CxuiStandby; |
37 class CxuiView; |
42 class CxuiSceneModeView; |
|
43 |
38 |
44 class CxuiViewManager : public QObject |
39 class CxuiViewManager : public QObject |
45 { |
40 { |
46 Q_OBJECT |
41 Q_OBJECT |
47 |
42 |
48 public: |
43 public: |
49 CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine); |
44 CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine); |
50 ~CxuiViewManager(); |
45 ~CxuiViewManager(); |
51 |
46 |
52 void prepareWindow(); |
|
53 |
|
54 /** |
|
55 * Get a pointer to the document loader instance. |
|
56 */ |
|
57 CxuiDocumentLoader* documentLoader(); |
|
58 |
|
59 public slots: |
47 public slots: |
60 void changeToPostcaptureView(); |
48 void changeToPostcaptureView(); |
61 void changeToPrecaptureView(); |
49 void changeToPrecaptureView(); |
62 void switchCamera(); |
50 void switchCamera(); |
63 void createPostcaptureView(); |
|
64 void showScenesView(); |
51 void showScenesView(); |
65 |
52 |
66 private slots: |
53 private slots: |
67 void toForeground(); |
54 void toForeground(); |
68 void handleForegroundStateChanged(CxuiApplicationFrameworkMonitor::ForegroundState state); |
55 void handleApplicationStateChanged(CxuiApplicationState::State newState, |
69 void handleBatteryEmpty(); |
56 CxuiApplicationState::State oldState); |
70 void aboutToLooseFocus(); |
57 void startStandbyTimer(); |
71 void aboutToGainFocus(); |
58 void stopStandbyTimer(); |
72 |
59 |
73 signals: |
60 signals: |
74 void focusGained(); |
61 void normalStateEntered(); |
75 void focusLost(); |
62 void normalStateExited(); |
76 void batteryEmpty(); |
63 void standbyExitRequested(); |
77 void disableStandbyTimer(); |
|
78 void startStandbyTimer(); |
|
79 |
64 |
80 protected: |
65 protected: |
81 bool eventFilter(QObject *object, QEvent *event); |
66 bool eventFilter(QObject *object, QEvent *event); |
82 |
67 |
83 private: |
68 private: |
84 void createStillPrecaptureView(); |
69 CxuiView *currentView() const; |
85 void createVideoPrecaptureView(); |
70 void initStartupView(); |
|
71 CxuiView *createView(const QString &viewName); |
86 CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera); |
72 CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera); |
87 |
73 |
88 void createSceneModesView(); |
74 void connectSignals(QObject *view); |
|
75 void disconnectSignals(QObject *view = NULL); |
|
76 void connectPreCaptureSignals(); |
|
77 void connectPostCaptureSignals(); |
|
78 void connectSceneModeSignals(); |
|
79 void connectCaptureKeySignals(); |
89 |
80 |
90 /* |
81 void handleExitingNormalState(); |
91 * connects all necessary signals for precapture view |
82 void clearAllActivities(); |
92 */ |
|
93 void connectPreCaptureSignals(); |
|
94 |
|
95 /* |
|
96 * disconnects signals |
|
97 */ |
|
98 void disconnectSignals(); |
|
99 |
|
100 /* |
|
101 * connects all necessary signals for postcapture view |
|
102 */ |
|
103 void connectPostCaptureSignals(); |
|
104 |
|
105 |
|
106 /* |
|
107 * connects capture key handler signals to the current view. |
|
108 */ |
|
109 void connectCaptureKeySignals(); |
|
110 |
83 |
111 private: |
84 private: |
112 |
85 |
113 //data |
86 //data |
114 CxuiApplication &mApplication; |
87 CxuiApplication &mApplication; |
115 HbMainWindow &mMainWindow; |
88 HbMainWindow &mMainWindow; |
116 CxuiStillPrecaptureView *mStillPrecaptureView; |
89 QMap<QString, CxuiView*> mViews; |
117 CxuiVideoPrecaptureView *mVideoPrecaptureView; |
90 QMap<QString, QString> mDocmlFilesByView; |
118 CxuiPostcaptureView *mPostcaptureView; |
|
119 |
91 |
120 CxeEngine &mEngine; |
92 CxeEngine &mEngine; |
121 CxuiCaptureKeyHandler *mKeyHandler; |
93 CxuiCaptureKeyHandler *mKeyHandler; |
122 CxuiApplicationFrameworkMonitor *mApplicationMonitor; |
|
123 |
|
124 private: |
|
125 CxuiDocumentLoader *mCameraDocumentLoader; |
94 CxuiDocumentLoader *mCameraDocumentLoader; |
126 CxuiStandby *mStandbyHandler; |
95 CxuiApplicationState *mApplicationState; |
127 CxuiErrorManager *mErrorManager; |
96 CxuiErrorManager *mErrorManager; |
128 CxuiSceneModeView *mSceneModeView; |
97 QTimer mStandbyTimer; |
129 }; |
98 }; |
130 |
99 |
131 #endif // CXUIVIEWMANAGER_H |
100 #endif // CXUIVIEWMANAGER_H |