summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.h
Unidiff
Diffstat (limited to 'korganizer/komonthview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index e39eeb0..c6b6b5e 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -38,96 +38,98 @@
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 KOWeekButton : public QPushButton 47class KOWeekButton : public QPushButton
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 51 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
52 QPushButton( parent, name) 52 QPushButton( parent, name)
53 { 53 {
54 connect( this, SIGNAL( clicked() ), 54 connect( this, SIGNAL( clicked() ),
55 SLOT( bottonClicked() )); 55 SLOT( bottonClicked() ));
56 mNumber = -1; 56 mNumber = -1;
57 } 57 }
58 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 58 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
59 int getWeekNum() { return mNumber;} 59 int getWeekNum() { return mNumber;}
60 signals: 60 signals:
61 void selectWeekNum ( int ); 61 void selectWeekNum ( int );
62private: 62private:
63 void focusInEvent ( QFocusEvent * ){;} 63 void focusInEvent ( QFocusEvent * ){;}
64 int mNumber; 64 int mNumber;
65 void keyPressEvent ( QKeyEvent * e ) 65 void keyPressEvent ( QKeyEvent * e )
66 { 66 {
67 e->ignore(); 67 e->ignore();
68 } 68 }
69 69
70private slots : 70private slots :
71 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 71 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
72}; 72};
73 73
74class KNoScrollListBox: public QListBox 74class KNoScrollListBox: public QListBox
75{ 75{
76 Q_OBJECT 76 Q_OBJECT
77 public: 77 public:
78 KNoScrollListBox(QWidget *parent=0, const char *name=0); 78 KNoScrollListBox(QWidget *parent=0, const char *name=0);
79 ~KNoScrollListBox(); 79 ~KNoScrollListBox();
80 QString getWhatsThisText(QPoint p) ; 80 QString getWhatsThisText(QPoint p) ;
81 81
82 signals: 82 signals:
83 void shiftDown(); 83 void shiftDown();
84 void shiftUp(); 84 void shiftUp();
85 void rightClick(); 85 void rightClick();
86 void nextCell();
87 void prevCell();
86 88
87 protected slots: 89 protected slots:
88 void oneDown(); 90 void oneDown();
89 void keyPressEvent(QKeyEvent *); 91 void keyPressEvent(QKeyEvent *);
90 void keyReleaseEvent(QKeyEvent *); 92 void keyReleaseEvent(QKeyEvent *);
91 void mousePressEvent(QMouseEvent *); 93 void mousePressEvent(QMouseEvent *);
92 void focusInEvent ( QFocusEvent * ); 94 void focusInEvent ( QFocusEvent * );
93 void focusOutEvent ( QFocusEvent * ); 95 void focusOutEvent ( QFocusEvent * );
94 96
95 private: 97 private:
96 bool resetOnFocusIn; 98 bool resetOnFocusIn;
97 KNOWhatsThis * mWT; 99 KNOWhatsThis * mWT;
98}; 100};
99 101
100 102
101class MonthViewItem: public QListBoxItem 103class MonthViewItem: public QListBoxItem
102{ 104{
103 public: 105 public:
104 MonthViewItem( Incidence *, QDate qd, const QString & title ); 106 MonthViewItem( Incidence *, QDate qd, const QString & title );
105 void recycle( Incidence *incidence, QDate qd, const QString & s); 107 void recycle( Incidence *incidence, QDate qd, const QString & s);
106 void setRecur(bool on) { mRecur = on; } 108 void setRecur(bool on) { mRecur = on; }
107 void setAlarm(bool on) { mAlarm = on; } 109 void setAlarm(bool on) { mAlarm = on; }
108 void setReply(bool on) { mReply = on; } 110 void setReply(bool on) { mReply = on; }
109 void setMoreInfo(bool on) { mInfo = on; } 111 void setMoreInfo(bool on) { mInfo = on; }
110 void setMultiDay(int type) { mMultiday = type; } 112 void setMultiDay(int type) { mMultiday = type; }
111 void setMultiDayPos(int type) { mdayPos = type; } 113 void setMultiDayPos(int type) { mdayPos = type; }
112 int gettMultiDayPos() { return mdayPos; } 114 int gettMultiDayPos() { return mdayPos; }
113 void setBlockRepaint(bool on) { mblockRepaint = on; } 115 void setBlockRepaint(bool on) { mblockRepaint = on; }
114 116
115 117
116 void setPalette(const QPalette &p) { mPalette = p; } 118 void setPalette(const QPalette &p) { mPalette = p; }
117 QPalette palette() const { return mPalette; } 119 QPalette palette() const { return mPalette; }
118 120
119 Incidence *incidence() const { return mIncidence; } 121 Incidence *incidence() const { return mIncidence; }
120 QDate incidenceDate() { return mDate; } 122 QDate incidenceDate() { return mDate; }
121 123
122 protected: 124 protected:
123 virtual void paint(QPainter *); 125 virtual void paint(QPainter *);
124 virtual int height(const QListBox *) const; 126 virtual int height(const QListBox *) const;
125 virtual int width(const QListBox *) const; 127 virtual int width(const QListBox *) const;
126 128
127 private: 129 private:
128 int mdayPos; 130 int mdayPos;
129 bool isWeekItem; 131 bool isWeekItem;
130 bool mblockRepaint; 132 bool mblockRepaint;
131 int mMultiday; 133 int mMultiday;
132 bool mRecur; 134 bool mRecur;
133 bool mAlarm; 135 bool mAlarm;
@@ -143,164 +145,165 @@ class MonthViewItem: public QListBoxItem
143 145
144class KOMonthView; 146class KOMonthView;
145 147
146class MonthViewCell : public KNoScrollListBox 148class MonthViewCell : public KNoScrollListBox
147{ 149{
148 Q_OBJECT 150 Q_OBJECT
149 public: 151 public:
150 MonthViewCell(KOMonthView *,QWidget* ); 152 MonthViewCell(KOMonthView *,QWidget* );
151 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );} 153 ~MonthViewCell() {mAvailItemList.setAutoDelete( true );}
152 154
153 void setDate( const QDate & ); 155 void setDate( const QDate & );
154 QDate date() const; 156 QDate date() const;
155 157
156 void setPrimary( bool ); 158 void setPrimary( bool );
157 bool isPrimary() const; 159 bool isPrimary() const;
158 160
159 void setHoliday( bool ); 161 void setHoliday( bool );
160 void setHoliday( const QString & ); 162 void setHoliday( const QString & );
161 163
162 void updateCell(); 164 void updateCell();
163 void startUpdateCell(); 165 void startUpdateCell();
164 void finishUpdateCell(); 166 void finishUpdateCell();
165 void repaintfinishUpdateCell(); 167 void repaintfinishUpdateCell();
166 int insertEvent(Event *); 168 int insertEvent(Event *);
167 void insertTodo(Todo *); 169 void insertTodo(Todo *);
168 170
169 void updateConfig( bool bigFont = false ); 171 void updateConfig( bool bigFont = false );
170 172
171 void enableScrollBars( bool ); 173 void enableScrollBars( bool );
172 174
173 Incidence *selectedIncidence(); 175 Incidence *selectedIncidence();
174 QDate selectedIncidenceDate(); 176 QDate selectedIncidenceDate();
175 QPushButton * dateLabel() { return mLabel; } 177 QPushButton * dateLabel() { return mLabel; }
176 178
177 void deselect(); 179 void deselect();
178 void select(); 180 void select();
179#ifdef DESKTOP_VERSION 181#ifdef DESKTOP_VERSION
180 static QToolTipGroup *toolTipGroup(); 182 static QToolTipGroup *toolTipGroup();
181#endif 183#endif
182 signals: 184 signals:
183 void defaultAction( Incidence * ); 185 void defaultAction( Incidence * );
184 void newEventSignal( QDateTime ); 186 void newEventSignal( QDateTime );
185 void showDaySignal( QDate ); 187 void showDaySignal( QDate );
186 188
187 protected: 189 protected:
188 QStringList mToolTip; 190 QStringList mToolTip;
189 void resizeEvent( QResizeEvent * ); 191 void resizeEvent( QResizeEvent * );
190 192
191
192public slots: 193public slots:
193 void showDay(); 194 void showDay();
194 195
195 protected slots: 196 protected slots:
196 void defaultAction( QListBoxItem * ); 197 void defaultAction( QListBoxItem * );
197 void contextMenu( QListBoxItem * ); 198 void contextMenu( QListBoxItem * );
198 void selection( QListBoxItem * ); 199 void selection( QListBoxItem * );
199 void cellClicked( QListBoxItem * ); 200 void cellClicked( QListBoxItem * );
200 void newEvent(); 201 void newEvent();
201 202
202 private: 203 private:
203 int mdayCount; 204 int mdayCount;
204 QPtrList <MonthViewItem> mAvailItemList; 205 QPtrList <MonthViewItem> mAvailItemList;
205 KOMonthView *mMonthView; 206 KOMonthView *mMonthView;
206 int currentPalette; 207 int currentPalette;
207 208
208 QDate mDate; 209 QDate mDate;
209 bool mPrimary; 210 bool mPrimary;
210 bool mHoliday; 211 bool mHoliday;
211 QString mHolidayString; 212 QString mHolidayString;
212 213
213 //QLabel *mLabel; 214 //QLabel *mLabel;
214 QPushButton *mLabel; 215 QPushButton *mLabel;
215 //QListBox *mItemList; 216 //QListBox *mItemList;
216#ifdef DESKTOP_VERSION 217#ifdef DESKTOP_VERSION
217 static QToolTipGroup *mToolTipGroup; 218 static QToolTipGroup *mToolTipGroup;
218#endif 219#endif
219 QSize mLabelSize; 220 QSize mLabelSize;
220 QSize mLabelBigSize; 221 QSize mLabelBigSize;
221 QPalette mHolidayPalette; 222 QPalette mHolidayPalette;
222 QPalette mStandardPalette; 223 QPalette mStandardPalette;
223 QPalette mPrimaryPalette; 224 QPalette mPrimaryPalette;
224 QPalette mNonPrimaryPalette; 225 QPalette mNonPrimaryPalette;
225 void setMyPalette(); 226 void setMyPalette();
226 QPalette getPalette (); 227 QPalette getPalette ();
227 228
228}; 229};
229 230
230 231
231class KOMonthView: public KOEventView 232class KOMonthView: public KOEventView
232{ 233{
233 Q_OBJECT 234 Q_OBJECT
234 public: 235 public:
235 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 236 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
236 ~KOMonthView(); 237 ~KOMonthView();
237 238
238 /** Returns maximum number of days supported by the komonthview */ 239 /** Returns maximum number of days supported by the komonthview */
239 virtual int maxDatesHint(); 240 virtual int maxDatesHint();
240 241
241 /** Returns number of currently shown dates. */ 242 /** Returns number of currently shown dates. */
242 virtual int currentDateCount(); 243 virtual int currentDateCount();
243 244
244 /** returns the currently selected events */ 245 /** returns the currently selected events */
245 virtual QPtrList<Incidence> selectedIncidences(); 246 virtual QPtrList<Incidence> selectedIncidences();
246 247
247 /** returns dates of the currently selected events */ 248 /** returns dates of the currently selected events */
248 virtual DateList selectedDates(); 249 virtual DateList selectedDates();
249 250
250 virtual void printPreview(CalPrinter *calPrinter, 251 virtual void printPreview(CalPrinter *calPrinter,
251 const QDate &, const QDate &); 252 const QDate &, const QDate &);
252 bool isMonthView() { return !mShowWeekView; } 253 bool isMonthView() { return !mShowWeekView; }
253 bool isUpdatePossible() { return updatePossible; } 254 bool isUpdatePossible() { return updatePossible; }
254 255
255 MonthViewCell * selectedCell(); 256 MonthViewCell * selectedCell();
256 bool skipResize; 257 bool skipResize;
257 NavigatorBar* navigatorBar() { return mNavigatorBar ;} 258 NavigatorBar* navigatorBar() { return mNavigatorBar ;}
258 public slots: 259 public slots:
260 void nextCell();
261 void prevCell();
259 virtual void updateView(); 262 virtual void updateView();
260 virtual void updateConfig(); 263 virtual void updateConfig();
261 virtual void showDates(const QDate &start, const QDate &end); 264 virtual void showDates(const QDate &start, const QDate &end);
262 virtual void showEvents(QPtrList<Event> eventList); 265 virtual void showEvents(QPtrList<Event> eventList);
263 266
264 void changeEventDisplay(Event *, int); 267 void changeEventDisplay(Event *, int);
265 268
266 void clearSelection(); 269 void clearSelection();
267 270
268 void showContextMenu( Incidence * ); 271 void showContextMenu( Incidence * );
269 272
270 void setSelectedCell( MonthViewCell * ); 273 void setSelectedCell( MonthViewCell * );
271 void switchView(); 274 void switchView();
272 void setKeyBoardFocus(); 275 void setKeyBoardFocus();
273 void setKeyBFocus(); 276 void setKeyBFocus();
274 277
275 protected slots: 278 protected slots:
276 void slotComputeLayout(); 279 void slotComputeLayout();
277 void selectInternalWeekNum ( int ); 280 void selectInternalWeekNum ( int );
278 void processSelectionChange(); 281 void processSelectionChange();
279 signals: 282 signals:
280 void nextMonth(); 283 void nextMonth();
281 void prevMonth(); 284 void prevMonth();
282 void selectWeekNum ( int ); 285 void selectWeekNum ( int );
283 void selectMonth (); 286 void selectMonth ();
284 void showDaySignal( QDate ); 287 void showDaySignal( QDate );
285 protected: 288 protected:
286 void resizeEvent(QResizeEvent *); 289 void resizeEvent(QResizeEvent *);
287 void viewChanged(); 290 void viewChanged();
288 void updateDayLabels(); 291 void updateDayLabels();
289 292
290 private: 293 private:
291 QTimer* mComputeLayoutTimer; 294 QTimer* mComputeLayoutTimer;
292 NavigatorBar* mNavigatorBar; 295 NavigatorBar* mNavigatorBar;
293 int currentWeek(); 296 int currentWeek();
294 bool clPending; 297 bool clPending;
295 QWidgetStack * mWidStack; 298 QWidgetStack * mWidStack;
296 QWidget* mMonthView; 299 QWidget* mMonthView;
297 QWidget* mWeekView; 300 QWidget* mWeekView;
298 bool mShowWeekView; 301 bool mShowWeekView;
299 bool updatePossible; 302 bool updatePossible;
300 int mDaysPerWeek; 303 int mDaysPerWeek;
301 int mNumWeeks; 304 int mNumWeeks;
302 int mNumCells; 305 int mNumCells;
303 //bool mWeekStartsMonday; 306 //bool mWeekStartsMonday;
304 bool mShowSatSunComp; 307 bool mShowSatSunComp;
305 void computeLayout(); 308 void computeLayout();
306 void computeLayoutWeek(); 309 void computeLayoutWeek();