|
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 |
|
26 SCREENSAVER_TEST_CLASS(T_SnsrBigClockScreensaverPlugin) |
|
27 |
|
28 class QGraphicsLinearLayout; |
|
29 class HbIndicatorInterface; |
|
30 class SnsrIndicatorModel; |
|
31 class SnsrIndicatorWidget; |
|
32 |
|
33 class SnsrBigClockContainer : public HbWidget |
|
34 { |
|
35 Q_OBJECT |
|
36 |
|
37 public: |
|
38 |
|
39 SnsrBigClockContainer(); |
|
40 ~SnsrBigClockContainer(); |
|
41 |
|
42 public slots: |
|
43 |
|
44 virtual void update() = 0; |
|
45 virtual void changeLayout(Qt::Orientation orientation) = 0; |
|
46 |
|
47 public: |
|
48 |
|
49 virtual int updateIntervalInMilliseconds() = 0; |
|
50 void initIndicators(SnsrIndicatorModel &model); |
|
51 |
|
52 protected: |
|
53 |
|
54 virtual void changeEvent(QEvent * event); |
|
55 QPointF randomPosition(const QRectF &rect); |
|
56 QPointF nextRandomPosition(const QPointF &curPos, QPointF &destPos, const QRectF &containerRect); |
|
57 |
|
58 private: |
|
59 |
|
60 void resetIndicatorConnections(); |
|
61 void setBackgroundColor(); |
|
62 void paint( |
|
63 QPainter *painter, |
|
64 const QStyleOptionGraphicsItem *option, |
|
65 QWidget *widget = 0 |
|
66 ); |
|
67 |
|
68 signals: |
|
69 |
|
70 void unlockRequested(); |
|
71 |
|
72 protected: |
|
73 |
|
74 SnsrDocumentLoader mDocumentLoader; |
|
75 QObjectList mDocumentObjects; |
|
76 |
|
77 QGraphicsLinearLayout *mBackgroundContainerLayout; |
|
78 QGraphicsWidget *mMainView; |
|
79 QGraphicsWidget *mMainContainer; |
|
80 |
|
81 SnsrIndicatorModel *mIndicatorModel; // not owned |
|
82 SnsrIndicatorWidget *mIndicatorWidget; |
|
83 |
|
84 int mCurrentOrientation; |
|
85 |
|
86 private: |
|
87 |
|
88 QColor mBackgroundColor; |
|
89 |
|
90 SCREENSAVER_TEST_FRIEND_CLASS(T_SnsrBigClockScreensaverPlugin) |
|
91 }; |
|
92 |
|
93 #endif // SNSRBIGCLOCKCONTAINER_H |