summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookday.h
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookday.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h
index 3e44364..3b75eba 100644
--- a/core/pim/datebook/datebookday.h
+++ b/core/pim/datebook/datebookday.h
@@ -7,52 +7,54 @@
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 DATEBOOKDAY_H 20#ifndef DATEBOOKDAY_H
21#define DATEBOOKDAY_H 21#define DATEBOOKDAY_H
22 22
23#include <qpe/event.h> 23#include <qpe/event.h>
24 24
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qtable.h> 26#include <qtable.h>
27#include <qvbox.h> 27#include <qvbox.h>
28#include <qlist.h> 28#include <qlist.h>
29 29
30#include "datebook.h" 30#include "datebook.h"
31#include "datebooktypes.h"
31#include <qlineedit.h> 32#include <qlineedit.h>
32 33
33class DateBookDayHeader; 34class DateBookDayHeader;
34class DateBookDB; 35class DateBookDB;
36class DateBookDBHoliday;
35class DatebookdayAllday; 37class DatebookdayAllday;
36class QDateTime; 38class QDateTime;
37class QMouseEvent; 39class QMouseEvent;
38class QPaintEvent; 40class QPaintEvent;
39class QResizeEvent; 41class QResizeEvent;
40 42
41class DateBookDayViewQuickLineEdit : public QLineEdit 43class DateBookDayViewQuickLineEdit : public QLineEdit
42{ 44{
43 Q_OBJECT 45 Q_OBJECT
44public: 46public:
45 DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0); 47 DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0);
46protected: 48protected:
47 Event quickEvent; 49 Event quickEvent;
48 int active; 50 int active;
49 void focusOutEvent( QFocusEvent *e ); 51 void focusOutEvent( QFocusEvent *e );
50protected slots: 52protected slots:
51 void slotReturnPressed(void); 53 void slotReturnPressed(void);
52 void finallyCallClose(); 54 void finallyCallClose();
53signals: 55signals:
54 void insertEvent(const Event &e); 56 void insertEvent(const Event &e);
55}; 57};
56 58
57 59
58class DateBookDayView : public QTable 60class DateBookDayView : public QTable
@@ -159,80 +161,80 @@ class WidgetListClass : public QList<DateBookDayWidget>
159{ 161{
160 private: 162 private:
161 163
162 int compareItems( QCollection::Item s1, QCollection::Item s2 ) 164 int compareItems( QCollection::Item s1, QCollection::Item s2 )
163 { 165 {
164 //hmm, don't punish me for that ;) 166 //hmm, don't punish me for that ;)
165 if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) 167 if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height())
166 { 168 {
167 return -1; 169 return -1;
168 } else 170 } else
169 { 171 {
170 return 1; 172 return 1;
171 } 173 }
172 } 174 }
173 175
174 176
175}; 177};
176 178
177class DateBookDay : public QVBox 179class DateBookDay : public QVBox
178{ 180{
179 Q_OBJECT 181 Q_OBJECT
180 182
181 friend class DateBookDayWidget; // for beam this occurence and access to DateBookDB 183 friend class DateBookDayWidget; // for beam this occurence and access to DateBookDB
182public: 184public:
183 DateBookDay( bool ampm, bool startOnMonday, DateBookDB *newDb,DateBookHoliday*newHdb, 185 DateBookDay( bool ampm, bool startOnMonday, DateBookDBHoliday *newDb,DateBookHoliday*newHdb,
184 QWidget *parent, const char *name ); 186 QWidget *parent, const char *name );
185 void selectedDates( QDateTime &start, QDateTime &end ); 187 void selectedDates( QDateTime &start, QDateTime &end );
186 188
187 QDate date() const; 189 QDate date() const;
188 DateBookDayView *dayView() const { return view; } 190 DateBookDayView *dayView() const { return view; }
189 void setStartViewTime( int startHere ); 191 void setStartViewTime( int startHere );
190 int startViewTime() const; 192 int startViewTime() const;
191 void setSelectedWidget( DateBookDayWidget * ); 193 void setSelectedWidget( DateBookDayWidget * );
192 DateBookDayWidget * getSelectedWidget( void ); 194 DateBookDayWidget * getSelectedWidget( void );
193 void setJumpToCurTime( bool bJump ); 195 void setJumpToCurTime( bool bJump );
194 void setRowStyle( int style ); 196 void setRowStyle( int style );
195 static QDate findRealStart( int uid, const QDate& isIncluded, 197 static QDate findRealStart( int uid, const QDate& isIncluded,
196 DateBookDB* ); 198 DateBookDB* );
197 199
198public slots: 200public slots:
199 void setDate( int y, int m, int d ); 201 void setDate( int y, int m, int d );
200 void setDate( QDate ); 202 void setDate( QDate );
201 void redraw(); 203 void redraw();
202 void slotWeekChanged( bool bStartOnMonday ); 204 void slotWeekChanged( bool bStartOnMonday );
203 void updateView(); //updates TimeMarker and DayWidget-colors 205 void updateView(); //updates TimeMarker and DayWidget-colors
204 206
205signals: 207signals:
206 void removeEvent( const Event& ); 208 void removeEvent( const Event& );
207 void editEvent( const Event& ); 209 void editEvent( const Event& );
208 void duplicateEvent( const Event& ); 210 void duplicateEvent( const Event& );
209 void beamEvent( const Event& ); 211 void beamEvent( const Event& );
210 void newEvent(); 212 void newEvent();
211 void sigNewEvent( const QString & ); 213 void sigNewEvent( const QString & );
212 214
213protected slots: 215protected slots:
214 void keyPressEvent(QKeyEvent *); 216 void keyPressEvent(QKeyEvent *);
215 217
216private slots: 218private slots:
217 void dateChanged( int y, int m, int d ); 219 void dateChanged( int y, int m, int d );
218 void slotColWidthChanged() { relayoutPage(); }; 220 void slotColWidthChanged() { relayoutPage(); };
219 221
220private: 222private:
221 void getEvents(); 223 void getEvents();
222 void relayoutPage( bool fromResize = false ); 224 void relayoutPage( bool fromResize = false );
223 DateBookDayWidget *intersects( const DateBookDayWidget *item, const QRect &geom ); 225 DateBookDayWidget *intersects( const DateBookDayWidget *item, const QRect &geom );
224 QDate currDate; 226 QDate currDate;
225 DateBookDayView *view; 227 DateBookDayView *view;
226 DateBookDayHeader *header; 228 DateBookDayHeader *header;
227 DatebookdayAllday *m_allDays; 229 DatebookdayAllday *m_allDays;
228 DateBookDB *db; 230 DateBookDBHoliday *db;
229 WidgetListClass widgetList; //reimplemented QList for sorting widgets by height 231 WidgetListClass widgetList; //reimplemented QList for sorting widgets by height
230 int startTime; 232 int startTime;
231 bool jumpToCurTime; //should we jump to current time in dayview? 233 bool jumpToCurTime; //should we jump to current time in dayview?
232 int rowStyle; 234 int rowStyle;
233 DateBookDayWidget *selectedWidget; //actual selected widget (obviously) 235 DateBookDayWidget *selectedWidget; //actual selected widget (obviously)
234 DateBookDayTimeMarker *timeMarker; //marker for current time 236 DateBookDayTimeMarker *timeMarker; //marker for current time
235 DateBookHoliday*_holiday_db; 237 DateBookHoliday*_holiday_db;
236}; 238};
237 239
238#endif 240#endif