summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.h
Unidiff
Diffstat (limited to 'korganizer/komonthview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 65b5e77..159af16 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -23,197 +23,201 @@
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 <qtimer.h> 30#include <qtimer.h>
31#include <qintdict.h> 31#include <qintdict.h>
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33#include <qvaluelist.h> 33#include <qvaluelist.h>
34#include <qptrvector.h> 34#include <qptrvector.h>
35 35
36#include <libkcal/calendar.h> 36#include <libkcal/calendar.h>
37#include <libkcal/event.h> 37#include <libkcal/event.h>
38 38
39#include "koeventview.h" 39#include "koeventview.h"
40#include "navigatorbar.h" 40#include "navigatorbar.h"
41 41
42#ifdef DESKTOP_VERSION 42#ifdef DESKTOP_VERSION
43class QToolTipGroup; 43class QToolTipGroup;
44#endif 44#endif
45 45
46class KNOWhatsThis; 46class KNOWhatsThis;
47class MonthViewCell;
47class KOWeekButton : public QPushButton 48class KOWeekButton : public QPushButton
48{ 49{
49 Q_OBJECT 50 Q_OBJECT
50 public: 51 public:
51 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 52 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
52 QPushButton( parent, name) 53 QPushButton( parent, name)
53 { 54 {
54 connect( this, SIGNAL( clicked() ), 55 connect( this, SIGNAL( clicked() ),
55 SLOT( bottonClicked() )); 56 SLOT( bottonClicked() ));
56 mNumber = -1; 57 mNumber = -1;
57 } 58 }
58 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 59 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
59 int getWeekNum() { return mNumber;} 60 int getWeekNum() { return mNumber;}
60 signals: 61 signals:
61 void selectWeekNum ( int ); 62 void selectWeekNum ( int );
62private: 63private:
63 void focusInEvent ( QFocusEvent * ){;} 64 void focusInEvent ( QFocusEvent * ){;}
64 int mNumber; 65 int mNumber;
65 void keyPressEvent ( QKeyEvent * e ) 66 void keyPressEvent ( QKeyEvent * e )
66 { 67 {
67 e->ignore(); 68 e->ignore();
68 } 69 }
69 70
70private slots : 71private slots :
71 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 72 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
72}; 73};
73 74
74class KNoScrollListBox: public QListBox 75class KNoScrollListBox: public QListBox
75{ 76{
76 Q_OBJECT 77 Q_OBJECT
77 public: 78 public:
78 KNoScrollListBox(QWidget *parent=0, const char *name=0); 79 KNoScrollListBox(QWidget *parent=0, const char *name=0);
79 ~KNoScrollListBox(); 80 ~KNoScrollListBox();
80 QString getWhatsThisText(QPoint p) ; 81 QString getWhatsThisText(QPoint p) ;
81 82
82 signals: 83 signals:
83 void shiftDown(); 84 void shiftDown();
84 void shiftUp(); 85 void shiftUp();
85 void rightClick(); 86 void rightClick();
86 void nextCell(); 87 void nextCell();
87 void prevCell(); 88 void prevCell();
89 void highligtIncidence( Incidence * , MonthViewCell*, int );
88 90
89 protected slots: 91 protected slots:
90 void oneDown(); 92 void oneDown();
91 void keyPressEvent(QKeyEvent *); 93 void keyPressEvent(QKeyEvent *);
92 void keyReleaseEvent(QKeyEvent *); 94 void keyReleaseEvent(QKeyEvent *);
93 void mousePressEvent(QMouseEvent *); 95 void mousePressEvent(QMouseEvent *);
94 void focusInEvent ( QFocusEvent * ); 96 void focusInEvent ( QFocusEvent * );
95 void focusOutEvent ( QFocusEvent * ); 97 void focusOutEvent ( QFocusEvent * );
96 98
97 private: 99 private:
98 bool resetOnFocusIn; 100 bool resetOnFocusIn;
99 KNOWhatsThis * mWT; 101 KNOWhatsThis * mWT;
100}; 102};
101 103
102 104
103class MonthViewItem: public QListBoxItem 105class MonthViewItem: public QListBoxItem
104{ 106{
105 public: 107 public:
106 MonthViewItem( Incidence *, QDate qd, const QString & title ); 108 MonthViewItem( Incidence *, QDate qd, const QString & title );
107 void recycle( Incidence *incidence, QDate qd, const QString & s); 109 void recycle( Incidence *incidence, QDate qd, const QString & s);
108 void setRecur(bool on) { mRecur = on; } 110 void setRecur(bool on) { mRecur = on; }
109 void setAlarm(bool on) { mAlarm = on; } 111 void setAlarm(bool on) { mAlarm = on; }
110 void setReply(bool on) { mReply = on; } 112 void setReply(bool on) { mReply = on; }
111 void setMoreInfo(bool on) { mInfo = on; } 113 void setMoreInfo(bool on) { mInfo = on; }
112 void setMultiDay(int type) { mMultiday = type; } 114 void setMultiDay(int type) { mMultiday = type; }
115 int multiDay() { return mMultiday; }
113 void setMultiDayPos(int type) { mdayPos = type; } 116 void setMultiDayPos(int type) { mdayPos = type; }
114 int gettMultiDayPos() { return mdayPos; } 117 int gettMultiDayPos() { return mdayPos; }
115 void setBlockRepaint(bool on) { mblockRepaint = on; } 118 void setBlockRepaint(bool on) { mblockRepaint = on; }
116 119 bool setHighlighted( Incidence * );
117 120
118 void setPalette(const QPalette &p) { mPalette = p; } 121 void setPalette(const QPalette &p) { mPalette = p; }
119 QPalette palette() const { return mPalette; } 122 QPalette palette() const { return mPalette; }
120 123 bool setHighlightedFalse();
121 Incidence *incidence() const { return mIncidence; } 124 Incidence *incidence() const { return mIncidence; }
122 QDate incidenceDate() { return mDate; } 125 QDate incidenceDate() { return mDate; }
123 126
124 protected: 127 protected:
125 virtual void paint(QPainter *); 128 virtual void paint(QPainter *);
126 virtual int height(const QListBox *) const; 129 virtual int height(const QListBox *) const;
127 virtual int width(const QListBox *) const; 130 virtual int width(const QListBox *) const;
128 131
129 private: 132 private:
130 int mdayPos; 133 int mdayPos;
131 bool isWeekItem; 134 bool isWeekItem;
132 bool mblockRepaint; 135 bool mblockRepaint;
133 int mMultiday; 136 int mMultiday;
134 bool mRecur; 137 bool mRecur;
135 bool mAlarm; 138 bool mAlarm;
136 bool mReply; 139 bool mReply;
137 bool mInfo; 140 bool mInfo;
141 bool mDisplayHightlighted;
138 142
139 QPalette mPalette; 143 QPalette mPalette;
140 QDate mDate; 144 QDate mDate;
141 145
142 Incidence *mIncidence; 146 Incidence *mIncidence;
143}; 147};
144 148
145 149
146class KOMonthView; 150class KOMonthView;
147 151
148class MonthViewCell : public KNoScrollListBox 152class MonthViewCell : public KNoScrollListBox
149{ 153{
150 Q_OBJECT 154 Q_OBJECT
151 public: 155 public:
152 MonthViewCell(KOMonthView *,QWidget* ); 156 MonthViewCell(KOMonthView *,QWidget* );
153 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );} 157 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );}
154 158
155 void setDate( const QDate & ); 159 void setDate( const QDate & );
156 QDate date() const; 160 QDate date() const;
157 161
158 void setPrimary( bool ); 162 void setPrimary( bool );
159 bool isPrimary() const; 163 bool isPrimary() const;
160 164
161 void setHoliday( bool ); 165 void setHoliday( bool );
162 void setHoliday( const QString & ); 166 void setHoliday( const QString & );
163 167
164 void updateCell(); 168 void updateCell();
165 void startUpdateCell(); 169 void startUpdateCell();
166 void finishUpdateCell(); 170 void finishUpdateCell();
167 void repaintfinishUpdateCell(); 171 void repaintfinishUpdateCell();
168 int insertEvent(Event *); 172 int insertEvent(Event *);
169 void insertTodo(Todo *); 173 void insertTodo(Todo *);
170 174
171 void updateConfig( bool bigFont = false ); 175 void updateConfig( bool bigFont = false );
172 176
173 void enableScrollBars( bool ); 177 void enableScrollBars( bool );
174 178
175 Incidence *selectedIncidence(); 179 Incidence *selectedIncidence();
176 QDate selectedIncidenceDate(); 180 QDate selectedIncidenceDate();
177 QPushButton * dateLabel() { return mLabel; } 181 QPushButton * dateLabel() { return mLabel; }
178 182 void deHightLight();
183 bool doHightLight( Incidence *);
179 void deselect(); 184 void deselect();
180 void select(); 185 void select();
181#ifdef DESKTOP_VERSION 186#ifdef DESKTOP_VERSION
182 static QToolTipGroup *toolTipGroup(); 187 static QToolTipGroup *toolTipGroup();
183#endif 188#endif
184 signals: 189 signals:
185 void defaultAction( Incidence * ); 190 void defaultAction( Incidence * );
186 void newEventSignal( QDateTime ); 191 void newEventSignal( QDateTime );
187 void showDaySignal( QDate ); 192 void showDaySignal( QDate );
188 193
189 protected: 194 protected:
190 QStringList mToolTip; 195 QStringList mToolTip;
191 void resizeEvent( QResizeEvent * ); 196 void resizeEvent( QResizeEvent * );
192 197
193public slots: 198public slots:
194 void showDay(); 199 void showDay();
195
196 protected slots: 200 protected slots:
197 void defaultAction( QListBoxItem * ); 201 void defaultAction( QListBoxItem * );
198 void contextMenu( QListBoxItem * ); 202 void contextMenu( QListBoxItem * );
199 void selection( QListBoxItem * ); 203 void selection( QListBoxItem * );
200 void cellClicked( QListBoxItem * ); 204 void cellClicked( QListBoxItem * );
201 void newEvent(); 205 void newEvent();
202 206
203 private: 207 private:
204 int mdayCount; 208 int mdayCount;
205 QPtrList <MonthViewItem> mAvailItemList; 209 QPtrList <MonthViewItem> mAvailItemList;
206 KOMonthView *mMonthView; 210 KOMonthView *mMonthView;
207 int currentPalette; 211 int currentPalette;
208 212
209 QDate mDate; 213 QDate mDate;
210 bool mPrimary; 214 bool mPrimary;
211 bool mHoliday; 215 bool mHoliday;
212 QString mHolidayString; 216 QString mHolidayString;
213 217
214 //QLabel *mLabel; 218 //QLabel *mLabel;
215 QPushButton *mLabel; 219 QPushButton *mLabel;
216 //QListBox *mItemList; 220 //QListBox *mItemList;
217#ifdef DESKTOP_VERSION 221#ifdef DESKTOP_VERSION
218 static QToolTipGroup *mToolTipGroup; 222 static QToolTipGroup *mToolTipGroup;
219#endif 223#endif
@@ -237,48 +241,49 @@ class KOMonthView: public KOEventView
237 ~KOMonthView(); 241 ~KOMonthView();
238 242
239 /** Returns maximum number of days supported by the komonthview */ 243 /** Returns maximum number of days supported by the komonthview */
240 virtual int maxDatesHint(); 244 virtual int maxDatesHint();
241 245
242 /** Returns number of currently shown dates. */ 246 /** Returns number of currently shown dates. */
243 virtual int currentDateCount(); 247 virtual int currentDateCount();
244 248
245 /** returns the currently selected events */ 249 /** returns the currently selected events */
246 virtual QPtrList<Incidence> selectedIncidences(); 250 virtual QPtrList<Incidence> selectedIncidences();
247 251
248 /** returns dates of the currently selected events */ 252 /** returns dates of the currently selected events */
249 virtual DateList selectedDates(); 253 virtual DateList selectedDates();
250 254
251 virtual void printPreview(CalPrinter *calPrinter, 255 virtual void printPreview(CalPrinter *calPrinter,
252 const QDate &, const QDate &); 256 const QDate &, const QDate &);
253 bool isMonthView() { return !mShowWeekView; } 257 bool isMonthView() { return !mShowWeekView; }
254 bool isUpdatePossible() { return updatePossible; } 258 bool isUpdatePossible() { return updatePossible; }
255 259
256 MonthViewCell * selectedCell(); 260 MonthViewCell * selectedCell();
257 bool skipResize; 261 bool skipResize;
258 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 262 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
259 void clearList(); 263 void clearList();
260 public slots: 264 public slots:
265 void incidenceHighlighted( Incidence *, MonthViewCell*, int );
261 void nextCell(); 266 void nextCell();
262 void prevCell(); 267 void prevCell();
263 virtual void updateView(); 268 virtual void updateView();
264 virtual void updateConfig(); 269 virtual void updateConfig();
265 virtual void showDates(const QDate &start, const QDate &end); 270 virtual void showDates(const QDate &start, const QDate &end);
266 virtual void showEvents(QPtrList<Event> eventList); 271 virtual void showEvents(QPtrList<Event> eventList);
267 272
268 void changeEventDisplay(Event *, int); 273 void changeEventDisplay(Event *, int);
269 274
270 void clearSelection(); 275 void clearSelection();
271 276
272 void showContextMenu( Incidence * ); 277 void showContextMenu( Incidence * );
273 278
274 void setSelectedCell( MonthViewCell * ); 279 void setSelectedCell( MonthViewCell * );
275 void setPopupCell( MonthViewCell * ); 280 void setPopupCell( MonthViewCell * );
276 void switchView(); 281 void switchView();
277 void setKeyBoardFocus(); 282 void setKeyBoardFocus();
278 void setKeyBFocus(); 283 void setKeyBFocus();
279 284
280 protected slots: 285 protected slots:
281 void slotNewTodo(); 286 void slotNewTodo();
282 void slotNewEvent(); 287 void slotNewEvent();
283 void slotEditJournal(); 288 void slotEditJournal();
284 void slotComputeLayout(); 289 void slotComputeLayout();