-rw-r--r-- | noncore/tools/clock/clock.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index 23cc143..9b00e28 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -37,30 +37,32 @@ class AnalogClock : public QFrame | |||
37 | public: | 37 | public: |
38 | AnalogClock( QWidget * parent = 0, const char * name = 0 ) | 38 | AnalogClock( QWidget * parent = 0, const char * name = 0 ) |
39 | : QFrame( parent, name ), clear(true) {} | 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 | QPoint rotate( QPoint center, QPoint p, int angle ); | ||
50 | void drawPointers ( QPainter *, const QRect &r, const QColor &c, const QTime &t, const QTime *t2 = 0 ); | ||
51 | 49 | ||
52 | QTime currTime; | 50 | QTime currTime; |
53 | QTime prevTime; | 51 | QTime prevTime; |
54 | bool clear; | 52 | bool clear; |
53 | |||
54 | 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 | |||
55 | }; | 57 | }; |
56 | 58 | ||
57 | class Clock : public QVBox | 59 | class Clock : public QVBox |
58 | { | 60 | { |
59 | Q_OBJECT | 61 | Q_OBJECT |
60 | 62 | ||
61 | public: | 63 | public: |
62 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); | 64 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); |
63 | ~Clock(); | 65 | ~Clock(); |
64 | QDateTime when; | 66 | QDateTime when; |
65 | bool bSound; | 67 | bool bSound; |
66 | int hour, minute, snoozeTime; | 68 | int hour, minute, snoozeTime; |
@@ -69,31 +71,36 @@ private slots: | |||
69 | void slotReset(); | 71 | void slotReset(); |
70 | void modeSelect(int); | 72 | void modeSelect(int); |
71 | void updateClock(); | 73 | void updateClock(); |
72 | void changeClock( bool ); | 74 | void changeClock( bool ); |
73 | void slotSetAlarm(); | 75 | void slotSetAlarm(); |
74 | void slotSnooze(); | 76 | void slotSnooze(); |
75 | void slotToggleAlarm(); | 77 | void slotToggleAlarm(); |
76 | void alarmOn(); | 78 | void alarmOn(); |
77 | void alarmOff(); | 79 | void alarmOff(); |
78 | void appMessage(const QCString& msg, const QByteArray& data); | 80 | void appMessage(const QCString& msg, const QByteArray& data); |
79 | void timerEvent( QTimerEvent *e ); | 81 | void timerEvent( QTimerEvent *e ); |
80 | void slotAdjustTime(); | 82 | void slotAdjustTime(); |
83 | |||
84 | void slotStartTimer(); | ||
85 | void slotStopTimer(); | ||
86 | void slotResetTimer(); | ||
87 | void setSwatchMode( int ); | ||
81 | private: | 88 | private: |
82 | void clearClock(); | ||
83 | void clearTimer(); | ||
84 | bool alarmBool; | 89 | bool alarmBool; |
85 | QTimer *t; | 90 | QTimer *t; |
86 | QLCDNumber *lcd; | 91 | QLCDNumber *lcd; |
87 | QLabel *date; | 92 | QLabel *date; |
88 | QLabel *ampmLabel; | 93 | QLabel *ampmLabel; |
89 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; | 94 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; |
90 | QRadioButton *clockRB, *swatchRB; | 95 | QRadioButton *clockRB, *swatchRB; |
91 | AnalogClock *aclock; | 96 | AnalogClock *aclock; |
92 | QTime swatch_start; | 97 | QTime swatch_start; |
93 | int swatch_totalms; | 98 | int swatch_totalms; |
94 | bool swatch_running; | 99 | bool swatch_running; |
95 | bool ampm; | 100 | bool ampm; |
101 | void clearClock(); | ||
102 | void clearTimer(); | ||
96 | }; | 103 | }; |
97 | 104 | ||
98 | #endif | 105 | #endif |
99 | 106 | ||