Diffstat (limited to 'core/pim/datebook/datebookweeklst.h') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweeklst.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookweeklst.h b/core/pim/datebook/datebookweeklst.h new file mode 100644 index 0000000..d2a07cc --- a/dev/null +++ b/core/pim/datebook/datebookweeklst.h | |||
@@ -0,0 +1,131 @@ | |||
1 | #ifndef DATEBOOKWEEKLST | ||
2 | #define DATEBOOKWEEKLST | ||
3 | |||
4 | #include <qwidget.h> | ||
5 | #include <qdatetime.h> | ||
6 | #include <qpe/event.h> | ||
7 | #include <qlabel.h> | ||
8 | #include <qscrollview.h> | ||
9 | |||
10 | #include "datebookweeklstheader.h" | ||
11 | #include "datebookweeklstdayhdr.h" | ||
12 | |||
13 | #include "clickablelabel.h" | ||
14 | |||
15 | class QDateTime; | ||
16 | class DateBookDB; | ||
17 | |||
18 | class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase | ||
19 | { | ||
20 | Q_OBJECT | ||
21 | public: | ||
22 | DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0, | ||
23 | WFlags fl = 0 ); | ||
24 | ~DateBookWeekLstHeader(); | ||
25 | void setDate(QDate d); | ||
26 | |||
27 | public slots: | ||
28 | void nextWeek(); | ||
29 | void prevWeek(); | ||
30 | void pickDate(); | ||
31 | void setDate(int y, int m, int d); | ||
32 | signals: | ||
33 | void dateChanged(int y, int w); | ||
34 | private: | ||
35 | QDate date; | ||
36 | bool onMonday; | ||
37 | }; | ||
38 | |||
39 | class DateBookWeekLstDayHdr: public DateBookWeekLstDayHdrBase | ||
40 | { | ||
41 | Q_OBJECT | ||
42 | public: | ||
43 | DateBookWeekLstDayHdr(const QDate &d, bool onM, | ||
44 | QWidget* parent = 0, const char* name = 0, | ||
45 | WFlags fl = 0 ); | ||
46 | public slots: | ||
47 | void showDay(); | ||
48 | void newEvent(); | ||
49 | signals: | ||
50 | void showDate(int y, int m, int d); | ||
51 | void addEvent(const QDateTime &start, const QDateTime &stop, | ||
52 | const QString &str); | ||
53 | private: | ||
54 | QDate date; | ||
55 | }; | ||
56 | |||
57 | class DateBookWeekLstEvent: public ClickableLabel | ||
58 | { | ||
59 | Q_OBJECT | ||
60 | public: | ||
61 | DateBookWeekLstEvent(const EffectiveEvent &ev, | ||
62 | QWidget* parent = 0, const char* name = 0, | ||
63 | WFlags fl = 0); | ||
64 | signals: | ||
65 | void editEvent(const Event &e); | ||
66 | private slots: | ||
67 | void editMe(); | ||
68 | private: | ||
69 | const EffectiveEvent event; | ||
70 | }; | ||
71 | |||
72 | class DateBookWeekLstView: public QWidget | ||
73 | { | ||
74 | Q_OBJECT | ||
75 | public: | ||
76 | DateBookWeekLstView(QValueList<EffectiveEvent> &ev, QDate &d, bool onM, | ||
77 | QWidget* parent = 0, const char* name = 0, | ||
78 | WFlags fl = 0 ); | ||
79 | ~DateBookWeekLstView(); | ||
80 | signals: | ||
81 | void editEvent(const Event &e); | ||
82 | void showDate(int y, int m, int d); | ||
83 | void addEvent(const QDateTime &start, const QDateTime &stop, | ||
84 | const QString &str); | ||
85 | private: | ||
86 | bool onMonday; | ||
87 | protected slots: | ||
88 | void keyPressEvent(QKeyEvent *); | ||
89 | }; | ||
90 | |||
91 | class DateBookWeekLst : public QWidget | ||
92 | { | ||
93 | Q_OBJECT | ||
94 | |||
95 | public: | ||
96 | DateBookWeekLst( bool ampm, bool onM, DateBookDB *newDB, | ||
97 | QWidget *parent = 0, | ||
98 | const char *name = 0 ); | ||
99 | void setDate( int y, int w ); | ||
100 | void setDate( QDate &d ); | ||
101 | int week() const { return _week; }; | ||
102 | QDate date() const; | ||
103 | |||
104 | public slots: | ||
105 | void redraw(); | ||
106 | void dateChanged(int y, int w); | ||
107 | protected slots: | ||
108 | void keyPressEvent(QKeyEvent *); | ||
109 | |||
110 | signals: | ||
111 | void showDate(int y, int m, int d); | ||
112 | void addEvent(const QDateTime &start, const QDateTime &stop, | ||
113 | const QString &str); | ||
114 | void editEvent(const Event &e); | ||
115 | |||
116 | private: | ||
117 | DateBookDB *db; | ||
118 | int startTime; | ||
119 | bool ampm; | ||
120 | bool onMonday; | ||
121 | int year, _week; | ||
122 | DateBookWeekLstHeader *header; | ||
123 | DateBookWeekLstView *view; | ||
124 | QVBoxLayout *layout; | ||
125 | QScrollView *scroll; | ||
126 | |||
127 | void getEvents(); | ||
128 | }; | ||
129 | |||
130 | #endif | ||
131 | |||