summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweeklst.h
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookweeklst.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweeklst.h131
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
15class QDateTime;
16class DateBookDB;
17
18class DateBookWeekLstHeader: public DateBookWeekLstHeaderBase
19{
20 Q_OBJECT
21public:
22 DateBookWeekLstHeader(bool onM, QWidget* parent = 0, const char* name = 0,
23 WFlags fl = 0 );
24 ~DateBookWeekLstHeader();
25 void setDate(QDate d);
26
27public slots:
28 void nextWeek();
29 void prevWeek();
30 void pickDate();
31 void setDate(int y, int m, int d);
32signals:
33 void dateChanged(int y, int w);
34private:
35 QDate date;
36 bool onMonday;
37};
38
39class DateBookWeekLstDayHdr: public DateBookWeekLstDayHdrBase
40{
41 Q_OBJECT
42public:
43 DateBookWeekLstDayHdr(const QDate &d, bool onM,
44 QWidget* parent = 0, const char* name = 0,
45 WFlags fl = 0 );
46public slots:
47 void showDay();
48 void newEvent();
49signals:
50 void showDate(int y, int m, int d);
51 void addEvent(const QDateTime &start, const QDateTime &stop,
52 const QString &str);
53private:
54 QDate date;
55};
56
57class DateBookWeekLstEvent: public ClickableLabel
58{
59 Q_OBJECT
60public:
61 DateBookWeekLstEvent(const EffectiveEvent &ev,
62 QWidget* parent = 0, const char* name = 0,
63 WFlags fl = 0);
64signals:
65 void editEvent(const Event &e);
66private slots:
67 void editMe();
68private:
69 const EffectiveEvent event;
70};
71
72class DateBookWeekLstView: public QWidget
73{
74 Q_OBJECT
75public:
76 DateBookWeekLstView(QValueList<EffectiveEvent> &ev, QDate &d, bool onM,
77 QWidget* parent = 0, const char* name = 0,
78 WFlags fl = 0 );
79 ~DateBookWeekLstView();
80signals:
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);
85private:
86 bool onMonday;
87protected slots:
88 void keyPressEvent(QKeyEvent *);
89};
90
91class DateBookWeekLst : public QWidget
92{
93 Q_OBJECT
94
95public:
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
104public slots:
105 void redraw();
106 void dateChanged(int y, int w);
107protected slots:
108 void keyPressEvent(QKeyEvent *);
109
110signals:
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
116private:
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