-rw-r--r-- | noncore/tools/clock/clock.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index 1e5aa2c..fa12b61 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -1,97 +1,98 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef CLOCK_H | 20 | #ifndef CLOCK_H |
21 | #define CLOCK_H | 21 | #define CLOCK_H |
22 | 22 | ||
23 | #include <qdatetime.h> | 23 | #include <qdatetime.h> |
24 | #include <qvbox.h> | 24 | #include <qvbox.h> |
25 | #include <qpixmap.h> | ||
25 | 26 | ||
26 | class QLCDNumber; | 27 | class QLCDNumber; |
27 | class QLabel; | 28 | class QLabel; |
28 | class QTimer; | 29 | class QTimer; |
29 | class QRadioButton; | 30 | class QRadioButton; |
30 | class QPushButton; | 31 | class QPushButton; |
31 | class QDateTime; | 32 | class QDateTime; |
32 | 33 | ||
33 | class AnalogClock : public QFrame | 34 | class AnalogClock : public QFrame |
34 | { | 35 | { |
35 | Q_OBJECT | 36 | Q_OBJECT |
36 | 37 | ||
37 | public: | 38 | public: |
38 | AnalogClock( QWidget * parent = 0, const char * name = 0 ) | 39 | AnalogClock( QWidget * parent = 0, const char * name = 0 ); |
39 | : QFrame( parent, name ), clear(true) {} | ||
40 | 40 | ||
41 | QSizePolicy sizePolicy() const; | 41 | QSizePolicy sizePolicy() const; |
42 | 42 | ||
43 | void display( const QTime& time ); | 43 | void display( const QTime& time ); |
44 | 44 | ||
45 | protected: | 45 | protected: |
46 | void drawContents( QPainter *p ); | 46 | void drawContents( QPainter *p ); |
47 | 47 | ||
48 | private: | 48 | private: |
49 | 49 | ||
50 | QPixmap bg; | ||
50 | QTime currTime; | 51 | QTime currTime; |
51 | QTime prevTime; | 52 | QTime prevTime; |
52 | bool clear; | 53 | bool clear; |
53 | 54 | ||
54 | QPoint rotate( QPoint center, QPoint p, int angle ); | 55 | QPoint rotate( QPoint center, QPoint p, int angle ); |
55 | void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); | 56 | void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); |
56 | 57 | ||
57 | }; | 58 | }; |
58 | 59 | ||
59 | class Clock : public QVBox | 60 | class Clock : public QVBox |
60 | { | 61 | { |
61 | Q_OBJECT | 62 | Q_OBJECT |
62 | 63 | ||
63 | public: | 64 | public: |
64 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); | 65 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); |
65 | ~Clock(); | 66 | ~Clock(); |
66 | QDateTime when; | 67 | QDateTime when; |
67 | bool bSound; | 68 | bool bSound; |
68 | int hour, minute, snoozeTime; | 69 | int hour, minute, snoozeTime; |
69 | private slots: | 70 | private slots: |
70 | void slotSet(); | 71 | void slotSet(); |
71 | void slotReset(); | 72 | void slotReset(); |
72 | void modeSelect(int); | 73 | void modeSelect(int); |
73 | void updateClock(); | 74 | void updateClock(); |
74 | void changeClock( bool ); | 75 | void changeClock( bool ); |
75 | void slotSetAlarm(); | 76 | void slotSetAlarm(); |
76 | void slotSnooze(); | 77 | void slotSnooze(); |
77 | void slotToggleAlarm(); | 78 | void slotToggleAlarm(); |
78 | void alarmOn(); | 79 | void alarmOn(); |
79 | void alarmOff(); | 80 | void alarmOff(); |
80 | void appMessage(const QCString& msg, const QByteArray& data); | 81 | void appMessage(const QCString& msg, const QByteArray& data); |
81 | void timerEvent( QTimerEvent *e ); | 82 | void timerEvent( QTimerEvent *e ); |
82 | void slotAdjustTime(); | 83 | void slotAdjustTime(); |
83 | 84 | ||
84 | void slotStartTimer(); | 85 | void slotStartTimer(); |
85 | void slotStopTimer(); | 86 | void slotStopTimer(); |
86 | void slotResetTimer(); | 87 | void slotResetTimer(); |
87 | void setSwatchMode( int ); | 88 | void setSwatchMode( int ); |
88 | private: | 89 | private: |
89 | bool alarmBool; | 90 | bool alarmBool; |
90 | QTimer *t; | 91 | QTimer *t; |
91 | QLCDNumber *lcd; | 92 | QLCDNumber *lcd; |
92 | QLabel *date; | 93 | QLabel *date; |
93 | QLabel *ampmLabel; | 94 | QLabel *ampmLabel; |
94 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; | 95 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; |
95 | QRadioButton *clockRB, *swatchRB; | 96 | QRadioButton *clockRB, *swatchRB; |
96 | AnalogClock *aclock; | 97 | AnalogClock *aclock; |
97 | QTime swatch_start; | 98 | QTime swatch_start; |