author | llornkcor <llornkcor> | 2002-03-15 04:29:42 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-03-15 04:29:42 (UTC) |
commit | a0d6c8fdac4e8644c31d1b2e2a321131be4b57c2 (patch) (unidiff) | |
tree | 319d9a01475596ccefa9765cc324485a4ce7e5aa /noncore/tools/clock/clock.h | |
parent | 320291b5006c75e3e42ba1cbbac9639a54309553 (diff) | |
download | opie-a0d6c8fdac4e8644c31d1b2e2a321131be4b57c2.zip opie-a0d6c8fdac4e8644c31d1b2e2a321131be4b57c2.tar.gz opie-a0d6c8fdac4e8644c31d1b2e2a321131be4b57c2.tar.bz2 |
added simple 24 hr alarm features
-rw-r--r-- | noncore/tools/clock/clock.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/noncore/tools/clock/clock.h b/noncore/tools/clock/clock.h index 6dbebf7..9b756b5 100644 --- a/noncore/tools/clock/clock.h +++ b/noncore/tools/clock/clock.h | |||
@@ -19,69 +19,80 @@ | |||
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 | 25 | ||
26 | class QLCDNumber; | 26 | class QLCDNumber; |
27 | class QLabel; | 27 | class QLabel; |
28 | class QTimer; | 28 | class QTimer; |
29 | class QRadioButton; | 29 | class QRadioButton; |
30 | class QPushButton; | 30 | class QPushButton; |
31 | class QDateTime; | ||
31 | 32 | ||
32 | class AnalogClock : public QFrame | 33 | class AnalogClock : public QFrame |
33 | { | 34 | { |
34 | Q_OBJECT | 35 | Q_OBJECT |
35 | 36 | ||
36 | public: | 37 | public: |
37 | AnalogClock( QWidget * parent = 0, const char * name = 0 ) | 38 | AnalogClock( QWidget * parent = 0, const char * name = 0 ) |
38 | : QFrame( parent, name ), clear(false) {} | 39 | : QFrame( parent, name ), clear(false) {} |
39 | 40 | ||
40 | QSizePolicy sizePolicy() const; | 41 | QSizePolicy sizePolicy() const; |
41 | 42 | ||
42 | void display( const QTime& time ); | 43 | void display( const QTime& time ); |
43 | 44 | ||
44 | protected: | 45 | protected: |
45 | void drawContents( QPainter *p ); | 46 | void drawContents( QPainter *p ); |
46 | 47 | ||
47 | private: | 48 | private: |
48 | QPoint rotate( QPoint center, QPoint p, int angle ); | 49 | QPoint rotate( QPoint center, QPoint p, int angle ); |
49 | 50 | ||
50 | QTime currTime; | 51 | QTime currTime; |
51 | QTime prevTime; | 52 | QTime prevTime; |
52 | bool clear; | 53 | bool clear; |
53 | }; | 54 | }; |
54 | 55 | ||
55 | class Clock : public QVBox | 56 | class Clock : public QVBox |
56 | { | 57 | { |
57 | Q_OBJECT | 58 | Q_OBJECT |
58 | 59 | ||
59 | public: | 60 | public: |
60 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); | 61 | Clock( QWidget * parent = 0, const char * name = 0, WFlags f=0 ); |
61 | ~Clock(); | 62 | ~Clock(); |
62 | 63 | QDateTime when; | |
64 | bool bSound; | ||
65 | int hour, minute, snoozeTime; | ||
63 | private slots: | 66 | private slots: |
64 | void slotSet(); | 67 | void slotSet(); |
65 | void slotReset(); | 68 | void slotReset(); |
66 | void modeSelect(int); | 69 | void modeSelect(int); |
67 | void updateClock(); | 70 | void updateClock(); |
68 | void changeClock( bool ); | 71 | void changeClock( bool ); |
72 | void slotSetAlarm(); | ||
73 | void slotSnooze(); | ||
74 | void slotToggleAlarm(); | ||
75 | void alarmOn(); | ||
76 | void alarmOff(); | ||
77 | void appMessage(const QCString& msg, const QByteArray& data); | ||
78 | void timerEvent( QTimerEvent *e ); | ||
69 | 79 | ||
70 | private: | 80 | private: |
71 | void clearClock(); | 81 | void clearClock(); |
72 | 82 | ||
83 | bool alarmBool; | ||
73 | QTimer *t; | 84 | QTimer *t; |
74 | QLCDNumber *lcd; | 85 | QLCDNumber *lcd; |
75 | QLabel *date; | 86 | QLabel *date; |
76 | QLabel *ampmLabel; | 87 | QLabel *ampmLabel; |
77 | QPushButton *set, *reset; | 88 | QPushButton *set, *reset, *alarmBtn, *snoozeBtn, *alarmOffBtn; |
78 | QRadioButton *clockRB, *swatchRB; | 89 | QRadioButton *clockRB, *swatchRB; |
79 | AnalogClock *aclock; | 90 | AnalogClock *aclock; |
80 | QTime swatch_start; | 91 | QTime swatch_start; |
81 | int swatch_totalms; | 92 | int swatch_totalms; |
82 | bool swatch_running; | 93 | bool swatch_running; |
83 | bool ampm; | 94 | bool ampm; |
84 | }; | 95 | }; |
85 | 96 | ||
86 | #endif | 97 | #endif |
87 | 98 | ||