summaryrefslogtreecommitdiffabout
path: root/microkde/kdatetbl.h
authorzautrix <zautrix>2004-09-17 12:38:04 (UTC)
committer zautrix <zautrix>2004-09-17 12:38:04 (UTC)
commit053b3550aa2b987d7aeaf74cc458754d7e80a67b (patch) (unidiff)
tree4190b96b6b581c18943ac7e1cdd5cbca96741eae /microkde/kdatetbl.h
parentdd33ac512eb4b4b647fb3423f7cdb39ec322221b (diff)
downloadkdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.zip
kdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.tar.gz
kdepimpi-053b3550aa2b987d7aeaf74cc458754d7e80a67b.tar.bz2
Better datepicker
Diffstat (limited to 'microkde/kdatetbl.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kdatetbl.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/microkde/kdatetbl.h b/microkde/kdatetbl.h
index df7b7ef..b4d3e16 100644
--- a/microkde/kdatetbl.h
+++ b/microkde/kdatetbl.h
@@ -184,125 +184,126 @@ private:
184 184
185 virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); } 185 virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); }
186protected: 186protected:
187 virtual void virtual_hook( int id, void* data ); 187 virtual void virtual_hook( int id, void* data );
188private: 188private:
189 class KPopupFramePrivate; 189 class KPopupFramePrivate;
190 KPopupFramePrivate *d; 190 KPopupFramePrivate *d;
191}; 191};
192 192
193/** 193/**
194* Validates user-entered dates. 194* Validates user-entered dates.
195*/ 195*/
196class KDateValidator : public QValidator 196class KDateValidator : public QValidator
197{ 197{
198public: 198public:
199 KDateValidator(QWidget* parent=0, const char* name=0); 199 KDateValidator(QWidget* parent=0, const char* name=0);
200 virtual State validate(QString&, int&) const; 200 virtual State validate(QString&, int&) const;
201 virtual void fixup ( QString & input ) const; 201 virtual void fixup ( QString & input ) const;
202 State date(const QString&, QDate&) const; 202 State date(const QString&, QDate&) const;
203}; 203};
204 204
205/** 205/**
206 * Date selection table. 206 * Date selection table.
207 * This is a support class for the KDatePicker class. It just 207 * This is a support class for the KDatePicker class. It just
208 * draws the calender table without titles, but could theoretically 208 * draws the calender table without titles, but could theoretically
209 * be used as a standalone. 209 * be used as a standalone.
210 * 210 *
211 * When a date is selected by the user, it emits a signal: 211 * When a date is selected by the user, it emits a signal:
212 * dateSelected(QDate) 212 * dateSelected(QDate)
213 * 213 *
214 * @internal 214 * @internal
215 * @version $Id$ 215 * @version $Id$
216 * @author Tim Gilman, Mirko Boehm 216 * @author Tim Gilman, Mirko Boehm
217 */ 217 */
218class KDateTable : public QGridView 218class KDateTable : public QGridView
219{ 219{
220 Q_OBJECT 220 Q_OBJECT
221public: 221public:
222 /** 222 /**
223 * The constructor. 223 * The constructor.
224 */ 224 */
225 KDateTable(QWidget *parent=0, 225 KDateTable(QWidget *parent=0,
226 QDate date=QDate::currentDate(), 226 QDate date=QDate::currentDate(),
227 const char* name=0, WFlags f=0); 227 const char* name=0, WFlags f=0);
228 /** 228 /**
229 * Returns a recommended size for the widget. 229 * Returns a recommended size for the widget.
230 * To save some time, the size of the largest used cell content is 230 * To save some time, the size of the largest used cell content is
231 * calculated in each paintCell() call, since all calculations have 231 * calculated in each paintCell() call, since all calculations have
232 * to be done there anyway. The size is stored in maxCell. The 232 * to be done there anyway. The size is stored in maxCell. The
233 * sizeHint() simply returns a multiple of maxCell. 233 * sizeHint() simply returns a multiple of maxCell.
234 */ 234 */
235 virtual QSize sizeHint() const; 235 virtual QSize sizeHint() const;
236 /** 236 /**
237 * Set the font size of the date table. 237 * Set the font size of the date table.
238 */ 238 */
239 void setFontSize(int size); 239 void setFontSize(int size);
240 /** 240 /**
241 * Select and display this date. 241 * Select and display this date.
242 */ 242 */
243 bool setDate(const QDate&); 243 bool setDate(const QDate&);
244 const QDate& getDate() const; 244 const QDate& getDate() const;
245 245
246 246
247protected: 247protected:
248 bool mMarkCurrent;
248 /** 249 /**
249 * Paint a cell. 250 * Paint a cell.
250 */ 251 */
251 virtual void paintCell(QPainter*, int, int); 252 virtual void paintCell(QPainter*, int, int);
252 /** 253 /**
253 * Handle the resize events. 254 * Handle the resize events.
254 */ 255 */
255 virtual void viewportResizeEvent(QResizeEvent *); 256 virtual void viewportResizeEvent(QResizeEvent *);
256 /** 257 /**
257 * React on mouse clicks that select a date. 258 * React on mouse clicks that select a date.
258 */ 259 */
259 virtual void contentsMousePressEvent(QMouseEvent *); 260 virtual void contentsMousePressEvent(QMouseEvent *);
260 virtual void keyPressEvent( QKeyEvent *e ); 261 virtual void keyPressEvent( QKeyEvent *e );
261 virtual void focusInEvent( QFocusEvent *e ); 262 virtual void focusInEvent( QFocusEvent *e );
262 virtual void focusOutEvent( QFocusEvent *e ); 263 virtual void focusOutEvent( QFocusEvent *e );
263 /** 264 /**
264 * The font size of the displayed text. 265 * The font size of the displayed text.
265 */ 266 */
266 int fontsize; 267 int fontsize;
267 /** 268 /**
268 * The currently selected date. 269 * The currently selected date.
269 */ 270 */
270 QDate date; 271 QDate date;
271 /** 272 /**
272 * The day of the first day in the month [1..7]. 273 * The day of the first day in the month [1..7].
273 */ 274 */
274 int firstday; 275 int firstday;
275 /** 276 /**
276 * The number of days in the current month. 277 * The number of days in the current month.
277 */ 278 */
278 int numdays; 279 int numdays;
279 /** 280 /**
280 * The number of days in the previous month. 281 * The number of days in the previous month.
281 */ 282 */
282 int numDaysPrevMonth; 283 int numDaysPrevMonth;
283 /** 284 /**
284 * unused 285 * unused
285 */ 286 */
286 bool unused_hasSelection; 287 bool unused_hasSelection;
287 /** 288 /**
288 * Save the size of the largest used cell content. 289 * Save the size of the largest used cell content.
289 */ 290 */
290 QRect maxCell; 291 QRect maxCell;
291signals: 292signals:
292 /** 293 /**
293 * The selected date changed. 294 * The selected date changed.
294 */ 295 */
295 void dateChanged(QDate); 296 void dateChanged(QDate);
296 /** 297 /**
297 * A date has been selected by clicking on the table. 298 * A date has been selected by clicking on the table.
298 */ 299 */
299 void tableClicked(); 300 void tableClicked();
300 301
301protected: 302protected:
302 virtual void virtual_hook( int id, void* data ); 303 virtual void virtual_hook( int id, void* data );
303private: 304private:
304 class KDateTablePrivate; 305 class KDateTablePrivate;
305 KDateTablePrivate *d; 306 KDateTablePrivate *d;
306}; 307};
307 308
308#endif // KDATETBL_H 309#endif // KDATETBL_H