kdatenavigator.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KDATENAVIGATOR_H
00024 #define KDATENAVIGATOR_H
00025
00026 #include <qframe.h>
00027 #include <qdatetime.h>
00028 #include <qlabel.h>
00029
00030 #include <libkcal/calendar.h>
00031
00032 #include "kodaymatrix.h"
00033
00034 class QPushButton;
00035 class QTimer;
00036
00037 class KCalendarSystem;
00038
00039 class KDateNavigator: public QFrame
00040 {
00041 Q_OBJECT
00042 public:
00043 KDateNavigator( QWidget *parent = 0, Calendar *calendar = 0,
00044 bool show_week_numbers = false, const char *name = 0,
00045 QDate date = QDate::currentDate() );
00046 ~KDateNavigator();
00047
00058 enum RolloverType { None, FollowDay, FollowMonth } ;
00059 void enableRollover( RolloverType );
00060
00061 void setShowWeekNums( bool enabled );
00062
00063 public slots:
00064 void selectDates( const KCal::DateList & );
00065 void updateView();
00066 void updateConfig();
00067 void updateDayMatrix();
00068
00069 signals:
00070 void datesSelected( const KCal::DateList & );
00071 void eventDropped( Event * );
00072 void weekClicked( const QDate &);
00073
00074 void goPrevious();
00075 void goNext();
00076
00077 void goNextMonth();
00078 void goPrevMonth();
00079 void goNextYear();
00080 void goPrevYear();
00081
00082
00083 void dayPassed( QDate );
00084 void monthPassed( QDate );
00085
00086 protected slots:
00087
00097 void possiblyPastMidnight();
00098
00102 void passedMidnight();
00103
00104 protected:
00105 void updateDates();
00106
00107 void wheelEvent (QWheelEvent *);
00108
00109 bool eventFilter (QObject *,QEvent *);
00110
00111 private:
00112 QFrame *ctrlFrame;
00113 QPushButton *prevYear;
00114 QPushButton *prevMonth;
00115 QPushButton *nextMonth;
00116 QPushButton *nextYear;
00117 QLabel *dateLabel;
00118 QFrame *headingSep;
00119 QFrame *weeknumSep;
00120 QLabel *headings[7];
00121 QLabel *weeknos[7];
00122 KODayMatrix *daymatrix;
00123
00124 KCal::DateList mSelectedDates;
00125 QDate m_MthYr;
00126 int m_fstDayOfWk;
00127 bool m_bShowWeekNums;
00128
00129 int dayNum(int row, int col);
00130 int dayToIndex(int dayNum);
00131
00132 Calendar *mCalendar;
00133 KCalendarSystem *mCalendarSystem;
00134
00135 const QString *curHeaders;
00136
00137
00141 QTimer *updateTimer;
00142 QDate lastDayChecked;
00143 RolloverType updateRollover;
00144
00145
00146 KDateNavigator(const KDateNavigator & );
00147 KDateNavigator &operator=(const KDateNavigator &);
00148 };
00149
00150 #endif
This file is part of the documentation for kdelibs Version 3.1.4.