Diffstat (limited to 'core/pim/datebook/datebookday.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookday.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookday.h b/core/pim/datebook/datebookday.h index 961f60f..3898cbc 100644 --- a/core/pim/datebook/datebookday.h +++ b/core/pim/datebook/datebookday.h | |||
@@ -11,64 +11,66 @@ | |||
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 <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | 32 | ||
33 | class DateBookDayHeader; | 33 | class DateBookDayHeader; |
34 | class DateBookDB; | 34 | class DateBookDB; |
35 | class DatebookdayAllday; | ||
35 | class QDateTime; | 36 | class QDateTime; |
36 | class QMouseEvent; | 37 | class QMouseEvent; |
37 | class QPaintEvent; | 38 | class QPaintEvent; |
38 | class QResizeEvent; | 39 | class QResizeEvent; |
39 | 40 | ||
40 | class DateBookDayViewQuickLineEdit : public QLineEdit | 41 | class DateBookDayViewQuickLineEdit : public QLineEdit |
41 | { | 42 | { |
42 | Q_OBJECT | 43 | Q_OBJECT |
43 | public: | 44 | public: |
44 | DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0); | 45 | DateBookDayViewQuickLineEdit(const QDateTime &start, const QDateTime &end,QWidget * parent, const char *name=0); |
45 | protected: | 46 | protected: |
46 | Event quickEvent; | 47 | Event quickEvent; |
47 | int active; | 48 | int active; |
48 | void focusOutEvent( QFocusEvent *e ); | 49 | void focusOutEvent( QFocusEvent *e ); |
49 | protected slots: | 50 | protected slots: |
50 | void slotReturnPressed(void); | 51 | void slotReturnPressed(void); |
52 | void finallyCallClose(); | ||
51 | signals: | 53 | signals: |
52 | void insertEvent(const Event &e); | 54 | void insertEvent(const Event &e); |
53 | }; | 55 | }; |
54 | 56 | ||
55 | 57 | ||
56 | class DateBookDayView : public QTable | 58 | class DateBookDayView : public QTable |
57 | { | 59 | { |
58 | Q_OBJECT | 60 | Q_OBJECT |
59 | public: | 61 | public: |
60 | DateBookDayView( bool hourClock, QWidget *parent, const char *name ); | 62 | DateBookDayView( bool hourClock, QWidget *parent, const char *name ); |
61 | bool whichClock() const; | 63 | bool whichClock() const; |
62 | 64 | ||
63 | void setRowStyle( int style ); | 65 | void setRowStyle( int style ); |
64 | 66 | ||
65 | public slots: | 67 | public slots: |
66 | void moveUp(); | 68 | void moveUp(); |
67 | void moveDown(); | 69 | void moveDown(); |
68 | void slotDateChanged( int year, int month, int day ); | 70 | void slotDateChanged( int year, int month, int day ); |
69 | 71 | ||
70 | signals: | 72 | signals: |
71 | void sigColWidthChanged(); | 73 | void sigColWidthChanged(); |
72 | void sigCapturedKey( const QString &txt ); | 74 | void sigCapturedKey( const QString &txt ); |
73 | protected slots: | 75 | protected slots: |
74 | void slotChangeClock( bool ); | 76 | void slotChangeClock( bool ); |
@@ -155,76 +157,80 @@ private: | |||
155 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights | 157 | //reimplemented the compareItems function so that it sorts DayWidgets by geometry heights |
156 | class WidgetListClass : public QList<DateBookDayWidget> | 158 | class WidgetListClass : public QList<DateBookDayWidget> |
157 | { | 159 | { |
158 | private: | 160 | private: |
159 | 161 | ||
160 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) | 162 | int compareItems( QCollection::Item s1, QCollection::Item s2 ) |
161 | { | 163 | { |
162 | //hmm, don't punish me for that ;) | 164 | //hmm, don't punish me for that ;) |
163 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) | 165 | if (reinterpret_cast<DateBookDayWidget*>(s1)->geometry().height() > reinterpret_cast<DateBookDayWidget*>(s2)->geometry().height()) |
164 | { | 166 | { |
165 | return -1; | 167 | return -1; |
166 | } else | 168 | } else |
167 | { | 169 | { |
168 | return 1; | 170 | return 1; |
169 | } | 171 | } |
170 | } | 172 | } |
171 | 173 | ||
172 | 174 | ||
173 | }; | 175 | }; |
174 | 176 | ||
175 | class DateBookDay : public QVBox | 177 | class DateBookDay : public QVBox |
176 | { | 178 | { |
177 | Q_OBJECT | 179 | Q_OBJECT |
178 | 180 | ||
181 | friend class DateBookDayWidget; // for beam this occurence and access to DateBookDB | ||
179 | public: | 182 | public: |
180 | DateBookDay( bool ampm, bool startOnMonday, DateBookDB *newDb, | 183 | DateBookDay( bool ampm, bool startOnMonday, DateBookDB *newDb, |
181 | QWidget *parent, const char *name ); | 184 | QWidget *parent, const char *name ); |
182 | void selectedDates( QDateTime &start, QDateTime &end ); | 185 | void selectedDates( QDateTime &start, QDateTime &end ); |
183 | QDate date() const; | 186 | QDate date() const; |
184 | DateBookDayView *dayView() const { return view; } | 187 | DateBookDayView *dayView() const { return view; } |
185 | void setStartViewTime( int startHere ); | 188 | void setStartViewTime( int startHere ); |
186 | int startViewTime() const; | 189 | int startViewTime() const; |
187 | void setSelectedWidget( DateBookDayWidget * ); | 190 | void setSelectedWidget( DateBookDayWidget * ); |
188 | DateBookDayWidget * getSelectedWidget( void ); | 191 | DateBookDayWidget * getSelectedWidget( void ); |
189 | void setJumpToCurTime( bool bJump ); | 192 | void setJumpToCurTime( bool bJump ); |
190 | void setRowStyle( int style ); | 193 | void setRowStyle( int style ); |
194 | static QDate findRealStart( int uid, const QDate& isIncluded, | ||
195 | DateBookDB* ); | ||
191 | 196 | ||
192 | public slots: | 197 | public slots: |
193 | void setDate( int y, int m, int d ); | 198 | void setDate( int y, int m, int d ); |
194 | void setDate( QDate ); | 199 | void setDate( QDate ); |
195 | void redraw(); | 200 | void redraw(); |
196 | void slotWeekChanged( bool bStartOnMonday ); | 201 | void slotWeekChanged( bool bStartOnMonday ); |
197 | void updateView();//updates TimeMarker and DayWidget-colors | 202 | void updateView();//updates TimeMarker and DayWidget-colors |
198 | 203 | ||
199 | signals: | 204 | signals: |
200 | void removeEvent( const Event& ); | 205 | void removeEvent( const Event& ); |
201 | void editEvent( const Event& ); | 206 | void editEvent( const Event& ); |
202 | void duplicateEvent( const Event& ); | 207 | void duplicateEvent( const Event& ); |
203 | void beamEvent( const Event& ); | 208 | void beamEvent( const Event& ); |
204 | void newEvent(); | 209 | void newEvent(); |
205 | void sigNewEvent( const QString & ); | 210 | void sigNewEvent( const QString & ); |
206 | 211 | ||
207 | protected slots: | 212 | protected slots: |
208 | void keyPressEvent(QKeyEvent *); | 213 | void keyPressEvent(QKeyEvent *); |
209 | 214 | ||
210 | private slots: | 215 | private slots: |
211 | void dateChanged( int y, int m, int d ); | 216 | void dateChanged( int y, int m, int d ); |
212 | void slotColWidthChanged() { relayoutPage(); }; | 217 | void slotColWidthChanged() { relayoutPage(); }; |
213 | 218 | ||
214 | private: | 219 | private: |
215 | void getEvents(); | 220 | void getEvents(); |
216 | void relayoutPage( bool fromResize = false ); | 221 | void relayoutPage( bool fromResize = false ); |
217 | DateBookDayWidget *intersects( const DateBookDayWidget *item, const QRect &geom ); | 222 | DateBookDayWidget *intersects( const DateBookDayWidget *item, const QRect &geom ); |
218 | QDate currDate; | 223 | QDate currDate; |
219 | DateBookDayView *view; | 224 | DateBookDayView *view; |
220 | DateBookDayHeader *header; | 225 | DateBookDayHeader *header; |
226 | DatebookdayAllday *m_allDays; | ||
221 | DateBookDB *db; | 227 | DateBookDB *db; |
222 | WidgetListClass widgetList;//reimplemented QList for sorting widgets by height | 228 | WidgetListClass widgetList;//reimplemented QList for sorting widgets by height |
223 | int startTime; | 229 | int startTime; |
224 | bool jumpToCurTime;//should we jump to current time in dayview? | 230 | bool jumpToCurTime;//should we jump to current time in dayview? |
225 | int rowStyle; | 231 | int rowStyle; |
226 | DateBookDayWidget *selectedWidget; //actual selected widget (obviously) | 232 | DateBookDayWidget *selectedWidget; //actual selected widget (obviously) |
227 | DateBookDayTimeMarker *timeMarker;//marker for current time | 233 | DateBookDayTimeMarker *timeMarker;//marker for current time |
228 | }; | 234 | }; |
229 | 235 | ||
230 | #endif | 236 | #endif |