summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookday.h
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/pim/datebook/datebookday.h
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.h138
1 files changed, 138 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h
new file mode 100644
index 0000000..531fded
--- a/dev/null
+++ b/core/pim/datebook/datebookday.h
@@ -0,0 +1,138 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
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
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
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.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef DATEBOOKDAY_H
21#define DATEBOOKDAY_H
22
23#include <qpe/event.h>
24
25#include <qdatetime.h>
26#include <qtable.h>
27#include <qvbox.h>
28#include <qlist.h>
29
30class DateBookDayHeader;
31class DateBookDB;
32class QDateTime;
33class QMouseEvent;
34class QPaintEvent;
35class QResizeEvent;
36
37class DateBookDayView : public QTable
38{
39 Q_OBJECT
40public:
41 DateBookDayView( bool hourClock, QWidget *parent, const char *name );
42 bool whichClock() const;
43
44public slots:
45 void moveUp();
46 void moveDown();
47
48signals:
49 void sigColWidthChanged();
50 void sigCapturedKey( const QString &txt );
51protected slots:
52 void slotChangeClock( bool );
53protected:
54 virtual void paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected );
55 virtual void paintFocus( QPainter *p, const QRect &cr );
56 virtual void resizeEvent( QResizeEvent *e );
57 void keyPressEvent( QKeyEvent *e );
58 void initHeader();
59private:
60 bool ampm;
61};
62
63class DateBookDay;
64class DateBookDayWidget : public QWidget
65{
66 Q_OBJECT
67
68public:
69 DateBookDayWidget( const EffectiveEvent &e, DateBookDay *db );
70 ~DateBookDayWidget();
71
72 const QRect &geometry() { return geom; }
73 void setGeometry( const QRect &r );
74
75 const EffectiveEvent &event() const { return ev; }
76
77signals:
78 void deleteMe( const Event &e );
79 void editMe( const Event &e );
80 void beamMe( const Event &e );
81
82protected:
83 void paintEvent( QPaintEvent *e );
84 void mousePressEvent( QMouseEvent *e );
85
86private:
87 const EffectiveEvent ev;
88 DateBookDay *dateBook;
89 QString text;
90 QRect geom;
91};
92
93class DateBookDay : public QVBox
94{
95 Q_OBJECT
96
97public:
98 DateBookDay( bool ampm, bool startOnMonday, DateBookDB *newDb,
99 QWidget *parent, const char *name );
100 void selectedDates( QDateTime &start, QDateTime &end );
101 QDate date() const;
102 DateBookDayView *dayView() const { return view; }
103 void setStartViewTime( int startHere );
104 int startViewTime() const;
105
106public slots:
107 void setDate( int y, int m, int d );
108 void setDate( QDate );
109 void redraw();
110 void slotWeekChanged( bool bStartOnMonday );
111
112signals:
113 void removeEvent( const Event& );
114 void editEvent( const Event& );
115 void beamEvent( const Event& );
116 void newEvent();
117 void sigNewEvent( const QString & );
118
119protected slots:
120 void keyPressEvent(QKeyEvent *);
121
122private slots:
123 void dateChanged( int y, int m, int d );
124 void slotColWidthChanged() { relayoutPage(); };
125
126private:
127 void getEvents();
128 void relayoutPage( bool fromResize = false );
129 DateBookDayWidget *intersects( const DateBookDayWidget *item, const QRect &geom );
130 QDate currDate;
131 DateBookDayView *view;
132 DateBookDayHeader *header;
133 DateBookDB *db;
134 QList<DateBookDayWidget> widgetList;
135 int startTime;
136};
137
138#endif