43
|
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 |
#include <hbinstantfeedback.h>
|
|
27 |
|
|
28 |
class CxuiDocumentLoader;
|
|
29 |
class CxuiCaptureKeyHandler;
|
|
30 |
class CxuiZoomSlider;
|
|
31 |
class CxuiCaptureKeyHandler;
|
|
32 |
class CxeEngine;
|
|
33 |
class HbWidget;
|
|
34 |
class HbActivityManager;
|
|
35 |
|
|
36 |
// CONSTANTS
|
|
37 |
const int CXUI_HIDE_CONTROLS_TIMEOUT = 6000; // 6 seconds
|
|
38 |
|
|
39 |
/**
|
|
40 |
* A base class for all views in the Camera UI
|
|
41 |
* The class is for deriving only
|
|
42 |
*/
|
|
43 |
class CxuiView : public HbView
|
|
44 |
{
|
|
45 |
Q_OBJECT
|
|
46 |
|
|
47 |
public:
|
|
48 |
CxuiView(QGraphicsItem *parent = 0);
|
|
49 |
virtual ~CxuiView();
|
|
50 |
|
|
51 |
virtual void construct(HbMainWindow *mainWindow, CxeEngine *engine,
|
|
52 |
CxuiDocumentLoader *documentLoader,
|
|
53 |
CxuiCaptureKeyHandler * keyHandler,
|
|
54 |
HbActivityManager *activityManager);
|
|
55 |
|
|
56 |
public:
|
|
57 |
virtual bool isStandbyModeSupported() const;
|
|
58 |
virtual void updateOrientation(Qt::Orientation orientation);
|
|
59 |
|
|
60 |
virtual void restoreActivity(const QString &activityId, const QVariant &data);
|
|
61 |
virtual void saveActivity();
|
|
62 |
virtual void clearActivity();
|
|
63 |
|
|
64 |
protected:
|
|
65 |
virtual bool allowShowControls() const;
|
|
66 |
virtual bool isFeedbackEnabled() const;
|
|
67 |
virtual void toggleControls();
|
|
68 |
virtual void showToolbar();
|
|
69 |
virtual void hideZoom();
|
|
70 |
virtual void showZoom();
|
|
71 |
virtual void hideIndicators();
|
|
72 |
virtual void showIndicators();
|
|
73 |
virtual void createWidgetBackgroundGraphic(HbWidget *widget,
|
|
74 |
const QString &graphicName,
|
|
75 |
HbFrameDrawer::FrameType frameType =
|
|
76 |
HbFrameDrawer::NinePieces);
|
|
77 |
|
|
78 |
void mousePressEvent(QGraphicsSceneMouseEvent *event);
|
|
79 |
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
|
|
80 |
|
|
81 |
public slots:
|
|
82 |
virtual void enterStandby();
|
|
83 |
virtual void exitStandby();
|
|
84 |
|
|
85 |
protected slots:
|
|
86 |
virtual void launchNotSupportedNotification();
|
|
87 |
virtual void launchPhotosApp();
|
|
88 |
virtual void launchVideosApp();
|
|
89 |
virtual void releaseCamera();
|
|
90 |
|
|
91 |
virtual void launchScenesView();
|
|
92 |
|
|
93 |
// Control visibility of all UI items at the same time: toolbar, zoom and titlepane items
|
|
94 |
virtual void hideControls();
|
|
95 |
virtual void showControls();
|
|
96 |
|
|
97 |
virtual void hideToolbar();
|
|
98 |
|
|
99 |
|
|
100 |
signals:
|
|
101 |
void viewCloseEvent();
|
|
102 |
void showScenesView();
|
|
103 |
|
|
104 |
protected: //common data
|
|
105 |
HbMainWindow *mMainWindow; // not own
|
|
106 |
CxeEngine *mEngine; // not own
|
|
107 |
CxuiDocumentLoader *mDocumentLoader; // not own
|
|
108 |
CxuiCaptureKeyHandler* mCaptureKeyHandler;
|
|
109 |
|
|
110 |
CxuiZoomSlider *mSlider; // zoom slider, not own, owned by the graphics scene
|
|
111 |
HbToolBar *mToolbar; // not own, owned by the graphics scene
|
|
112 |
HbWidget *mIndicators;
|
|
113 |
|
|
114 |
bool mControlsVisible;
|
|
115 |
bool mZoomVisible;
|
|
116 |
QTimer mHideControlsTimeout;
|
|
117 |
|
|
118 |
HbInstantFeedback mControlsFeedback;
|
|
119 |
HbActivityManager *mActivityManager;
|
|
120 |
};
|
|
121 |
|
|
122 |
#endif // CXUIVIEW_H
|