-rw-r--r-- | microkde/kdatetbl.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h index b4d3e16..2efa532 100644 --- a/microkde/kdatetbl.h +++ b/microkde/kdatetbl.h | |||
@@ -246,64 +246,127 @@ public: | |||
246 | 246 | ||
247 | protected: | 247 | protected: |
248 | bool mMarkCurrent; | 248 | bool mMarkCurrent; |
249 | /** | 249 | /** |
250 | * Paint a cell. | 250 | * Paint a cell. |
251 | */ | 251 | */ |
252 | virtual void paintCell(QPainter*, int, int); | 252 | virtual void paintCell(QPainter*, int, int); |
253 | /** | 253 | /** |
254 | * Handle the resize events. | 254 | * Handle the resize events. |
255 | */ | 255 | */ |
256 | virtual void viewportResizeEvent(QResizeEvent *); | 256 | virtual void viewportResizeEvent(QResizeEvent *); |
257 | /** | 257 | /** |
258 | * React on mouse clicks that select a date. | 258 | * React on mouse clicks that select a date. |
259 | */ | 259 | */ |
260 | virtual void contentsMousePressEvent(QMouseEvent *); | 260 | virtual void contentsMousePressEvent(QMouseEvent *); |
261 | virtual void keyPressEvent( QKeyEvent *e ); | 261 | virtual void keyPressEvent( QKeyEvent *e ); |
262 | virtual void focusInEvent( QFocusEvent *e ); | 262 | virtual void focusInEvent( QFocusEvent *e ); |
263 | virtual void focusOutEvent( QFocusEvent *e ); | 263 | virtual void focusOutEvent( QFocusEvent *e ); |
264 | /** | 264 | /** |
265 | * The font size of the displayed text. | 265 | * The font size of the displayed text. |
266 | */ | 266 | */ |
267 | int fontsize; | 267 | int fontsize; |
268 | /** | 268 | /** |
269 | * The currently selected date. | 269 | * The currently selected date. |
270 | */ | 270 | */ |
271 | QDate date; | 271 | QDate date; |
272 | /** | 272 | /** |
273 | * The day of the first day in the month [1..7]. | 273 | * The day of the first day in the month [1..7]. |
274 | */ | 274 | */ |
275 | int firstday; | 275 | int firstday; |
276 | /** | 276 | /** |
277 | * The number of days in the current month. | 277 | * The number of days in the current month. |
278 | */ | 278 | */ |
279 | int numdays; | 279 | int numdays; |
280 | /** | 280 | /** |
281 | * The number of days in the previous month. | 281 | * The number of days in the previous month. |
282 | */ | 282 | */ |
283 | int numDaysPrevMonth; | 283 | int numDaysPrevMonth; |
284 | /** | 284 | /** |
285 | * unused | 285 | * unused |
286 | */ | 286 | */ |
287 | bool unused_hasSelection; | 287 | bool unused_hasSelection; |
288 | /** | 288 | /** |
289 | * Save the size of the largest used cell content. | 289 | * Save the size of the largest used cell content. |
290 | */ | 290 | */ |
291 | QRect maxCell; | 291 | QRect maxCell; |
292 | signals: | 292 | signals: |
293 | /** | 293 | /** |
294 | * The selected date changed. | 294 | * The selected date changed. |
295 | */ | 295 | */ |
296 | void dateChanged(QDate); | 296 | void dateChanged(QDate); |
297 | /** | 297 | /** |
298 | * A date has been selected by clicking on the table. | 298 | * A date has been selected by clicking on the table. |
299 | */ | 299 | */ |
300 | void tableClicked(); | 300 | void tableClicked(); |
301 | 301 | ||
302 | protected: | 302 | protected: |
303 | virtual void virtual_hook( int id, void* data ); | 303 | virtual void virtual_hook( int id, void* data ); |
304 | private: | 304 | private: |
305 | class KDateTablePrivate; | 305 | class KDateTablePrivate; |
306 | KDateTablePrivate *d; | 306 | KDateTablePrivate *d; |
307 | }; | 307 | }; |
308 | 308 | ||
309 | #endif // KDATETBL_H | 309 | #endif // KDATETBL_H |
310 | class KDateInternalWeekPicker : public QGridView | ||
311 | { | ||
312 | Q_OBJECT | ||
313 | protected: | ||
314 | /** | ||
315 | * Store the month that has been clicked [1..12]. | ||
316 | */ | ||
317 | int result; | ||
318 | /** | ||
319 | * the cell under mouse cursor when LBM is pressed | ||
320 | */ | ||
321 | short int activeCol; | ||
322 | short int activeRow; | ||
323 | /** | ||
324 | * Contains the largest rectangle needed by the month names. | ||
325 | */ | ||
326 | QRect max; | ||
327 | signals: | ||
328 | /** | ||
329 | * This is send from the mouse click event handler. | ||
330 | */ | ||
331 | void closeMe(int); | ||
332 | public: | ||
333 | /** | ||
334 | * The constructor. | ||
335 | */ | ||
336 | KDateInternalWeekPicker(int fontsize, QWidget* parent, const char* name=0); | ||
337 | /** | ||
338 | * The size hint. | ||
339 | */ | ||
340 | QSize sizeHint() const; | ||
341 | /** | ||
342 | * Return the result. 0 means no selection (reject()), 1..12 are the | ||
343 | * months. | ||
344 | */ | ||
345 | int getResult() const; | ||
346 | protected: | ||
347 | /** | ||
348 | * Set up the painter. | ||
349 | */ | ||
350 | void setupPainter(QPainter *p); | ||
351 | /** | ||
352 | * The resize event. | ||
353 | */ | ||
354 | void viewportResizeEvent(QResizeEvent*); | ||
355 | /** | ||
356 | * Paint a cell. This simply draws the month names in it. | ||
357 | */ | ||
358 | virtual void paintCell(QPainter* painter, int row, int col); | ||
359 | /** | ||
360 | * Catch mouse click and move events to paint a rectangle around the item. | ||
361 | */ | ||
362 | void contentsMousePressEvent(QMouseEvent *e); | ||
363 | void contentsMouseMoveEvent(QMouseEvent *e); | ||
364 | /** | ||
365 | * Emit monthSelected(int) when a cell has been released. | ||
366 | */ | ||
367 | void contentsMouseReleaseEvent(QMouseEvent *e); | ||
368 | |||
369 | private: | ||
370 | class KDateInternalMonthPrivate; | ||
371 | KDateInternalMonthPrivate *d; | ||
372 | }; | ||