author | zautrix <zautrix> | 2005-01-31 08:05:32 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-31 08:05:32 (UTC) |
commit | f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c (patch) (unidiff) | |
tree | 683febfff7427b923f23178e74b7cc0e50ef461d /korganizer/kodaymatrix.h | |
parent | ed5723f40a93bbedfcbd9f54e6379a23c4a76096 (diff) | |
download | kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.zip kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.gz kdepimpi-f7663a4c854d217bcb4f828a3ebb69cc40d0dd7c.tar.bz2 |
fix
-rw-r--r-- | korganizer/kodaymatrix.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index 0e9640a..ac2f59c 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h | |||
@@ -131,183 +131,184 @@ public: | |||
131 | */ | 131 | */ |
132 | void updateView(QDate actdate); | 132 | void updateView(QDate actdate); |
133 | 133 | ||
134 | /** returns the QDate object associated with day indexed by the | 134 | /** returns the QDate object associated with day indexed by the |
135 | * supplied offset. | 135 | * supplied offset. |
136 | */ | 136 | */ |
137 | const QDate& getDate(int offset); | 137 | const QDate& getDate(int offset); |
138 | 138 | ||
139 | /** returns the official name of this holy day or 0 if there is no label | 139 | /** returns the official name of this holy day or 0 if there is no label |
140 | * for this day. | 140 | * for this day. |
141 | */ | 141 | */ |
142 | QString getHolidayLabel(int offset); | 142 | QString getHolidayLabel(int offset); |
143 | 143 | ||
144 | /** adds all actual selected days from mSelStart to mSelEnd to the supplied | 144 | /** adds all actual selected days from mSelStart to mSelEnd to the supplied |
145 | * DateList. | 145 | * DateList. |
146 | */ | 146 | */ |
147 | void addSelectedDaysTo(DateList&); | 147 | void addSelectedDaysTo(DateList&); |
148 | 148 | ||
149 | /** sets the actual to be displayed selection in the day matrix starting from | 149 | /** sets the actual to be displayed selection in the day matrix starting from |
150 | * start and ending with end. Theview must be manually updated by calling | 150 | * start and ending with end. Theview must be manually updated by calling |
151 | * repaint. (?) | 151 | * repaint. (?) |
152 | */ | 152 | */ |
153 | void setSelectedDaysFrom(const QDate& start, const QDate& end); | 153 | void setSelectedDaysFrom(const QDate& start, const QDate& end); |
154 | 154 | ||
155 | 155 | ||
156 | /** Is today visible in the view? Keep this in sync with | 156 | /** Is today visible in the view? Keep this in sync with |
157 | * the values today (below) can take. | 157 | * the values today (below) can take. |
158 | */ | 158 | */ |
159 | bool isTodayVisible() const { return today>=0; } ; | 159 | bool isTodayVisible() const { return today>=0; } ; |
160 | 160 | ||
161 | /** If today is visible, then we can find out if today is | 161 | /** If today is visible, then we can find out if today is |
162 | * near the beginning or the end of the month. | 162 | * near the beginning or the end of the month. |
163 | * This is dependent on today remaining the index | 163 | * This is dependent on today remaining the index |
164 | * in the array of visible dates and going from | 164 | * in the array of visible dates and going from |
165 | * top left (0) to bottom right (41). | 165 | * top left (0) to bottom right (41). |
166 | */ | 166 | */ |
167 | bool isBeginningOfMonth() const { return today<=8; } ; | 167 | bool isBeginningOfMonth() const { return today<=8; } ; |
168 | bool isEndOfMonth() const { return today>=27; } ; | 168 | bool isEndOfMonth() const { return today>=27; } ; |
169 | 169 | ||
170 | public slots: | 170 | public slots: |
171 | /** Recalculates all the flags of the days in the matrix like holidays or events | 171 | /** Recalculates all the flags of the days in the matrix like holidays or events |
172 | * on a day (Actually calls above method with the actual startdate). | 172 | * on a day (Actually calls above method with the actual startdate). |
173 | */ | 173 | */ |
174 | void updateView(); | 174 | void updateView(); |
175 | void updateViewTimed(); | 175 | void updateViewTimed(); |
176 | void repaintViewTimed(); | 176 | void repaintViewTimed(); |
177 | 177 | ||
178 | /** | 178 | /** |
179 | * Calculate which square in the matrix should be | 179 | * Calculate which square in the matrix should be |
180 | * hilighted to indicate it's today. | 180 | * hilighted to indicate it's today. |
181 | */ | 181 | */ |
182 | void recalculateToday(); | 182 | void recalculateToday(); |
183 | 183 | ||
184 | /* | 184 | /* |
185 | void setStartDate(QDate); | 185 | void setStartDate(QDate); |
186 | */ | 186 | */ |
187 | 187 | ||
188 | signals: | 188 | signals: |
189 | 189 | ||
190 | /** emitted if the user selects a block of days with the mouse by dragging a rectangle | 190 | /** emitted if the user selects a block of days with the mouse by dragging a rectangle |
191 | * inside the matrix | 191 | * inside the matrix |
192 | * | 192 | * |
193 | * @param daylist list of days that have been selected by the user | 193 | * @param daylist list of days that have been selected by the user |
194 | */ | 194 | */ |
195 | void selected( const KCal::DateList &daylist ); | 195 | void selected( const KCal::DateList &daylist ); |
196 | 196 | ||
197 | /** emitted if the user has dropped an event inside the matrix | 197 | /** emitted if the user has dropped an event inside the matrix |
198 | * | 198 | * |
199 | * @param event the dropped calendar event | 199 | * @param event the dropped calendar event |
200 | */ | 200 | */ |
201 | void eventDropped(Event *event); | 201 | void eventDropped(Event *event); |
202 | 202 | ||
203 | protected: | 203 | protected: |
204 | 204 | ||
205 | void paintEvent(QPaintEvent *ev); | 205 | void paintEvent(QPaintEvent *ev); |
206 | 206 | ||
207 | void mousePressEvent (QMouseEvent* e); | 207 | void mousePressEvent (QMouseEvent* e); |
208 | 208 | ||
209 | void mouseReleaseEvent (QMouseEvent* e); | 209 | void mouseReleaseEvent (QMouseEvent* e); |
210 | 210 | ||
211 | void mouseMoveEvent (QMouseEvent* e); | 211 | void mouseMoveEvent (QMouseEvent* e); |
212 | 212 | ||
213 | void dragEnterEvent(QDragEnterEvent *); | 213 | void dragEnterEvent(QDragEnterEvent *); |
214 | 214 | ||
215 | void dragMoveEvent(QDragMoveEvent *); | 215 | void dragMoveEvent(QDragMoveEvent *); |
216 | 216 | ||
217 | void dragLeaveEvent(QDragLeaveEvent *); | 217 | void dragLeaveEvent(QDragLeaveEvent *); |
218 | 218 | ||
219 | void dropEvent(QDropEvent *); | 219 | void dropEvent(QDropEvent *); |
220 | 220 | ||
221 | void resizeEvent(QResizeEvent *); | 221 | void resizeEvent(QResizeEvent *); |
222 | 222 | ||
223 | private: | 223 | private: |
224 | QTimer* mUpdateTimer; | 224 | QTimer* mUpdateTimer; |
225 | QTimer* mRepaintTimer; | 225 | QTimer* mRepaintTimer; |
226 | bool mDayChanged; | 226 | bool mDayChanged; |
227 | bool mPendingUpdateBeforeRepaint; | ||
227 | 228 | ||
228 | /** returns the index of the day located at the matrix's widget (x,y) position. | 229 | /** returns the index of the day located at the matrix's widget (x,y) position. |
229 | * | 230 | * |
230 | * @param x horizontal coordinate | 231 | * @param x horizontal coordinate |
231 | * @param y vertical coordinate | 232 | * @param y vertical coordinate |
232 | */ | 233 | */ |
233 | int getDayIndexFrom(int x, int y); | 234 | int getDayIndexFrom(int x, int y); |
234 | 235 | ||
235 | /** calculates a "shaded" color from the supplied color object. | 236 | /** calculates a "shaded" color from the supplied color object. |
236 | * (Copied from Cornelius's kdpdatebutton.cpp) | 237 | * (Copied from Cornelius's kdpdatebutton.cpp) |
237 | * | 238 | * |
238 | * @param color source based on which a shaded color should be calculated. | 239 | * @param color source based on which a shaded color should be calculated. |
239 | */ | 240 | */ |
240 | QColor getShadedColor(QColor color); | 241 | QColor getShadedColor(QColor color); |
241 | 242 | ||
242 | /** number of days to be displayed. For now there is no support for any other number then 42. | 243 | /** number of days to be displayed. For now there is no support for any other number then 42. |
243 | so change it at your own risk :o) */ | 244 | so change it at your own risk :o) */ |
244 | static const int NUMDAYS; | 245 | static const int NUMDAYS; |
245 | 246 | ||
246 | /** calendar instance to be queried for holidays, events, ... */ | 247 | /** calendar instance to be queried for holidays, events, ... */ |
247 | Calendar *mCalendar; | 248 | Calendar *mCalendar; |
248 | 249 | ||
249 | /** starting date of the matrix */ | 250 | /** starting date of the matrix */ |
250 | QDate startdate; | 251 | QDate startdate; |
251 | 252 | ||
252 | /** array of day labels to optimeize drawing performance. */ | 253 | /** array of day labels to optimeize drawing performance. */ |
253 | QString *daylbls; | 254 | QString *daylbls; |
254 | 255 | ||
255 | /** array of days displayed to reduce memory consumption by | 256 | /** array of days displayed to reduce memory consumption by |
256 | subsequently calling QDate::addDays(). */ | 257 | subsequently calling QDate::addDays(). */ |
257 | QDate *days; | 258 | QDate *days; |
258 | 259 | ||
259 | /** array of storing the number of events on a given day. | 260 | /** array of storing the number of events on a given day. |
260 | * used for drawing a bold font if there is at least one event on that day. | 261 | * used for drawing a bold font if there is at least one event on that day. |
261 | */ | 262 | */ |
262 | int *events; | 263 | int *events; |
263 | 264 | ||
264 | /** stores holiday names of the days shown in the matrix. */ | 265 | /** stores holiday names of the days shown in the matrix. */ |
265 | QMap<int,QString> mHolidays; | 266 | QMap<int,QString> mHolidays; |
266 | 267 | ||
267 | /** indey of today or -1 if today is not visible in the matrix. */ | 268 | /** indey of today or -1 if today is not visible in the matrix. */ |
268 | int today; | 269 | int today; |
269 | 270 | ||
270 | /** index of day where dragged selection was initiated. | 271 | /** index of day where dragged selection was initiated. |
271 | used to detect "negative" timely selections */ | 272 | used to detect "negative" timely selections */ |
272 | int mSelInit; | 273 | int mSelInit; |
273 | 274 | ||
274 | /** if mSelStart has this value it indicates that there is no | 275 | /** if mSelStart has this value it indicates that there is no |
275 | actual selection in the matrix. */ | 276 | actual selection in the matrix. */ |
276 | static const int NOSELECTION; | 277 | static const int NOSELECTION; |
277 | 278 | ||
278 | /** index of first selected day. */ | 279 | /** index of first selected day. */ |
279 | int mSelStart; | 280 | int mSelStart; |
280 | 281 | ||
281 | /** index of last selected day. */ | 282 | /** index of last selected day. */ |
282 | int mSelEnd; | 283 | int mSelEnd; |
283 | 284 | ||
284 | /** dynamic tooltip to handle mouse dependent tips for each day in the matrix. */ | 285 | /** dynamic tooltip to handle mouse dependent tips for each day in the matrix. */ |
285 | DynamicTip* mToolTip; | 286 | DynamicTip* mToolTip; |
286 | 287 | ||
287 | 288 | ||
288 | /** default background colour of the matrix. */ | 289 | /** default background colour of the matrix. */ |
289 | QColor mDefaultBackColor; | 290 | QColor mDefaultBackColor; |
290 | 291 | ||
291 | /** default text color of the matrix. */ | 292 | /** default text color of the matrix. */ |
292 | QColor mDefaultTextColor; | 293 | QColor mDefaultTextColor; |
293 | 294 | ||
294 | /** default text color for days not in the actual month. */ | 295 | /** default text color for days not in the actual month. */ |
295 | QColor mDefaultTextColorShaded; | 296 | QColor mDefaultTextColorShaded; |
296 | 297 | ||
297 | /** default text color for holidays not in the actual month. */ | 298 | /** default text color for holidays not in the actual month. */ |
298 | QColor mHolidayColorShaded; | 299 | QColor mHolidayColorShaded; |
299 | 300 | ||
300 | /** text color for selected days. */ | 301 | /** text color for selected days. */ |
301 | QColor mSelectedDaysColor; | 302 | QColor mSelectedDaysColor; |
302 | 303 | ||
303 | /** default width of the frame drawn around today if it is visible in the matrix. */ | 304 | /** default width of the frame drawn around today if it is visible in the matrix. */ |
304 | int mTodayMarginWidth; | 305 | int mTodayMarginWidth; |
305 | 306 | ||
306 | /** stores actual size of each day in the widget so that I dont need to ask this data | 307 | /** stores actual size of each day in the widget so that I dont need to ask this data |
307 | * on every repaint. | 308 | * on every repaint. |
308 | */ | 309 | */ |
309 | QRect daysize; | 310 | QRect daysize; |
310 | 311 | ||
311 | }; | 312 | }; |
312 | 313 | ||
313 | #endif | 314 | #endif |