-rw-r--r-- | korganizer/kdatenavigator.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kdatenavigator.h b/korganizer/kdatenavigator.h index 77b9b7c..10bc1be 100644 --- a/korganizer/kdatenavigator.h +++ b/korganizer/kdatenavigator.h | |||
@@ -19,143 +19,145 @@ | |||
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 KDATENAVIGATOR_H | 23 | #ifndef KDATENAVIGATOR_H |
24 | #define KDATENAVIGATOR_H | 24 | #define KDATENAVIGATOR_H |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | 29 | ||
30 | #include <libkcal/calendar.h> | 30 | #include <libkcal/calendar.h> |
31 | 31 | ||
32 | #include "kodaymatrix.h" | 32 | #include "kodaymatrix.h" |
33 | 33 | ||
34 | class QPushButton; | 34 | class QPushButton; |
35 | class QTimer; | 35 | class QTimer; |
36 | 36 | ||
37 | class KCalendarSystem; | 37 | class KCalendarSystem; |
38 | 38 | ||
39 | class NavigatorBar; | 39 | class NavigatorBar; |
40 | 40 | ||
41 | class KDateNavigator: public QFrame | 41 | class KDateNavigator: public QFrame |
42 | { | 42 | { |
43 | Q_OBJECT | 43 | Q_OBJECT |
44 | public: | 44 | public: |
45 | KDateNavigator( QWidget *parent = 0,const char *name = 0 ); | 45 | KDateNavigator( QWidget *parent = 0,const char *name = 0 ); |
46 | ~KDateNavigator(); | 46 | ~KDateNavigator(); |
47 | 47 | ||
48 | /** The DateNavigator automatically checks for | 48 | /** The DateNavigator automatically checks for |
49 | * the passage of midnight. If rollover type is | 49 | * the passage of midnight. If rollover type is |
50 | * set to None, no signals are emitted and no | 50 | * set to None, no signals are emitted and no |
51 | * processing is done. With rollover set to | 51 | * processing is done. With rollover set to |
52 | * FollowDay, the day highlighter changes at | 52 | * FollowDay, the day highlighter changes at |
53 | * midnight and dayPassed() is emitted. | 53 | * midnight and dayPassed() is emitted. |
54 | * With FollowMonth, it has the same effect | 54 | * With FollowMonth, it has the same effect |
55 | * as FollowDay but also adjusts the month that is | 55 | * as FollowDay but also adjusts the month that is |
56 | * visible and emits monthPassed() when the month changes. | 56 | * visible and emits monthPassed() when the month changes. |
57 | */ | 57 | */ |
58 | enum RolloverType { None, FollowDay, FollowMonth } ; | 58 | enum RolloverType { None, FollowDay, FollowMonth } ; |
59 | void enableRollover( RolloverType ); | 59 | void enableRollover( RolloverType ); |
60 | 60 | ||
61 | void setShowWeekNums( bool enabled ); | 61 | void setShowWeekNums( bool enabled ); |
62 | void setCalendar( Calendar * ); | 62 | void setCalendar( Calendar * ); |
63 | void setBaseDate( const QDate & , bool doRepaint = true ); | 63 | void setBaseDate( const QDate & , bool doRepaint = true ); |
64 | KCal::DateList selectedDates() const { return mSelectedDates; } | 64 | KCal::DateList selectedDates() const { return mSelectedDates; } |
65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } | 65 | NavigatorBar *navigatorBar() const { return mNavigatorBar; } |
66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} | 66 | void setMonthSignalOffset ( int off ) { mMonthSignalOffset = off%12;} |
67 | QSize yourSizeHint() { return mySizeHint; } | 67 | QSize yourSizeHint()const { return mySizeHint; }; |
68 | QSize yourFullSizeHint() const { return myFullSizeHint;}; | ||
68 | QFont yourFontHint( QSize , bool * b); | 69 | QFont yourFontHint( QSize , bool * b); |
69 | bool fontChanged() {return mFontChanged; } | 70 | bool fontChanged() {return mFontChanged; } |
70 | void unsetFontChanged() { mFontChanged = false; } | 71 | void unsetFontChanged() { mFontChanged = false; } |
71 | KODayMatrix *dayMatrix() { return daymatrix ;} | 72 | KODayMatrix *dayMatrix() { return daymatrix ;} |
72 | QSize sizeHint() const; | 73 | QSize sizeHint() const; |
73 | QSize sizeHintTwoButtons() const; | 74 | QSize sizeHintTwoButtons( int butnum = 2 ) const; |
74 | void changeFont ( QFont fo ); | 75 | void changeFont ( QFont fo ); |
75 | public slots: | 76 | public slots: |
76 | void selectDates( const KCal::DateList & ); | 77 | void selectDates( const KCal::DateList & ); |
77 | void updateView(); | 78 | void updateView(); |
78 | void updateConfig(); | 79 | void updateConfig(); |
79 | void updateDayMatrix(); | 80 | void updateDayMatrix(); |
80 | 81 | ||
81 | signals: | 82 | signals: |
82 | void datesSelected( const KCal::DateList & ); | 83 | void datesSelected( const KCal::DateList & ); |
83 | void eventDropped( Event * ); | 84 | void eventDropped( Event * ); |
84 | void weekClicked( const QDate &); | 85 | void weekClicked( const QDate &); |
85 | 86 | ||
86 | void goPrevious(); | 87 | void goPrevious(); |
87 | void goNext(); | 88 | void goNext(); |
88 | 89 | ||
89 | void goNextMonth(); | 90 | void goNextMonth(); |
90 | void goPrevMonth(); | 91 | void goPrevMonth(); |
91 | void goNextYear(); | 92 | void goNextYear(); |
92 | void goPrevYear(); | 93 | void goPrevYear(); |
93 | void monthSelected( int ); | 94 | void monthSelected( int ); |
94 | 95 | ||
95 | // Signals emitted at midnight carrying the new date. | 96 | // Signals emitted at midnight carrying the new date. |
96 | void dayPassed( QDate ); | 97 | void dayPassed( QDate ); |
97 | void monthPassed( QDate ); | 98 | void monthPassed( QDate ); |
98 | 99 | ||
99 | protected slots: | 100 | protected slots: |
100 | 101 | ||
101 | /** | 102 | /** |
102 | * Called regularly to see if we need to update the view | 103 | * Called regularly to see if we need to update the view |
103 | * wrt. the today box and the month box. Only important | 104 | * wrt. the today box and the month box. Only important |
104 | * if you leave KOrganizer idle for long periods of time. | 105 | * if you leave KOrganizer idle for long periods of time. |
105 | * | 106 | * |
106 | * Until we have a reliable way of setting QTimers to go | 107 | * Until we have a reliable way of setting QTimers to go |
107 | * off at a particular wall-clock time, we need this, | 108 | * off at a particular wall-clock time, we need this, |
108 | * which calls passedMidnight() at the right moments. | 109 | * which calls passedMidnight() at the right moments. |
109 | */ | 110 | */ |
110 | void possiblyPastMidnight(); | 111 | void possiblyPastMidnight(); |
111 | 112 | ||
112 | /** handles updating the view when midnight has come by due to idle time. | 113 | /** handles updating the view when midnight has come by due to idle time. |
113 | * | 114 | * |
114 | */ | 115 | */ |
115 | void passedMidnight(); | 116 | void passedMidnight(); |
116 | void slotMonthSelected( int m ); | 117 | void slotMonthSelected( int m ); |
117 | protected: | 118 | protected: |
118 | void updateDates(); | 119 | void updateDates(); |
119 | 120 | ||
120 | void wheelEvent (QWheelEvent *); | 121 | void wheelEvent (QWheelEvent *); |
121 | 122 | ||
122 | bool eventFilter (QObject *,QEvent *); | 123 | bool eventFilter (QObject *,QEvent *); |
123 | 124 | ||
124 | private: | 125 | private: |
125 | QSize mySizeHint; | 126 | QSize mySizeHint; |
127 | QSize myFullSizeHint; | ||
126 | bool mFontChanged; | 128 | bool mFontChanged; |
127 | int mMonthSignalOffset; | 129 | int mMonthSignalOffset; |
128 | NavigatorBar *mNavigatorBar; | 130 | NavigatorBar *mNavigatorBar; |
129 | 131 | ||
130 | QFrame *headingSep; | 132 | QFrame *headingSep; |
131 | QFrame *weeknumSep; | 133 | QFrame *weeknumSep; |
132 | QLabel *headings[7]; | 134 | QLabel *headings[7]; |
133 | QLabel *weeknos[7]; | 135 | QLabel *weeknos[7]; |
134 | KODayMatrix *daymatrix; | 136 | KODayMatrix *daymatrix; |
135 | 137 | ||
136 | KCal::DateList mSelectedDates; | 138 | KCal::DateList mSelectedDates; |
137 | QDate m_MthYr; | 139 | QDate m_MthYr; |
138 | int m_fstDayOfWk; | 140 | int m_fstDayOfWk; |
139 | bool m_bShowWeekNums; | 141 | bool m_bShowWeekNums; |
140 | 142 | ||
141 | int dayNum(int row, int col); | 143 | int dayNum(int row, int col); |
142 | int dayToIndex(int dayNum); | 144 | int dayToIndex(int dayNum); |
143 | 145 | ||
144 | Calendar *mCalendar; | 146 | Calendar *mCalendar; |
145 | KCalendarSystem *mCalendarSystem; | 147 | KCalendarSystem *mCalendarSystem; |
146 | 148 | ||
147 | const QString *curHeaders; | 149 | const QString *curHeaders; |
148 | 150 | ||
149 | /** used to update the day view periodically, in particular every | 151 | /** used to update the day view periodically, in particular every |
150 | * midnight to move the "today" rectangle. | 152 | * midnight to move the "today" rectangle. |
151 | */ | 153 | */ |
152 | QTimer *updateTimer; | 154 | QTimer *updateTimer; |
153 | QDate lastDayChecked; | 155 | QDate lastDayChecked; |
154 | RolloverType updateRollover; | 156 | RolloverType updateRollover; |
155 | 157 | ||
156 | // Disabling copy constructor and assignment operator | 158 | // Disabling copy constructor and assignment operator |
157 | KDateNavigator(const KDateNavigator & ); | 159 | KDateNavigator(const KDateNavigator & ); |
158 | KDateNavigator &operator=(const KDateNavigator &); | 160 | KDateNavigator &operator=(const KDateNavigator &); |
159 | }; | 161 | }; |
160 | 162 | ||
161 | #endif | 163 | #endif |