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