summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.h
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/komonthview.h
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.zip
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.gz
kdepimpi-a08aff328d4393031d5ba7d622c2b05705a89d73.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/komonthview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.h57
1 files changed, 32 insertions, 25 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 1a9d16d..bca76e5 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -18,23 +18,30 @@
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 <q3frame.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qlistbox.h> 26#include <q3listbox.h>
27#include <qpoint.h> 27#include <qpoint.h>
28#include <qwidgetstack.h> 28#include <q3widgetstack.h>
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qtimer.h> 30#include <qtimer.h>
31#include <qintdict.h> 31#include <q3intdict.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qvaluelist.h> 33#include <q3valuelist.h>
34#include <qptrvector.h> 34#include <q3ptrvector.h>
35//Added by qt3to4:
36#include <QResizeEvent>
37#include <QFocusEvent>
38#include <QMouseEvent>
39#include <Q3PtrList>
40#include <Q3PopupMenu>
41#include <QKeyEvent>
35 42
36#include <libkcal/calendar.h> 43#include <libkcal/calendar.h>
37#include <libkcal/event.h> 44#include <libkcal/event.h>
38 45
39#include "koeventview.h" 46#include "koeventview.h"
40#include "navigatorbar.h" 47#include "navigatorbar.h"
@@ -69,13 +76,13 @@ private:
69 } 76 }
70 77
71private slots : 78private slots :
72 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 79 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
73}; 80};
74 81
75class KNoScrollListBox: public QListBox 82class KNoScrollListBox: public Q3ListBox
76{ 83{
77 Q_OBJECT 84 Q_OBJECT
78 public: 85 public:
79 KNoScrollListBox(QWidget *parent=0, const char *name=0); 86 KNoScrollListBox(QWidget *parent=0, const char *name=0);
80 ~KNoScrollListBox(); 87 ~KNoScrollListBox();
81 QString getWhatsThisText(QPoint p) ; 88 QString getWhatsThisText(QPoint p) ;
@@ -100,13 +107,13 @@ class KNoScrollListBox: public QListBox
100 private: 107 private:
101 bool resetOnFocusIn; 108 bool resetOnFocusIn;
102 KNOWhatsThis * mWT; 109 KNOWhatsThis * mWT;
103}; 110};
104 111
105 112
106class MonthViewItem: public QListBoxItem 113class MonthViewItem: public Q3ListBoxItem
107{ 114{
108 public: 115 public:
109 MonthViewItem( Incidence *,const QString & title ); 116 MonthViewItem( Incidence *,const QString & title );
110 void recycle( Incidence *incidence, const QString & s); 117 void recycle( Incidence *incidence, const QString & s);
111 void setRecur(bool on) { mRecur = on; } 118 void setRecur(bool on) { mRecur = on; }
112 void setAlarm(bool on) { mAlarm = on; } 119 void setAlarm(bool on) { mAlarm = on; }
@@ -123,14 +130,14 @@ class MonthViewItem: public QListBoxItem
123 QPalette palette() const { return mPalette; } 130 QPalette palette() const { return mPalette; }
124 bool setHighlightedFalse(); 131 bool setHighlightedFalse();
125 Incidence *incidence() const { return mIncidence; } 132 Incidence *incidence() const { return mIncidence; }
126 133
127 protected: 134 protected:
128 virtual void paint(QPainter *); 135 virtual void paint(QPainter *);
129 virtual int height(const QListBox *) const; 136 virtual int height(const Q3ListBox *) const;
130 virtual int width(const QListBox *) const; 137 virtual int width(const Q3ListBox *) const;
131 138
132 private: 139 private:
133 int mdayPos; 140 int mdayPos;
134 bool isWeekItem; 141 bool isWeekItem;
135 bool mblockRepaint; 142 bool mblockRepaint;
136 int mMultiday; 143 int mMultiday;
@@ -195,21 +202,21 @@ class MonthViewCell : public KNoScrollListBox
195 202
196public slots: 203public slots:
197 void showDay(); 204 void showDay();
198 void deHighLight(); 205 void deHighLight();
199 void repaintfinishUpdateCell(); 206 void repaintfinishUpdateCell();
200 protected slots: 207 protected slots:
201 void defaultAction( QListBoxItem * ); 208 void defaultAction( Q3ListBoxItem * );
202 void contextMenu( QListBoxItem * ); 209 void contextMenu( Q3ListBoxItem * );
203 void selection( QListBoxItem * ); 210 void selection( Q3ListBoxItem * );
204 void cellClicked( QListBoxItem * ); 211 void cellClicked( Q3ListBoxItem * );
205 void newEvent(); 212 void newEvent();
206 213
207 private: 214 private:
208 int mdayCount; 215 int mdayCount;
209 QPtrList <MonthViewItem> mAvailItemList; 216 Q3PtrList <MonthViewItem> mAvailItemList;
210 KOMonthView *mMonthView; 217 KOMonthView *mMonthView;
211 int currentPalette; 218 int currentPalette;
212 219
213 QDate mDate; 220 QDate mDate;
214 bool mPrimary; 221 bool mPrimary;
215 bool mHoliday; 222 bool mHoliday;
@@ -244,13 +251,13 @@ class KOMonthView: public KOEventView
244 virtual int maxDatesHint(); 251 virtual int maxDatesHint();
245 252
246 /** Returns number of currently shown dates. */ 253 /** Returns number of currently shown dates. */
247 virtual int currentDateCount(); 254 virtual int currentDateCount();
248 255
249 /** returns the currently selected events */ 256 /** returns the currently selected events */
250 virtual QPtrList<Incidence> selectedIncidences(); 257 virtual Q3PtrList<Incidence> selectedIncidences();
251 258
252 /** returns dates of the currently selected events */ 259 /** returns dates of the currently selected events */
253 virtual DateList selectedDates(); 260 virtual DateList selectedDates();
254#if 0 261#if 0
255 virtual void printPreview(CalPrinter *calPrinter, 262 virtual void printPreview(CalPrinter *calPrinter,
256 const QDate &, const QDate &); 263 const QDate &, const QDate &);
@@ -266,13 +273,13 @@ class KOMonthView: public KOEventView
266 void incidenceHighlighted( Incidence *, MonthViewCell*, int ); 273 void incidenceHighlighted( Incidence *, MonthViewCell*, int );
267 void nextCell(); 274 void nextCell();
268 void prevCell(); 275 void prevCell();
269 virtual void updateView(); 276 virtual void updateView();
270 virtual void updateConfig(); 277 virtual void updateConfig();
271 virtual void showDates(const QDate &start, const QDate &end); 278 virtual void showDates(const QDate &start, const QDate &end);
272 virtual void showEvents(QPtrList<Event> eventList); 279 virtual void showEvents(Q3PtrList<Event> eventList);
273 280
274 void changeEventDisplay(Event *, int); 281 void changeEventDisplay(Event *, int);
275 282
276 void clearSelection(); 283 void clearSelection();
277 284
278 void showContextMenu( Incidence * ); 285 void showContextMenu( Incidence * );
@@ -308,13 +315,13 @@ class KOMonthView: public KOEventView
308 private: 315 private:
309 int mKBFcounter; 316 int mKBFcounter;
310 QTimer* mComputeLayoutTimer; 317 QTimer* mComputeLayoutTimer;
311 NavigatorBar* mNavigatorBar; 318 NavigatorBar* mNavigatorBar;
312 int currentWeek(); 319 int currentWeek();
313 bool clPending; 320 bool clPending;
314 QWidgetStack * mWidStack; 321 Q3WidgetStack * mWidStack;
315 QWidget* mMonthView; 322 QWidget* mMonthView;
316 QWidget* mWeekView; 323 QWidget* mWeekView;
317 bool mShowWeekView; 324 bool mShowWeekView;
318 bool updatePossible; 325 bool updatePossible;
319 int mDaysPerWeek; 326 int mDaysPerWeek;
320 int mNumWeeks; 327 int mNumWeeks;
@@ -322,30 +329,30 @@ class KOMonthView: public KOEventView
322 //bool mWeekStartsMonday; 329 //bool mWeekStartsMonday;
323 bool mShowSatSunComp; 330 bool mShowSatSunComp;
324 void computeLayout(); 331 void computeLayout();
325 void computeLayoutWeek(); 332 void computeLayoutWeek();
326 void doComputeLayoutWeek(); 333 void doComputeLayoutWeek();
327 334
328 QPtrVector<MonthViewCell> mCells; 335 Q3PtrVector<MonthViewCell> mCells;
329 QPtrVector<QLabel> mDayLabels; 336 Q3PtrVector<QLabel> mDayLabels;
330 QPtrVector<KOWeekButton> mWeekLabels; 337 Q3PtrVector<KOWeekButton> mWeekLabels;
331 QPtrVector<MonthViewCell> mCellsW; 338 Q3PtrVector<MonthViewCell> mCellsW;
332 QPtrVector<QLabel> mDayLabelsW; 339 Q3PtrVector<QLabel> mDayLabelsW;
333 QPtrVector<KOWeekButton> mWeekLabelsW; 340 Q3PtrVector<KOWeekButton> mWeekLabelsW;
334 341
335 bool mShortDayLabelsM; 342 bool mShortDayLabelsM;
336 bool mShortDayLabelsW; 343 bool mShortDayLabelsW;
337 int mWidthLongDayLabel; 344 int mWidthLongDayLabel;
338 345
339 QDate mStartDate; 346 QDate mStartDate;
340 347
341 MonthViewCell *mSelectedCell; 348 MonthViewCell *mSelectedCell;
342 MonthViewCell *mPopupCell; 349 MonthViewCell *mPopupCell;
343 bool mFlagKeyPressed; 350 bool mFlagKeyPressed;
344 KOEventPopupMenu *mContextMenu; 351 KOEventPopupMenu *mContextMenu;
345 QPopupMenu *mNewItemMenu; 352 Q3PopupMenu *mNewItemMenu;
346 void keyPressEvent ( QKeyEvent * ) ; 353 void keyPressEvent ( QKeyEvent * ) ;
347 void keyReleaseEvent ( QKeyEvent * ) ; 354 void keyReleaseEvent ( QKeyEvent * ) ;
348 355
349}; 356};
350 357
351#endif 358#endif