1 /* |
|
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 #ifndef CXUIVIEWMANAGER_H |
|
18 #define CXUIVIEWMANAGER_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <QTimer> |
|
22 #include <QList> |
|
23 |
|
24 #include "cxeviewfindercontrol.h" |
|
25 #include "cxenamespace.h" |
|
26 #include "cxeerror.h" |
|
27 #include "cxuiapplicationstate.h" |
|
28 |
|
29 class QGraphicsSceneMouseEvent; |
|
30 class HbMainWindow; |
|
31 class CxuiApplication; |
|
32 class CxuiCaptureKeyHandler; |
|
33 class CxuiPrecaptureView; |
|
34 class CxeEngine; |
|
35 class CxuiDocumentLoader; |
|
36 class CxuiErrorManager; |
|
37 class CxuiView; |
|
38 |
|
39 class CxuiViewManager : public QObject |
|
40 { |
|
41 Q_OBJECT |
|
42 |
|
43 public: |
|
44 CxuiViewManager(CxuiApplication &application, HbMainWindow &mainWindow, CxeEngine &engine); |
|
45 ~CxuiViewManager(); |
|
46 |
|
47 public slots: |
|
48 void changeToPostcaptureView(); |
|
49 void changeToPrecaptureView(); |
|
50 void switchCamera(); |
|
51 void showScenesView(); |
|
52 |
|
53 private slots: |
|
54 void toForeground(); |
|
55 void handleApplicationStateChanged(CxuiApplicationState::State newState, |
|
56 CxuiApplicationState::State oldState); |
|
57 void startStandbyTimer(); |
|
58 void stopStandbyTimer(); |
|
59 |
|
60 signals: |
|
61 void normalStateEntered(); |
|
62 void normalStateExited(); |
|
63 void standbyExitRequested(); |
|
64 |
|
65 protected: |
|
66 bool eventFilter(QObject *object, QEvent *event); |
|
67 |
|
68 private: |
|
69 CxuiView *currentView() const; |
|
70 void initStartupView(); |
|
71 CxuiView *createView(const QString &viewName); |
|
72 CxuiPrecaptureView* getPrecaptureView(Cxe::CameraMode mode, Cxe::CameraIndex camera); |
|
73 |
|
74 void connectSignals(CxuiView *view); |
|
75 void disconnectSignals(CxuiView *view = NULL); |
|
76 void connectPreCaptureSignals(CxuiPrecaptureView *view); |
|
77 void connectPostCaptureSignals(); |
|
78 void connectSceneModeSignals(); |
|
79 void connectCaptureKeySignals(CxuiView *view); |
|
80 |
|
81 void handleExitingNormalState(); |
|
82 void clearAllActivities(); |
|
83 |
|
84 private: |
|
85 |
|
86 //data |
|
87 CxuiApplication &mApplication; |
|
88 HbMainWindow &mMainWindow; |
|
89 QMap<QString, CxuiView*> mViews; |
|
90 QMap<QString, QString> mDocmlFilesByView; |
|
91 |
|
92 CxeEngine &mEngine; |
|
93 CxuiCaptureKeyHandler *mKeyHandler; |
|
94 CxuiDocumentLoader *mCameraDocumentLoader; |
|
95 CxuiApplicationState *mApplicationState; |
|
96 CxuiErrorManager *mErrorManager; |
|
97 QTimer mStandbyTimer; |
|
98 }; |
|
99 |
|
100 #endif // CXUIVIEWMANAGER_H |
|