97
|
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: Base class container.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef SNSRBIGCLOCKCONTAINER_H
|
|
19 |
#define SNSRBIGCLOCKCONTAINER_H
|
|
20 |
|
|
21 |
#include <hbwidget.h>
|
|
22 |
|
|
23 |
#include "snsrtest_global.h"
|
|
24 |
#include "snsrdocumentloader.h"
|
|
25 |
#include "screensaver.h"
|
|
26 |
|
|
27 |
SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin)
|
|
28 |
|
|
29 |
class QGraphicsLinearLayout;
|
|
30 |
class HbIndicatorInterface;
|
|
31 |
class SnsrIndicatorModel;
|
|
32 |
class SnsrIndicatorWidget;
|
|
33 |
|
|
34 |
class SnsrBigClockContainer : public HbWidget
|
|
35 |
{
|
|
36 |
Q_OBJECT
|
|
37 |
|
|
38 |
public:
|
|
39 |
|
|
40 |
SnsrBigClockContainer();
|
|
41 |
~SnsrBigClockContainer();
|
|
42 |
|
|
43 |
public slots:
|
|
44 |
|
|
45 |
virtual void update() = 0;
|
|
46 |
virtual void changeLayout(Qt::Orientation orientation);
|
|
47 |
|
|
48 |
public:
|
|
49 |
|
|
50 |
void setIndicatorModel(SnsrIndicatorModel &model);
|
|
51 |
virtual Screensaver::ScreenPowerMode displayPowerMode();
|
|
52 |
virtual void getActiveScreenRows(int *firstActiveRow, int *lastActiveRow);
|
|
53 |
virtual bool isOrientationLocked();
|
|
54 |
virtual int updateIntervalInMilliseconds() = 0;
|
|
55 |
|
|
56 |
protected:
|
|
57 |
|
|
58 |
virtual void loadWidgets() = 0;
|
|
59 |
virtual void changeEvent(QEvent * event);
|
98
|
60 |
bool unlockButtonSupported();
|
97
|
61 |
QPointF randomPosition(const QRectF &rect);
|
|
62 |
QPointF nextRandomPosition(const QPointF &curPos, QPointF &destPos, const QRectF &containerRect);
|
|
63 |
void connectIndicatorWidgetToModel();
|
|
64 |
void resetIndicatorConnections();
|
|
65 |
|
|
66 |
private:
|
|
67 |
|
|
68 |
void resetWidgets();
|
|
69 |
void setBackgroundColor();
|
|
70 |
void paint(
|
|
71 |
QPainter *painter,
|
|
72 |
const QStyleOptionGraphicsItem *option,
|
|
73 |
QWidget *widget = 0
|
|
74 |
);
|
|
75 |
|
|
76 |
private slots:
|
|
77 |
|
|
78 |
void fadeOutView();
|
|
79 |
|
|
80 |
signals:
|
|
81 |
|
|
82 |
void unlockRequested();
|
|
83 |
void activeAreaMoved();
|
|
84 |
|
|
85 |
protected:
|
|
86 |
|
|
87 |
SnsrDocumentLoader mDocumentLoader;
|
|
88 |
QObjectList mDocumentObjects;
|
|
89 |
|
|
90 |
QGraphicsLinearLayout *mBackgroundContainerLayout;
|
|
91 |
QGraphicsWidget *mMainView;
|
|
92 |
QGraphicsWidget *mMainContainer;
|
|
93 |
|
|
94 |
SnsrIndicatorModel *mIndicatorModel; // not owned
|
|
95 |
SnsrIndicatorWidget *mIndicatorWidget;
|
|
96 |
|
|
97 |
int mCurrentOrientation;
|
|
98 |
|
|
99 |
private:
|
|
100 |
|
|
101 |
QColor mBackgroundColor;
|
|
102 |
|
|
103 |
SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrBigClockScreensaverPlugin)
|
|
104 |
};
|
|
105 |
|
|
106 |
#endif // SNSRBIGCLOCKCONTAINER_H
|