-rw-r--r-- | korganizer/koagendaview.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index cbe86b6..e9e85cc 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -16,44 +16,69 @@ | |||
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
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 KOAGENDAVIEW_H | 23 | #ifndef KOAGENDAVIEW_H |
24 | #define KOAGENDAVIEW_H | 24 | #define KOAGENDAVIEW_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <qscrollview.h> |
27 | #include <qdatetime.h> | 27 | #include <qdatetime.h> |
28 | #include <qpushbutton.h> | ||
28 | #include <qlayout.h> | 29 | #include <qlayout.h> |
29 | #ifndef DESKTOP_VERSION | 30 | #ifndef DESKTOP_VERSION |
30 | #include <qksplitter.h> | 31 | #include <qksplitter.h> |
31 | #else | 32 | #else |
32 | #include <qsplitter.h> | 33 | #include <qsplitter.h> |
33 | #endif | 34 | #endif |
34 | #include <qmemarray.h> | 35 | #include <qmemarray.h> |
35 | 36 | ||
36 | #include "koeventview.h" | 37 | #include "koeventview.h" |
37 | 38 | ||
38 | |||
39 | class QHBox; | 39 | class QHBox; |
40 | class QFrame; | 40 | class QFrame; |
41 | class QLabel; | 41 | class QLabel; |
42 | class QPushButton; | 42 | class QPushButton; |
43 | class CalendarView; | 43 | class CalendarView; |
44 | class KOAgenda; | 44 | class KOAgenda; |
45 | class KOAgendaItem; | 45 | class KOAgendaItem; |
46 | class KConfig; | 46 | class KConfig; |
47 | class KDGanttMinimizeSplitter; | 47 | class KDGanttMinimizeSplitter; |
48 | |||
49 | class KOAgendaButton : public QPushButton | ||
50 | { | ||
51 | Q_OBJECT | ||
52 | public: | ||
53 | KOAgendaButton( QWidget *parent=0, const char *name=0 ) : | ||
54 | QPushButton( parent, name ) | ||
55 | { | ||
56 | mNum = -3; | ||
57 | setFlat( true ); | ||
58 | setFocusPolicy(NoFocus); | ||
59 | setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding )); | ||
60 | connect( this, SIGNAL( clicked() ), this, SLOT ( bClicked() ) ); | ||
61 | }; | ||
62 | |||
63 | QSize sizeHint () const { return QSize( 5,5) ;} | ||
64 | void setNum( int n) { mNum = n; } | ||
65 | private slots: | ||
66 | void bClicked() {emit numClicked( mNum);} | ||
67 | signals: | ||
68 | void numClicked( int ); | ||
69 | private: | ||
70 | int mNum; | ||
71 | }; | ||
72 | |||
48 | class TimeLabels : public QScrollView { | 73 | class TimeLabels : public QScrollView { |
49 | Q_OBJECT | 74 | Q_OBJECT |
50 | public: | 75 | public: |
51 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); | 76 | TimeLabels(int rows,QWidget *parent=0,const char *name=0,WFlags f=0); |
52 | 77 | ||
53 | void setCellHeight(int height); | 78 | void setCellHeight(int height); |
54 | 79 | ||
55 | /** Calculates the minimum width */ | 80 | /** Calculates the minimum width */ |
56 | virtual int minimumWidth() const; | 81 | virtual int minimumWidth() const; |
57 | 82 | ||
58 | /** updates widget's internal state */ | 83 | /** updates widget's internal state */ |
59 | void updateConfig(); | 84 | void updateConfig(); |
@@ -181,43 +206,43 @@ class KOAgendaView : public KOEventView { | |||
181 | void scrollOneHourDown(); | 206 | void scrollOneHourDown(); |
182 | void addToCalSlot(Incidence *, Incidence *); | 207 | void addToCalSlot(Incidence *, Incidence *); |
183 | 208 | ||
184 | signals: | 209 | signals: |
185 | void showDateView( int, QDate ); | 210 | void showDateView( int, QDate ); |
186 | void newTodoSignal( QDateTime ,bool ); | 211 | void newTodoSignal( QDateTime ,bool ); |
187 | void toggleExpand(); | 212 | void toggleExpand(); |
188 | void todoMoved( Todo *, int ); | 213 | void todoMoved( Todo *, int ); |
189 | void incidenceChanged(Incidence * , int ); | 214 | void incidenceChanged(Incidence * , int ); |
190 | // void cloneIncidenceSignal(Incidence *); | 215 | // void cloneIncidenceSignal(Incidence *); |
191 | 216 | ||
192 | protected: | 217 | protected: |
193 | QPushButton* getNewDaylabel(); | 218 | KOAgendaButton* getNewDaylabel(); |
194 | bool mBlockUpdating; | 219 | bool mBlockUpdating; |
195 | int mUpcomingWidth; | 220 | int mUpcomingWidth; |
196 | /** Fill agenda beginning with date startDate */ | 221 | /** Fill agenda beginning with date startDate */ |
197 | void fillAgenda(const QDate &startDate); | 222 | void fillAgenda(const QDate &startDate); |
198 | void resizeEvent( QResizeEvent* e ); | 223 | void resizeEvent( QResizeEvent* e ); |
199 | /** Fill agenda using the current set value for the start date */ | 224 | /** Fill agenda using the current set value for the start date */ |
200 | void fillAgenda(); | 225 | void fillAgenda(); |
201 | 226 | ||
202 | /** Create labels for the selected dates. */ | 227 | /** Create labels for the selected dates. */ |
203 | void createDayLabels(); | 228 | void createDayLabels(); |
204 | 229 | ||
205 | /** | 230 | /** |
206 | Set the masks on the agenda widgets indicating, which days are holidays. | 231 | Set the masks on the agenda widgets indicating, which days are holidays. |
207 | */ | 232 | */ |
208 | void setHolidayMasks(); | 233 | void setHolidayMasks(); |
209 | 234 | ||
210 | protected slots: | 235 | protected slots: |
211 | void slotDaylabelClicked(); | 236 | void slotDaylabelClicked( int ); |
212 | /** Update event belonging to agenda item */ | 237 | /** Update event belonging to agenda item */ |
213 | void updateEventDates(KOAgendaItem *item, int mode = -1); | 238 | void updateEventDates(KOAgendaItem *item, int mode = -1); |
214 | //void updateMovedTodo(); | 239 | //void updateMovedTodo(); |
215 | 240 | ||
216 | void updateEventIndicatorTop(int newY); | 241 | void updateEventIndicatorTop(int newY); |
217 | void updateEventIndicatorBottom(int newY); | 242 | void updateEventIndicatorBottom(int newY); |
218 | 243 | ||
219 | /** Updates data for selected timespan */ | 244 | /** Updates data for selected timespan */ |
220 | void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); | 245 | void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); |
221 | /** Updates data for selected timespan for all day event*/ | 246 | /** Updates data for selected timespan for all day event*/ |
222 | void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); | 247 | void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); |
223 | 248 | ||
@@ -245,20 +270,20 @@ class KOAgendaView : public KOEventView { | |||
245 | KOEventPopupMenu *mAllDayAgendaPopup; | 270 | KOEventPopupMenu *mAllDayAgendaPopup; |
246 | 271 | ||
247 | EventIndicator *mEventIndicatorTop; | 272 | EventIndicator *mEventIndicatorTop; |
248 | EventIndicator *mEventIndicatorBottom; | 273 | EventIndicator *mEventIndicatorBottom; |
249 | 274 | ||
250 | QMemArray<int> mMinY; | 275 | QMemArray<int> mMinY; |
251 | QMemArray<int> mMaxY; | 276 | QMemArray<int> mMaxY; |
252 | 277 | ||
253 | QMemArray<bool> mHolidayMask; | 278 | QMemArray<bool> mHolidayMask; |
254 | 279 | ||
255 | QPixmap mExpandedPixmap; | 280 | QPixmap mExpandedPixmap; |
256 | QPixmap mNotExpandedPixmap; | 281 | QPixmap mNotExpandedPixmap; |
257 | QPtrList<QPushButton> mDayLabelsList; | 282 | QPtrList<KOAgendaButton> mDayLabelsList; |
258 | QDateTime mTimeSpanBegin; | 283 | QDateTime mTimeSpanBegin; |
259 | QDateTime mTimeSpanEnd; | 284 | QDateTime mTimeSpanEnd; |
260 | bool mTimeSpanInAllDay; | 285 | bool mTimeSpanInAllDay; |
261 | void keyPressEvent ( QKeyEvent * e ); | 286 | void keyPressEvent ( QKeyEvent * e ); |
262 | }; | 287 | }; |
263 | 288 | ||
264 | #endif // KOAGENDAVIEW_H | 289 | #endif // KOAGENDAVIEW_H |