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
00024 #ifndef KDATENAVIGATOR_H
00025 #define KDATENAVIGATOR_H
00026
00027 #include <qframe.h>
00028 #include <qdatetime.h>
00029 #include <qlabel.h>
00030
00031 #include <libkcal/calendar.h>
00032
00033 #include "kodaymatrix.h"
00034
00035 class QPushButton;
00036 class QTimer;
00037
00038 class KCalendarSystem;
00039
00040 class NavigatorBar;
00041
00042 class KDateNavigator: public QFrame
00043 {
00044 Q_OBJECT
00045 public:
00046 KDateNavigator( QWidget *parent = 0,
00047 bool show_week_numbers = false, const char *name = 0,
00048 QDate date = QDate::currentDate() );
00049 ~KDateNavigator();
00050
00054 void setCalendar( Calendar * );
00055
00066 enum RolloverType { None, FollowDay, FollowMonth } ;
00067 void enableRollover( RolloverType );
00068
00069 void setShowWeekNums( bool enabled );
00070
00071 public slots:
00072 void selectDates( const KCal::DateList & );
00073 void updateView();
00074 void updateConfig();
00075 void updateDayMatrix();
00076
00077 signals:
00078 void datesSelected( const KCal::DateList & );
00079 void eventDropped( Event * );
00080 void eventDroppedMove( Event *, Event * );
00081 void todoDropped( Todo * );
00082 void todoDroppedMove( Todo *, Todo * );
00083 void weekClicked( const QDate &);
00084
00085 void goPrevious();
00086 void goNext();
00087
00088 void goNextMonth();
00089 void goPrevMonth();
00090 void goNextYear();
00091 void goPrevYear();
00092
00093 void goMonth( int month );
00094
00095
00096 void dayPassed( QDate );
00097 void monthPassed( QDate );
00098
00099 protected slots:
00109 void possiblyPastMidnight();
00110
00114 void passedMidnight();
00115
00116 protected:
00117 void updateDates();
00118
00119 void wheelEvent( QWheelEvent * );
00120
00121 bool eventFilter( QObject *,QEvent * );
00122
00123 private:
00124 int dayNum( int row, int col );
00125 int dayToIndex( int dayNum );
00126
00127 NavigatorBar *mNavigatorBar;
00128
00129 QFrame *headingSep;
00130 QFrame *weeknumSep;
00131 QLabel *headings[ 7 ];
00132 QLabel *weeknos[ 7 ];
00133
00134 KODayMatrix *mDayMatrix;
00135
00136 KCal::DateList mSelectedDates;
00137 QDate m_MthYr;
00138 int m_fstDayOfWk;
00139 bool m_bShowWeekNums;
00140
00141 KCalendarSystem *mCalendarSystem;
00142
00143 const QString *curHeaders;
00144
00148 QTimer *updateTimer;
00149 QDate lastDayChecked;
00150 RolloverType updateRollover;
00151
00152
00153 KDateNavigator( const KDateNavigator & );
00154 KDateNavigator &operator=( const KDateNavigator & );
00155 };
00156
00157 #endif
This file is part of the documentation for korganizer Library Version 3.2.2.