|
1 /* |
|
2 * Copyright (c) 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: This is a header file for a CxuiView class |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CXUIVIEW_H |
|
19 #define CXUIVIEW_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <QTimer> |
|
23 #include <hbview.h> |
|
24 #include <hbmainwindow.h> |
|
25 #include <hbframedrawer.h> |
|
26 |
|
27 class CxuiDocumentLoader; |
|
28 class CxuiCaptureKeyHandler; |
|
29 class CxuiZoomSlider; |
|
30 class CxuiCaptureKeyHandler; |
|
31 class CxeEngine; |
|
32 class HbWidget; |
|
33 |
|
34 // CONSTANTS |
|
35 const int CXUI_HIDE_CONTROLS_TIMEOUT = 6000; // 6 seconds |
|
36 |
|
37 /** |
|
38 * A base class for all views in the Camera UI |
|
39 * The class is for deriving only |
|
40 */ |
|
41 class CxuiView : public HbView |
|
42 { |
|
43 Q_OBJECT |
|
44 |
|
45 public: |
|
46 CxuiView(QGraphicsItem *parent = 0); |
|
47 virtual ~CxuiView(); |
|
48 |
|
49 protected: |
|
50 virtual void construct(HbMainWindow *mainWindow, CxeEngine *engine, |
|
51 CxuiDocumentLoader *documentLoader, |
|
52 CxuiCaptureKeyHandler * keyHandler); |
|
53 |
|
54 public: |
|
55 virtual void updateOrientation(Qt::Orientation orientation); |
|
56 |
|
57 protected: |
|
58 virtual bool allowShowControls() const; |
|
59 virtual void toggleControls(); |
|
60 virtual void showToolbar(); |
|
61 virtual void hideZoom(); |
|
62 virtual void showZoom(); |
|
63 virtual void hideIndicators(); |
|
64 virtual void showIndicators(); |
|
65 virtual void createWidgetBackgroundGraphic(HbWidget *widget, |
|
66 const QString &graphicName, |
|
67 HbFrameDrawer::FrameType frameType = |
|
68 HbFrameDrawer::NinePieces); |
|
69 |
|
70 protected slots: |
|
71 virtual void launchNotSupportedNotification(); |
|
72 virtual void launchPhotosApp(); |
|
73 virtual void launchVideosApp(); |
|
74 virtual void releaseCamera(); |
|
75 |
|
76 virtual void launchScenesView(); |
|
77 |
|
78 // Control visibility of all UI items at the same time: toolbar, zoom and titlepane items |
|
79 virtual void hideControls(); |
|
80 virtual void showControls(); |
|
81 |
|
82 virtual void hideToolbar(); |
|
83 |
|
84 |
|
85 signals: |
|
86 void viewCloseEvent(); |
|
87 void showScenesView(); |
|
88 |
|
89 protected: //common data |
|
90 HbMainWindow *mMainWindow; // not own |
|
91 CxeEngine *mEngine; // not own |
|
92 CxuiDocumentLoader *mDocumentLoader; // not own |
|
93 CxuiCaptureKeyHandler* mCaptureKeyHandler; |
|
94 |
|
95 CxuiZoomSlider *mSlider; // zoom slider, not own, owned by the graphics scene |
|
96 HbToolBar *mToolbar; // not own, owned by the graphics scene |
|
97 HbWidget *mIndicators; |
|
98 |
|
99 bool mControlsVisible; |
|
100 bool mZoomVisible; |
|
101 QTimer mHideControlsTimeout; |
|
102 |
|
103 }; |
|
104 |
|
105 #endif // CXUIVIEW_H |