-rw-r--r-- | korganizer/kodaymatrix.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index ba4853f..c049942 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -19,33 +19,33 @@ | |||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef _KODAYMAT_H | 23 | #ifndef _KODAYMAT_H |
24 | #define _KODAYMAT_H | 24 | #define _KODAYMAT_H |
25 | 25 | ||
26 | #include <libkcal/calendar.h> | 26 | #include <libkcal/calendar.h> |
27 | 27 | ||
28 | #include <qstring.h> | 28 | #include <qstring.h> |
29 | #include <qframe.h> | 29 | #include <qframe.h> |
30 | #include <qcolor.h> | 30 | #include <qcolor.h> |
31 | #include <qpen.h> | 31 | #include <qpen.h> |
32 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
33 | #include <qtooltip.h> | 33 | #include <qtooltip.h> |
34 | #include <qpixmap.h> | 34 | #include <qpixmap.h> |
35 | 35 | #include <qbitarray.h> | |
36 | #include <qmap.h> | 36 | #include <qmap.h> |
37 | 37 | ||
38 | class QDragEnterEvent; | 38 | class QDragEnterEvent; |
39 | class QDragMoveEvent; | 39 | class QDragMoveEvent; |
40 | class QDragLeaveEvent; | 40 | class QDragLeaveEvent; |
41 | class QDropEvent; | 41 | class QDropEvent; |
42 | 42 | ||
43 | class KODayMatrix; | 43 | class KODayMatrix; |
44 | 44 | ||
45 | using namespace KCal; | 45 | using namespace KCal; |
46 | 46 | ||
47 | 47 | ||
48 | /** | 48 | /** |
49 | * small helper class to dynamically show tooltips inside the day matrix. | 49 | * small helper class to dynamically show tooltips inside the day matrix. |
50 | * This class asks the day matrix object for a appropriate label which | 50 | * This class asks the day matrix object for a appropriate label which |
51 | * is in our special case the name of the holiday or null if this day is no holiday. | 51 | * is in our special case the name of the holiday or null if this day is no holiday. |
@@ -156,32 +156,33 @@ public: | |||
156 | void setSelectedDaysFrom(const QDate& start, const QDate& end); | 156 | void setSelectedDaysFrom(const QDate& start, const QDate& end); |
157 | void clearSelection(); | 157 | void clearSelection(); |
158 | 158 | ||
159 | /** Is today visible in the view? Keep this in sync with | 159 | /** Is today visible in the view? Keep this in sync with |
160 | * the values today (below) can take. | 160 | * the values today (below) can take. |
161 | */ | 161 | */ |
162 | bool isTodayVisible() const { return today>=0; } ; | 162 | bool isTodayVisible() const { return today>=0; } ; |
163 | 163 | ||
164 | /** If today is visible, then we can find out if today is | 164 | /** If today is visible, then we can find out if today is |
165 | * near the beginning or the end of the month. | 165 | * near the beginning or the end of the month. |
166 | * This is dependent on today remaining the index | 166 | * This is dependent on today remaining the index |
167 | * in the array of visible dates and going from | 167 | * in the array of visible dates and going from |
168 | * top left (0) to bottom right (41). | 168 | * top left (0) to bottom right (41). |
169 | */ | 169 | */ |
170 | bool isBeginningOfMonth() const { return today<=8; } ; | 170 | bool isBeginningOfMonth() const { return today<=8; } ; |
171 | bool isEndOfMonth() const { return today>=27; } ; | 171 | bool isEndOfMonth() const { return today>=27; } ; |
172 | QString getWhatsThisText( QPoint ) ; | ||
172 | 173 | ||
173 | public slots: | 174 | public slots: |
174 | /** Recalculates all the flags of the days in the matrix like holidays or events | 175 | /** Recalculates all the flags of the days in the matrix like holidays or events |
175 | * on a day (Actually calls above method with the actual startdate). | 176 | * on a day (Actually calls above method with the actual startdate). |
176 | */ | 177 | */ |
177 | void updateView(); | 178 | void updateView(); |
178 | void updateViewTimed(); | 179 | void updateViewTimed(); |
179 | void repaintViewTimed(); | 180 | void repaintViewTimed(); |
180 | 181 | ||
181 | /** | 182 | /** |
182 | * Calculate which square in the matrix should be | 183 | * Calculate which square in the matrix should be |
183 | * hilighted to indicate it's today. | 184 | * hilighted to indicate it's today. |
184 | */ | 185 | */ |
185 | void recalculateToday(); | 186 | void recalculateToday(); |
186 | 187 | ||
187 | /* | 188 | /* |
@@ -211,32 +212,34 @@ protected: | |||
211 | 212 | ||
212 | void mouseReleaseEvent (QMouseEvent* e); | 213 | void mouseReleaseEvent (QMouseEvent* e); |
213 | 214 | ||
214 | void mouseMoveEvent (QMouseEvent* e); | 215 | void mouseMoveEvent (QMouseEvent* e); |
215 | 216 | ||
216 | void dragEnterEvent(QDragEnterEvent *); | 217 | void dragEnterEvent(QDragEnterEvent *); |
217 | 218 | ||
218 | void dragMoveEvent(QDragMoveEvent *); | 219 | void dragMoveEvent(QDragMoveEvent *); |
219 | 220 | ||
220 | void dragLeaveEvent(QDragLeaveEvent *); | 221 | void dragLeaveEvent(QDragLeaveEvent *); |
221 | 222 | ||
222 | void dropEvent(QDropEvent *); | 223 | void dropEvent(QDropEvent *); |
223 | 224 | ||
224 | void resizeEvent(QResizeEvent *); | 225 | void resizeEvent(QResizeEvent *); |
225 | 226 | ||
226 | private: | 227 | private: |
228 | bool mouseDown; | ||
229 | QBitArray bDays; | ||
227 | QPixmap myPix; | 230 | QPixmap myPix; |
228 | QTimer* mUpdateTimer; | 231 | QTimer* mUpdateTimer; |
229 | QTimer* mRepaintTimer; | 232 | QTimer* mRepaintTimer; |
230 | bool mDayChanged; | 233 | bool mDayChanged; |
231 | bool mPendingUpdateBeforeRepaint; | 234 | bool mPendingUpdateBeforeRepaint; |
232 | 235 | ||
233 | /** returns the index of the day located at the matrix's widget (x,y) position. | 236 | /** returns the index of the day located at the matrix's widget (x,y) position. |
234 | * | 237 | * |
235 | * @param x horizontal coordinate | 238 | * @param x horizontal coordinate |
236 | * @param y vertical coordinate | 239 | * @param y vertical coordinate |
237 | */ | 240 | */ |
238 | int getDayIndexFrom(int x, int y); | 241 | int getDayIndexFrom(int x, int y); |
239 | 242 | ||
240 | /** calculates a "shaded" color from the supplied color object. | 243 | /** calculates a "shaded" color from the supplied color object. |
241 | * (Copied from Cornelius's kdpdatebutton.cpp) | 244 | * (Copied from Cornelius's kdpdatebutton.cpp) |
242 | * | 245 | * |