summaryrefslogtreecommitdiff
path: root/library/datebookmonth.h
Unidiff
Diffstat (limited to 'library/datebookmonth.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/datebookmonth.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/datebookmonth.h b/library/datebookmonth.h
index 6cd1ac5..a7647ae 100644
--- a/library/datebookmonth.h
+++ b/library/datebookmonth.h
@@ -1,210 +1,211 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 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 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 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 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. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef DATEBOOKMONTH 20#ifndef DATEBOOKMONTH
21#define DATEBOOKMONTH 21#define DATEBOOKMONTH
22 22
23#include <qpe/event.h> 23#include <qpe/event.h>
24 24
25#include <qvbox.h> 25#include <qvbox.h>
26#include <qhbox.h> 26#include <qhbox.h>
27#include <qdatetime.h> 27#include <qdatetime.h>
28#include <qvaluelist.h> 28#include <qvaluelist.h>
29#include <qtable.h> 29#include <qtable.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31 31
32#include "calendar.h" 32#include "calendar.h"
33#include "timestring.h" 33#include "timestring.h"
34 34
35class QToolButton; 35class QToolButton;
36class QComboBox; 36class QComboBox;
37class QSpinBox; 37class QSpinBox;
38class Event; 38class Event;
39class DateBookDB; 39class DateBookDB;
40 40
41class DateBookMonthHeaderPrivate; 41class DateBookMonthHeaderPrivate;
42class DateBookMonthHeader : public QHBox 42class DateBookMonthHeader : public QHBox
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 45
46public: 46public:
47 DateBookMonthHeader( QWidget *parent = 0, const char *name = 0 ); 47 DateBookMonthHeader( QWidget *parent = 0, const char *name = 0 );
48 ~DateBookMonthHeader(); 48 ~DateBookMonthHeader();
49 void setDate( int year, int month ); 49 void setDate( int year, int month );
50 50
51signals: 51signals:
52 void dateChanged( int year, int month ); 52 void dateChanged( int year, int month );
53 53
54protected slots: 54protected slots:
55 void keyPressEvent(QKeyEvent *e ) { 55 void keyPressEvent(QKeyEvent *e ) {
56 e->ignore(); 56 e->ignore();
57 } 57 }
58 58
59private slots: 59private slots:
60 void updateDate(); 60 void updateDate();
61 void firstMonth(); 61 void firstMonth();
62 void lastMonth(); 62 void lastMonth();
63 void monthBack(); 63 void monthBack();
64 void monthForward(); 64 void monthForward();
65 65
66private: 66private:
67 QToolButton *begin, *back, *next, *end; 67 QToolButton *begin, *back, *next, *end;
68 QComboBox *month; 68 QComboBox *month;
69 QSpinBox *year; 69 QSpinBox *year;
70 DateBookMonthHeaderPrivate *d; 70 DateBookMonthHeaderPrivate *d;
71 int focus;
71}; 72};
72 73
73class DayItemMonthPrivate; 74class DayItemMonthPrivate;
74class DayItemMonth : public QTableItem 75class DayItemMonth : public QTableItem
75{ 76{
76public: 77public:
77 DayItemMonth( QTable *table, EditType et, const QString &t ); 78 DayItemMonth( QTable *table, EditType et, const QString &t );
78 ~DayItemMonth(); 79 ~DayItemMonth();
79 void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected ); 80 void paint( QPainter *p, const QColorGroup &cg, const QRect &cr, bool selected );
80 void setDay( int d ) { dy = d; } 81 void setDay( int d ) { dy = d; }
81 void setEvents( const QValueList<Event> &events ) { daysEvents = events; }; 82 void setEvents( const QValueList<Event> &events ) { daysEvents = events; };
82 void setEvents( const QValueList<EffectiveEvent> &effEvents ); 83 void setEvents( const QValueList<EffectiveEvent> &effEvents );
83 void clearEvents() { daysEvents.clear(); }; 84 void clearEvents() { daysEvents.clear(); };
84 void clearEffEvents(); 85 void clearEffEvents();
85 int day() const { return dy; } 86 int day() const { return dy; }
86 void setType( Calendar::Day::Type t ); 87 void setType( Calendar::Day::Type t );
87 Calendar::Day::Type type() const { return typ; } 88 Calendar::Day::Type type() const { return typ; }
88 89
89private: 90private:
90 QBrush back; 91 QBrush back;
91 QColor forg; 92 QColor forg;
92 int dy; 93 int dy;
93 Calendar::Day::Type typ; 94 Calendar::Day::Type typ;
94 QValueList<Event> daysEvents; // not used anymore... 95 QValueList<Event> daysEvents; // not used anymore...
95 DayItemMonthPrivate *d; 96 DayItemMonthPrivate *d;
96}; 97};
97 98
98class DateBookMonthTablePrivate; 99class DateBookMonthTablePrivate;
99class DateBookMonthTable : public QTable 100class DateBookMonthTable : public QTable
100{ 101{
101 Q_OBJECT 102 Q_OBJECT
102 103
103public: 104public:
104 DateBookMonthTable( QWidget *parent = 0, const char *name = 0, 105 DateBookMonthTable( QWidget *parent = 0, const char *name = 0,
105 DateBookDB *newDb = 0 ); 106 DateBookDB *newDb = 0 );
106 ~DateBookMonthTable(); 107 ~DateBookMonthTable();
107 void setDate( int y, int m, int d ); 108 void setDate( int y, int m, int d );
108 void redraw(); 109 void redraw();
109 110
110 QSize minimumSizeHint() const { return sizeHint(); } 111 QSize minimumSizeHint() const { return sizeHint(); }
111 QSize minimumSize() const { return sizeHint(); } 112 QSize minimumSize() const { return sizeHint(); }
112 void getDate( int& y, int &m, int &d ) const {y=selYear;m=selMonth;d=selDay;} 113 void getDate( int& y, int &m, int &d ) const {y=selYear;m=selMonth;d=selDay;}
113 void setWeekStart( bool onMonday ); 114 void setWeekStart( bool onMonday );
114signals: 115signals:
115 void dateClicked( int year, int month, int day ); 116 void dateClicked( int year, int month, int day );
116 117
117protected: 118protected:
118 void viewportMouseReleaseEvent( QMouseEvent * ); 119 void viewportMouseReleaseEvent( QMouseEvent * );
119 120
120protected slots: 121protected slots:
121 122
122 void keyPressEvent(QKeyEvent *e ) { 123 void keyPressEvent(QKeyEvent *e ) {
123 e->ignore(); 124 e->ignore();
124 } 125 }
125 126
126private slots: 127private slots:
127 void dayClicked( int row, int col ); 128 void dayClicked( int row, int col );
128 void dragDay( int row, int col ); 129 void dragDay( int row, int col );
129 130
130private: 131private:
131 void setupTable(); 132 void setupTable();
132 void setupLabels(); 133 void setupLabels();
133 134
134 void findDay( int day, int &row, int &col ); 135 void findDay( int day, int &row, int &col );
135 void getEvents(); 136 void getEvents();
136 void changeDaySelection( int row, int col ); 137 void changeDaySelection( int row, int col );
137 138
138 int year, month, day; 139 int year, month, day;
139 int selYear, selMonth, selDay; 140 int selYear, selMonth, selDay;
140 QValueList<Event> monthsEvents; // not used anymore... 141 QValueList<Event> monthsEvents; // not used anymore...
141 DateBookDB *db; 142 DateBookDB *db;
142 DateBookMonthTablePrivate *d; 143 DateBookMonthTablePrivate *d;
143}; 144};
144 145
145class DateBookMonthPrivate; 146class DateBookMonthPrivate;
146class DateBookMonth : public QVBox 147class DateBookMonth : public QVBox
147{ 148{
148 Q_OBJECT 149 Q_OBJECT
149 150
150public: 151public:
151 DateBookMonth( QWidget *parent = 0, const char *name = 0, bool ac = FALSE, 152 DateBookMonth( QWidget *parent = 0, const char *name = 0, bool ac = FALSE,
152 DateBookDB *data = 0 ); 153 DateBookDB *data = 0 );
153 ~DateBookMonth(); 154 ~DateBookMonth();
154 QDate selectedDate() const; 155 QDate selectedDate() const;
155 156
156signals: 157signals:
157 void dateClicked( int year, int month, int day ); 158 void dateClicked( int year, int month, int day );
158 159
159public slots: 160public slots:
160 void setDate( int y, int m ); 161 void setDate( int y, int m );
161 void setDate( int y, int m, int d ); 162 void setDate( int y, int m, int d );
162 void setDate( QDate ); 163 void setDate( QDate );
163 void redraw(); 164 void redraw();
164 void slotWeekChange( bool ); 165 void slotWeekChange( bool );
165 166
166protected slots: 167protected slots:
167 virtual void keyPressEvent(QKeyEvent *e); 168 virtual void keyPressEvent(QKeyEvent *e);
168 169
169private slots: 170private slots:
170 void forwardDateClicked( int y, int m, int d ) { emit dateClicked( y, m, d ); } 171 void forwardDateClicked( int y, int m, int d ) { emit dateClicked( y, m, d ); }
171 void finalDate(int, int, int); 172 void finalDate(int, int, int);
172 173
173private: 174private:
174 DateBookMonthHeader *header; 175 DateBookMonthHeader *header;
175 DateBookMonthTable *table; 176 DateBookMonthTable *table;
176 int year, month, day; 177 int year, month, day;
177 bool autoClose; 178 bool autoClose;
178 class DateBookMonthPrivate *d; 179 class DateBookMonthPrivate *d;
179}; 180};
180 181
181class DateButton : public QPushButton 182class DateButton : public QPushButton
182{ 183{
183 Q_OBJECT 184 Q_OBJECT
184 185
185public: 186public:
186 DateButton( bool longDate, QWidget *parent, const char * name = 0 ); 187 DateButton( bool longDate, QWidget *parent, const char * name = 0 );
187 QDate date() const { return currDate; } 188 QDate date() const { return currDate; }
188 189
189signals: 190signals:
190 void dateSelected( int year, int month, int day ); 191 void dateSelected( int year, int month, int day );
191 192
192public slots: 193public slots:
193 void setDate( int y, int m, int d ); 194 void setDate( int y, int m, int d );
194 void setDate( QDate ); 195 void setDate( QDate );
195 void setWeekStartsMonday( int ); 196 void setWeekStartsMonday( int );
196 void setDateFormat( DateFormat ); 197 void setDateFormat( DateFormat );
197 198
198private slots: 199private slots:
199 void pickDate(); 200 void pickDate();
200 void gotHide(); 201 void gotHide();
201 202
202private: 203private:
203 bool longFormat; 204 bool longFormat;
204 bool weekStartsMonday; 205 bool weekStartsMonday;
205 QDate currDate; 206 QDate currDate;
206 DateFormat df; 207 DateFormat df;
207}; 208};
208 209
209 210
210#endif 211#endif