summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.h
Unidiff
Diffstat (limited to 'korganizer/komonthview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 50903b3..b84065e 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -44,213 +44,218 @@ class KNOWhatsThis;
44class KOWeekButton : public QPushButton 44class KOWeekButton : public QPushButton
45{ 45{
46 Q_OBJECT 46 Q_OBJECT
47 public: 47 public:
48 KOWeekButton( QWidget *parent=0, const char *name=0 ) : 48 KOWeekButton( QWidget *parent=0, const char *name=0 ) :
49 QPushButton( parent, name) 49 QPushButton( parent, name)
50 { 50 {
51 connect( this, SIGNAL( clicked() ), 51 connect( this, SIGNAL( clicked() ),
52 SLOT( bottonClicked() )); 52 SLOT( bottonClicked() ));
53 mNumber = -1; 53 mNumber = -1;
54 } 54 }
55 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));} 55 void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
56 signals: 56 signals:
57 void selectWeekNum ( int ); 57 void selectWeekNum ( int );
58private: 58private:
59 int mNumber; 59 int mNumber;
60private slots : 60private slots :
61 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); } 61 void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
62}; 62};
63 63
64class KNoScrollListBox: public QListBox 64class KNoScrollListBox: public QListBox
65{ 65{
66 Q_OBJECT 66 Q_OBJECT
67 public: 67 public:
68 KNoScrollListBox(QWidget *parent=0, const char *name=0); 68 KNoScrollListBox(QWidget *parent=0, const char *name=0);
69 ~KNoScrollListBox(); 69 ~KNoScrollListBox();
70 QString getWhatsThisText(QPoint p) ; 70 QString getWhatsThisText(QPoint p) ;
71 71
72 signals: 72 signals:
73 void shiftDown(); 73 void shiftDown();
74 void shiftUp(); 74 void shiftUp();
75 void rightClick(); 75 void rightClick();
76 76
77 protected slots: 77 protected slots:
78 void keyPressEvent(QKeyEvent *); 78 void keyPressEvent(QKeyEvent *);
79 void keyReleaseEvent(QKeyEvent *); 79 void keyReleaseEvent(QKeyEvent *);
80 void mousePressEvent(QMouseEvent *); 80 void mousePressEvent(QMouseEvent *);
81 81
82 private: 82 private:
83 KNOWhatsThis * mWT; 83 KNOWhatsThis * mWT;
84}; 84};
85 85
86 86
87class MonthViewItem: public QListBoxItem 87class MonthViewItem: public QListBoxItem
88{ 88{
89 public: 89 public:
90 MonthViewItem( Incidence *, QDate qd, const QString & title ); 90 MonthViewItem( Incidence *, QDate qd, const QString & title );
91 91
92 void setRecur(bool on) { mRecur = on; } 92 void setRecur(bool on) { mRecur = on; }
93 void setAlarm(bool on) { mAlarm = on; } 93 void setAlarm(bool on) { mAlarm = on; }
94 void setReply(bool on) { mReply = on; } 94 void setReply(bool on) { mReply = on; }
95 void setMoreInfo(bool on) { mInfo = on; } 95 void setMoreInfo(bool on) { mInfo = on; }
96 96
97 97
98 void setPalette(const QPalette &p) { mPalette = p; } 98 void setPalette(const QPalette &p) { mPalette = p; }
99 QPalette palette() const { return mPalette; } 99 QPalette palette() const { return mPalette; }
100 100
101 Incidence *incidence() const { return mIncidence; } 101 Incidence *incidence() const { return mIncidence; }
102 QDate incidenceDate() { return mDate; } 102 QDate incidenceDate() { return mDate; }
103 103
104 protected: 104 protected:
105 virtual void paint(QPainter *); 105 virtual void paint(QPainter *);
106 virtual int height(const QListBox *) const; 106 virtual int height(const QListBox *) const;
107 virtual int width(const QListBox *) const; 107 virtual int width(const QListBox *) const;
108 108
109 private: 109 private:
110 bool mRecur; 110 bool mRecur;
111 bool mAlarm; 111 bool mAlarm;
112 bool mReply; 112 bool mReply;
113 bool mInfo; 113 bool mInfo;
114 114
115 QPalette mPalette; 115 QPalette mPalette;
116 QDate mDate; 116 QDate mDate;
117 117
118 Incidence *mIncidence; 118 Incidence *mIncidence;
119}; 119};
120 120
121 121
122class KOMonthView; 122class KOMonthView;
123 123
124class MonthViewCell : public QWidget 124class MonthViewCell : public QWidget
125{ 125{
126 Q_OBJECT 126 Q_OBJECT
127 public: 127 public:
128 MonthViewCell( KOMonthView * ); 128 MonthViewCell( KOMonthView * );
129 129
130 void setDate( const QDate & ); 130 void setDate( const QDate & );
131 QDate date() const; 131 QDate date() const;
132 132
133 void setPrimary( bool ); 133 void setPrimary( bool );
134 bool isPrimary() const; 134 bool isPrimary() const;
135 135
136 void setHoliday( bool ); 136 void setHoliday( bool );
137 void setHoliday( const QString & ); 137 void setHoliday( const QString & );
138 138
139 void updateCell(); 139 void updateCell();
140 void startUpdateCell();
141 void finishUpdateCell();
142 void insertEvent(Event *);
143 void insertTodo(Todo *);
140 144
141 void updateConfig(); 145 void updateConfig();
142 146
143 void enableScrollBars( bool ); 147 void enableScrollBars( bool );
144 148
145 Incidence *selectedIncidence(); 149 Incidence *selectedIncidence();
146 QDate selectedIncidenceDate(); 150 QDate selectedIncidenceDate();
147 151
148 void deselect(); 152 void deselect();
149 void select(); 153 void select();
150 void clear(); 154 void clear();
151 155
152#ifdef DESKTOP_VERSION 156#ifdef DESKTOP_VERSION
153 static QToolTipGroup *toolTipGroup(); 157 static QToolTipGroup *toolTipGroup();
154#endif 158#endif
155 signals: 159 signals:
156 void defaultAction( Incidence * ); 160 void defaultAction( Incidence * );
157 void newEventSignal( QDateTime ); 161 void newEventSignal( QDateTime );
158 void showDaySignal( QDate ); 162 void showDaySignal( QDate );
159 163
160 protected: 164 protected:
165 QString mToolTip;
161 void resizeEvent( QResizeEvent * ); 166 void resizeEvent( QResizeEvent * );
162 167
163 protected slots: 168 protected slots:
164 void defaultAction( QListBoxItem * ); 169 void defaultAction( QListBoxItem * );
165 void contextMenu( QListBoxItem * ); 170 void contextMenu( QListBoxItem * );
166 void selection( QListBoxItem * ); 171 void selection( QListBoxItem * );
167 void cellClicked( QListBoxItem * ); 172 void cellClicked( QListBoxItem * );
168 void newEvent(); 173 void newEvent();
169 void showDay(); 174 void showDay();
170 175
171 private: 176 private:
172 KOMonthView *mMonthView; 177 KOMonthView *mMonthView;
173 178
174 QDate mDate; 179 QDate mDate;
175 bool mPrimary; 180 bool mPrimary;
176 bool mHoliday; 181 bool mHoliday;
177 QString mHolidayString; 182 QString mHolidayString;
178 183
179 //QLabel *mLabel; 184 //QLabel *mLabel;
180 QPushButton *mLabel; 185 QPushButton *mLabel;
181 QListBox *mItemList; 186 QListBox *mItemList;
182#ifdef DESKTOP_VERSION 187#ifdef DESKTOP_VERSION
183 static QToolTipGroup *mToolTipGroup; 188 static QToolTipGroup *mToolTipGroup;
184#endif 189#endif
185 QSize mLabelSize; 190 QSize mLabelSize;
186 QSize mLabelBigSize; 191 QSize mLabelBigSize;
187 QPalette mHolidayPalette; 192 QPalette mHolidayPalette;
188 QPalette mStandardPalette; 193 QPalette mStandardPalette;
189 QPalette mPrimaryPalette; 194 QPalette mPrimaryPalette;
190 QPalette mNonPrimaryPalette; 195 QPalette mNonPrimaryPalette;
191 void setMyPalette(); 196 void setMyPalette();
192 QPalette getPalette (); 197 QPalette getPalette ();
193 void keyPressEvent ( QKeyEvent * ) ; 198 void keyPressEvent ( QKeyEvent * ) ;
194 199
195}; 200};
196 201
197 202
198class KOMonthView: public KOEventView 203class KOMonthView: public KOEventView
199{ 204{
200 Q_OBJECT 205 Q_OBJECT
201 public: 206 public:
202 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); 207 KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 );
203 ~KOMonthView(); 208 ~KOMonthView();
204 209
205 /** Returns maximum number of days supported by the komonthview */ 210 /** Returns maximum number of days supported by the komonthview */
206 virtual int maxDatesHint(); 211 virtual int maxDatesHint();
207 212
208 /** Returns number of currently shown dates. */ 213 /** Returns number of currently shown dates. */
209 virtual int currentDateCount(); 214 virtual int currentDateCount();
210 215
211 /** returns the currently selected events */ 216 /** returns the currently selected events */
212 virtual QPtrList<Incidence> selectedIncidences(); 217 virtual QPtrList<Incidence> selectedIncidences();
213 218
214 /** returns dates of the currently selected events */ 219 /** returns dates of the currently selected events */
215 virtual DateList selectedDates(); 220 virtual DateList selectedDates();
216 221
217 virtual void printPreview(CalPrinter *calPrinter, 222 virtual void printPreview(CalPrinter *calPrinter,
218 const QDate &, const QDate &); 223 const QDate &, const QDate &);
219 bool isMonthView() { return true; } 224 bool isMonthView() { return true; }
220 bool isUpdatePossible() { return updatePossible; } 225 bool isUpdatePossible() { return updatePossible; }
221 226
222 MonthViewCell * selectedCell(); 227 MonthViewCell * selectedCell();
223 public slots: 228 public slots:
224 virtual void updateView(); 229 virtual void updateView();
225 virtual void updateConfig(); 230 virtual void updateConfig();
226 virtual void showDates(const QDate &start, const QDate &end); 231 virtual void showDates(const QDate &start, const QDate &end);
227 virtual void showEvents(QPtrList<Event> eventList); 232 virtual void showEvents(QPtrList<Event> eventList);
228 233
229 void changeEventDisplay(Event *, int); 234 void changeEventDisplay(Event *, int);
230 235
231 void clearSelection(); 236 void clearSelection();
232 237
233 void showContextMenu( Incidence * ); 238 void showContextMenu( Incidence * );
234 239
235 void setSelectedCell( MonthViewCell * ); 240 void setSelectedCell( MonthViewCell * );
236 241
237 protected slots: 242 protected slots:
238 void processSelectionChange(); 243 void processSelectionChange();
239 signals: 244 signals:
240 void nextMonth(); 245 void nextMonth();
241 void prevMonth(); 246 void prevMonth();
242 void selectWeekNum ( int ); 247 void selectWeekNum ( int );
243 void showDaySignal( QDate ); 248 void showDaySignal( QDate );
244 protected: 249 protected:
245 void resizeEvent(QResizeEvent *); 250 void resizeEvent(QResizeEvent *);
246 void viewChanged(); 251 void viewChanged();
247 void updateDayLabels(); 252 void updateDayLabels();
248 253
249 private: 254 private:
250 bool updatePossible; 255 bool updatePossible;
251 int mDaysPerWeek; 256 int mDaysPerWeek;
252 int mNumWeeks; 257 int mNumWeeks;
253 int mNumCells; 258 int mNumCells;
254 bool mWeekStartsMonday; 259 bool mWeekStartsMonday;
255 bool mShowSatSunComp; 260 bool mShowSatSunComp;
256 void computeLayout(); 261 void computeLayout();