summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.h
Unidiff
Diffstat (limited to 'korganizer/komonthview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index a29a1a8..bf861ef 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -1,86 +1,87 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
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 19
20#ifndef _KOMONTHVIEW_H 20#ifndef _KOMONTHVIEW_H
21#define _KOMONTHVIEW_H 21#define _KOMONTHVIEW_H
22 22
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qframe.h> 24#include <qframe.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <qlistbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h> 28#include <qwidgetstack.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qintdict.h> 30#include <qintdict.h>
31#include <qpushbutton.h> 31#include <qpushbutton.h>
32#include <qvaluelist.h> 32#include <qvaluelist.h>
33#include <qptrvector.h> 33#include <qptrvector.h>
34 34
35#include <libkcal/calendar.h> 35#include <libkcal/calendar.h>
36#include <libkcal/event.h> 36#include <libkcal/event.h>
37 37
38#include "koeventview.h" 38#include "koeventview.h"
39#include "navigatorbar.h"
39 40
40#ifdef DESKTOP_VERSION 41#ifdef DESKTOP_VERSION
41class QToolTipGroup; 42class QToolTipGroup;
42#endif 43#endif
43 44
44class KNOWhatsThis; 45class KNOWhatsThis;
45class KOWeekButton : public QPushButton 46class KOWeekButton : public QPushButton
46{ 47{
47 Q_OBJECT 48 Q_OBJECT
48 public: 49 public:
49 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 50 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
50 QPushButton( parent, name) 51 QPushButton( parent, name)
51 { 52 {
52 connect( this, SIGNAL( clicked() ), 53 connect( this, SIGNAL( clicked() ),
53 SLOT( bottonClicked() )); 54 SLOT( bottonClicked() ));
54 mNumber = -1; 55 mNumber = -1;
55 } 56 }
56 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 57 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
57 int getWeekNum() { return mNumber;} 58 int getWeekNum() { return mNumber;}
58 signals: 59 signals:
59 void selectWeekNum ( int ); 60 void selectWeekNum ( int );
60private: 61private:
61 int mNumber; 62 int mNumber;
62private slots : 63private slots :
63 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 64 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
64}; 65};
65 66
66class KNoScrollListBox: public QListBox 67class KNoScrollListBox: public QListBox
67{ 68{
68 Q_OBJECT 69 Q_OBJECT
69 public: 70 public:
70 KNoScrollListBox(QWidget *parent=0, const char *name=0); 71 KNoScrollListBox(QWidget *parent=0, const char *name=0);
71 ~KNoScrollListBox(); 72 ~KNoScrollListBox();
72 QString getWhatsThisText(QPoint p) ; 73 QString getWhatsThisText(QPoint p) ;
73 74
74 signals: 75 signals:
75 void shiftDown(); 76 void shiftDown();
76 void shiftUp(); 77 void shiftUp();
77 void rightClick(); 78 void rightClick();
78 79
79 protected slots: 80 protected slots:
80 void oneDown(); 81 void oneDown();
81 void keyPressEvent(QKeyEvent *); 82 void keyPressEvent(QKeyEvent *);
82 void keyReleaseEvent(QKeyEvent *); 83 void keyReleaseEvent(QKeyEvent *);
83 void mousePressEvent(QMouseEvent *); 84 void mousePressEvent(QMouseEvent *);
84 85
85 private: 86 private:
86 KNOWhatsThis * mWT; 87 KNOWhatsThis * mWT;
@@ -182,114 +183,115 @@ class MonthViewCell : public QWidget
182 bool mPrimary; 183 bool mPrimary;
183 bool mHoliday; 184 bool mHoliday;
184 QString mHolidayString; 185 QString mHolidayString;
185 186
186 //QLabel *mLabel; 187 //QLabel *mLabel;
187 QPushButton *mLabel; 188 QPushButton *mLabel;
188 QListBox *mItemList; 189 QListBox *mItemList;
189#ifdef DESKTOP_VERSION 190#ifdef DESKTOP_VERSION
190 static QToolTipGroup *mToolTipGroup; 191 static QToolTipGroup *mToolTipGroup;
191#endif 192#endif
192 QSize mLabelSize; 193 QSize mLabelSize;
193 QSize mLabelBigSize; 194 QSize mLabelBigSize;
194 QPalette mHolidayPalette; 195 QPalette mHolidayPalette;
195 QPalette mStandardPalette; 196 QPalette mStandardPalette;
196 QPalette mPrimaryPalette; 197 QPalette mPrimaryPalette;
197 QPalette mNonPrimaryPalette; 198 QPalette mNonPrimaryPalette;
198 void setMyPalette(); 199 void setMyPalette();
199 QPalette getPalette (); 200 QPalette getPalette ();
200 void keyPressEvent ( QKeyEvent * ) ; 201 void keyPressEvent ( QKeyEvent * ) ;
201 202
202}; 203};
203 204
204 205
205class KOMonthView: public KOEventView 206class KOMonthView: public KOEventView
206{ 207{
207 Q_OBJECT 208 Q_OBJECT
208 public: 209 public:
209 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 210 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
210 ~KOMonthView(); 211 ~KOMonthView();
211 212
212 /** Returns maximum number of days supported by the komonthview */ 213 /** Returns maximum number of days supported by the komonthview */
213 virtual int maxDatesHint(); 214 virtual int maxDatesHint();
214 215
215 /** Returns number of currently shown dates. */ 216 /** Returns number of currently shown dates. */
216 virtual int currentDateCount(); 217 virtual int currentDateCount();
217 218
218 /** returns the currently selected events */ 219 /** returns the currently selected events */
219 virtual QPtrList<Incidence> selectedIncidences(); 220 virtual QPtrList<Incidence> selectedIncidences();
220 221
221 /** returns dates of the currently selected events */ 222 /** returns dates of the currently selected events */
222 virtual DateList selectedDates(); 223 virtual DateList selectedDates();
223 224
224 virtual void printPreview(CalPrinter *calPrinter, 225 virtual void printPreview(CalPrinter *calPrinter,
225 const QDate &, const QDate &); 226 const QDate &, const QDate &);
226 bool isMonthView() { return true; } 227 bool isMonthView() { return true; }
227 bool isUpdatePossible() { return updatePossible; } 228 bool isUpdatePossible() { return updatePossible; }
228 229
229 MonthViewCell * selectedCell(); 230 MonthViewCell * selectedCell();
230 bool skipResize; 231 bool skipResize;
232 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
231 public slots: 233 public slots:
232 virtual void updateView(); 234 virtual void updateView();
233 virtual void updateConfig(); 235 virtual void updateConfig();
234 virtual void showDates(const QDate &start, const QDate &end); 236 virtual void showDates(const QDate &start, const QDate &end);
235 virtual void showEvents(QPtrList<Event> eventList); 237 virtual void showEvents(QPtrList<Event> eventList);
236 238
237 void changeEventDisplay(Event *, int); 239 void changeEventDisplay(Event *, int);
238 240
239 void clearSelection(); 241 void clearSelection();
240 242
241 void showContextMenu( Incidence * ); 243 void showContextMenu( Incidence * );
242 244
243 void setSelectedCell( MonthViewCell * ); 245 void setSelectedCell( MonthViewCell * );
244 246
245 protected slots: 247 protected slots:
246 void selectInternalWeekNum ( int ); 248 void selectInternalWeekNum ( int );
247 void switchView(); 249 void switchView();
248 void processSelectionChange(); 250 void processSelectionChange();
249 signals: 251 signals:
250 void nextMonth(); 252 void nextMonth();
251 void prevMonth(); 253 void prevMonth();
252 void showNavigator( bool );
253 void selectWeekNum ( int ); 254 void selectWeekNum ( int );
254 void showDaySignal( QDate ); 255 void showDaySignal( QDate );
255 protected: 256 protected:
256 void resizeEvent(QResizeEvent *); 257 void resizeEvent(QResizeEvent *);
257 void viewChanged(); 258 void viewChanged();
258 void updateDayLabels(); 259 void updateDayLabels();
259 260
260 private: 261 private:
262 NavigatorBar* mNavigatorBar;
261 int currentWeek(); 263 int currentWeek();
262 bool clPending; 264 bool clPending;
263 QWidgetStack * mWidStack; 265 QWidgetStack * mWidStack;
264 QWidget* mMonthView; 266 QWidget* mMonthView;
265 QWidget* mWeekView; 267 QWidget* mWeekView;
266 bool mShowWeekView; 268 bool mShowWeekView;
267 bool updatePossible; 269 bool updatePossible;
268 int mDaysPerWeek; 270 int mDaysPerWeek;
269 int mNumWeeks; 271 int mNumWeeks;
270 int mNumCells; 272 int mNumCells;
271 bool mWeekStartsMonday; 273 bool mWeekStartsMonday;
272 bool mShowSatSunComp; 274 bool mShowSatSunComp;
273 void computeLayout(); 275 void computeLayout();
274 void computeLayoutWeek(); 276 void computeLayoutWeek();
275 277
276 QPtrVector<MonthViewCell> mCells; 278 QPtrVector<MonthViewCell> mCells;
277 QPtrVector<QLabel> mDayLabels; 279 QPtrVector<QLabel> mDayLabels;
278 QPtrVector<KOWeekButton> mWeekLabels; 280 QPtrVector<KOWeekButton> mWeekLabels;
279 QPtrVector<MonthViewCell> mCellsW; 281 QPtrVector<MonthViewCell> mCellsW;
280 QPtrVector<QLabel> mDayLabelsW; 282 QPtrVector<QLabel> mDayLabelsW;
281 QPtrVector<KOWeekButton> mWeekLabelsW; 283 QPtrVector<KOWeekButton> mWeekLabelsW;
282 284
283 bool mShortDayLabels; 285 bool mShortDayLabels;
284 int mWidthLongDayLabel; 286 int mWidthLongDayLabel;
285 287
286 QDate mStartDate; 288 QDate mStartDate;
287 289
288 MonthViewCell *mSelectedCell; 290 MonthViewCell *mSelectedCell;
289 291
290 KOEventPopupMenu *mContextMenu; 292 KOEventPopupMenu *mContextMenu;
291 void keyPressEvent ( QKeyEvent * ) ; 293 void keyPressEvent ( QKeyEvent * ) ;
292 294
293}; 295};
294 296
295#endif 297#endif