summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.h
Unidiff
Diffstat (limited to 'korganizer/koagenda.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.h43
1 files changed, 26 insertions, 17 deletions
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index 380ce62..0708341 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -14,75 +14,84 @@
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 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 KOAGENDA_H 23#ifndef KOAGENDA_H
24#define KOAGENDA_H 24#define KOAGENDA_H
25 25
26#include <qscrollview.h> 26#include <q3scrollview.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qmemarray.h> 28#include <q3memarray.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qpixmap.h> 30#include <qpixmap.h>
31#include <qguardedptr.h> 31#include <qpointer.h>
32//Added by qt3to4:
33#include <QResizeEvent>
34#include <Q3Frame>
35#include <QLabel>
36#include <QMouseEvent>
37#include <Q3PtrList>
38#include <Q3PopupMenu>
39#include <QKeyEvent>
40#include <QEvent>
32 41
33#include "koagendaitem.h" 42#include "koagendaitem.h"
34#include "koeventview.h" 43#include "koeventview.h"
35 44
36class QPopupMenu; 45class Q3PopupMenu;
37class QTime; 46class QTime;
38class KConfig; 47class KConfig;
39class QFrame; 48class Q3Frame;
40class KOAgenda; 49class KOAgenda;
41class KCal::Event; 50class KCal::Event;
42class KCal::Todo; 51class KCal::Todo;
43 52
44using namespace KCal; 53using namespace KCal;
45 54
46class MarcusBains : public QFrame { 55class MarcusBains : public Q3Frame {
47 Q_OBJECT 56 Q_OBJECT
48 public: 57 public:
49 MarcusBains(KOAgenda *agenda=0,const char *name=0); 58 MarcusBains(KOAgenda *agenda=0,const char *name=0);
50 virtual ~MarcusBains(); 59 virtual ~MarcusBains();
51 void hideMe(); 60 void hideMe();
52 public slots: 61 public slots:
53 void updateLocation(bool recalculate=false); 62 void updateLocation(bool recalculate=false);
54 void updateLoc(); 63 void updateLoc();
55 64
56 private: 65 private:
57 int todayColumn(); 66 int todayColumn();
58 QTimer *minutes; 67 QTimer *minutes;
59 QLabel *mTimeBox; 68 QLabel *mTimeBox;
60 KOAgenda *agenda; 69 KOAgenda *agenda;
61 QTime oldTime; 70 QTime oldTime;
62 int oldToday; 71 int oldToday;
63}; 72};
64 73
65 74
66class KOAgenda : public QScrollView 75class KOAgenda : public Q3ScrollView
67{ 76{
68 Q_OBJECT 77 Q_OBJECT
69 public: 78 public:
70 enum MouseActionType { NOP, MOVE, SELECT, 79 enum MouseActionType { NOP, MOVE, SELECT,
71 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; 80 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT };
72 81
73 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, 82 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0,
74 const char * name=0, WFlags f=0 ); 83 const char * name=0, Qt::WFlags f=0 );
75 KOAgenda ( int columns, QWidget * parent=0, 84 KOAgenda ( int columns, QWidget * parent=0,
76 const char * name=0, WFlags f=0 ); 85 const char * name=0, Qt::WFlags f=0 );
77 virtual ~KOAgenda(); 86 virtual ~KOAgenda();
78 bool mInvalidPixmap; 87 bool mInvalidPixmap;
79 88
80 Incidence *selectedIncidence() const; 89 Incidence *selectedIncidence() const;
81 QDate selectedIncidenceDate() const; 90 QDate selectedIncidenceDate() const;
82 91
83 virtual bool eventFilter ( QObject *, QEvent * ); 92 virtual bool eventFilter ( QObject *, QEvent * );
84 93
85 void contentsToGrid (int x, int y, int& gx, int& gy); 94 void contentsToGrid (int x, int y, int& gx, int& gy);
86 void gridToContents (int gx, int gy, int& x, int& y); 95 void gridToContents (int gx, int gy, int& x, int& y);
87 96
88 int timeToY (const QTime &time); 97 int timeToY (const QTime &time);
@@ -108,25 +117,25 @@ class KOAgenda : public QScrollView
108 void clear(); 117 void clear();
109 118
110 void clearSelection(); 119 void clearSelection();
111 void hideUnused(); 120 void hideUnused();
112 121
113 /** Calculates the minimum width */ 122 /** Calculates the minimum width */
114 virtual int minimumWidth() const; 123 virtual int minimumWidth() const;
115 /** Update configuration from preference settings */ 124 /** Update configuration from preference settings */
116 void updateConfig(); 125 void updateConfig();
117 126
118 void checkScrollBoundaries(); 127 void checkScrollBoundaries();
119 128
120 void setHolidayMask(QMemArray<bool> *); 129 void setHolidayMask(Q3MemArray<bool> *);
121 void setDateList(const DateList &selectedDates); 130 void setDateList(const DateList &selectedDates);
122 DateList dateList() const; 131 DateList dateList() const;
123 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); 132 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
124 void finishUpdate(); 133 void finishUpdate();
125 void printSelection(); 134 void printSelection();
126 void storePosition(); 135 void storePosition();
127 void restorePosition(); 136 void restorePosition();
128 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } 137 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
129 void shrinkPixmap(); 138 void shrinkPixmap();
130 QTime getEndTime(); 139 QTime getEndTime();
131 bool invalidPixmap(); 140 bool invalidPixmap();
132 141
@@ -268,41 +277,41 @@ class KOAgenda : public QScrollView
268 // Selection 277 // Selection
269 int mSelectionCellX; 278 int mSelectionCellX;
270 int mSelectionYTop; 279 int mSelectionYTop;
271 int mSelectionHeight; 280 int mSelectionHeight;
272 281
273 // List of dates to be displayed 282 // List of dates to be displayed
274 DateList mSelectedDates; 283 DateList mSelectedDates;
275 284
276 // The KOAgendaItem, which has been right-clicked last 285 // The KOAgendaItem, which has been right-clicked last
277 KOAgendaItem *mClickedItem; 286 KOAgendaItem *mClickedItem;
278 287
279 // The KOAgendaItem, which is being moved/resized 288 // The KOAgendaItem, which is being moved/resized
280 QGuardedPtr<KOAgendaItem> mActionItem; 289 QPointer<KOAgendaItem> mActionItem;
281 290
282 // Currently selected item 291 // Currently selected item
283 QGuardedPtr<KOAgendaItem> mSelectedItem; 292 QPointer<KOAgendaItem> mSelectedItem;
284 293
285 // The Marcus Bains Line widget. 294 // The Marcus Bains Line widget.
286 MarcusBains *mMarcusBains; 295 MarcusBains *mMarcusBains;
287 void computeSizes(); 296 void computeSizes();
288 297
289 MouseActionType mActionType; 298 MouseActionType mActionType;
290 299
291 bool mItemMoved; 300 bool mItemMoved;
292 301
293 // List of all Items contained in agenda 302 // List of all Items contained in agenda
294 QPtrList<KOAgendaItem> mItems; 303 Q3PtrList<KOAgendaItem> mItems;
295 QPtrList<KOAgendaItem> mUnusedItems; 304 Q3PtrList<KOAgendaItem> mUnusedItems;
296 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport); 305 KOAgendaItem* getNewItem(Incidence * event,QDate qd, QWidget* viewport);
297 QPopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems 306 Q3PopupMenu *mItemPopup; // Right mouse button popup menu for KOAgendaItems
298 QPopupMenu *mNewItemPopup; 307 Q3PopupMenu *mNewItemPopup;
299 308
300 int mOldLowerScrollValue; 309 int mOldLowerScrollValue;
301 int mOldUpperScrollValue; 310 int mOldUpperScrollValue;
302 KOAgendaItem * getItemForTodo ( Todo * todo ); 311 KOAgendaItem * getItemForTodo ( Todo * todo );
303 QMemArray<bool> *mHolidayMask; 312 Q3MemArray<bool> *mHolidayMask;
304 int mCurPixWid; 313 int mCurPixWid;
305 int mCurPixHei; 314 int mCurPixHei;
306}; 315};
307 316
308#endif // KOAGENDA_H 317#endif // KOAGENDA_H