Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

kdatetbl.h

Go to the documentation of this file.
00001 /*  -*- C++ -*-
00002     This file is part of the KDE libraries
00003     Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org)
00004               (C) 1998-2001 Mirko Boehm (mirko@kde.org)
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018     Boston, MA 02111-1307, USA.
00019 */
00020 #ifndef KDATETBL_H
00021 #define KDATETBL_H
00022 
00023 #include <qvalidator.h>
00024 #include <qgridview.h>
00025 #include <qlineedit.h>
00026 #include <qdatetime.h>
00027 
00034 class KDateInternalMonthPicker : public QGridView
00035 {
00036   Q_OBJECT
00037 protected:
00041   int result;
00045   short int activeCol;
00046   short int activeRow;
00050   QRect max;
00051 signals:
00055   void closeMe(int);
00056 public:
00060   KDateInternalMonthPicker(int fontsize, QWidget* parent, const char* name=0);
00064   QSize sizeHint() const;
00069   int getResult() const;
00070 protected:
00074   void setupPainter(QPainter *p);
00078   void viewportResizeEvent(QResizeEvent*);
00082   virtual void paintCell(QPainter* painter, int row, int col);
00086   void contentsMousePressEvent(QMouseEvent *e);
00087   void contentsMouseMoveEvent(QMouseEvent *e);
00091   void contentsMouseReleaseEvent(QMouseEvent *e);
00092 
00093 private:
00094   class KDateInternalMonthPrivate;
00095   KDateInternalMonthPrivate *d;
00096 };
00097 
00103 class KDateInternalYearSelector : public QLineEdit
00104 {
00105   Q_OBJECT
00106 protected:
00107   QIntValidator *val;
00108   int result;
00109 public slots:
00110   void yearEnteredSlot();
00111 signals:
00112   void closeMe(int);
00113 public:
00114   KDateInternalYearSelector(int fontsize,
00115                             QWidget* parent=0,
00116                             const char* name=0);
00117   int getYear();
00118   void setYear(int year);
00119 
00120 private:
00121   class KDateInternalYearPrivate;
00122   KDateInternalYearPrivate *d;
00123 };
00124 
00130 class KPopupFrame : public QFrame
00131 {
00132   Q_OBJECT
00133 protected:
00137   int result;
00141   void keyPressEvent(QKeyEvent* e);
00145   QWidget *main;
00146 public slots:
00151   void close(int r);
00152 public:
00156   KPopupFrame(QWidget* parent=0, const char*  name=0);
00164   void setMainWidget(QWidget* m);
00169   void resizeEvent(QResizeEvent*);
00173   void popup(const QPoint &pos);
00177   int exec(QPoint p);
00181   int exec(int x, int y);
00182 
00183 private:
00184 
00185   virtual bool close(bool alsoDelete) { return QFrame::close(alsoDelete); }
00186 protected:
00187   virtual void virtual_hook( int id, void* data );
00188 private:
00189   class KPopupFramePrivate;
00190   KPopupFramePrivate *d;
00191 };
00192 
00196 class KDateValidator : public QValidator
00197 {
00198 public:
00199     KDateValidator(QWidget* parent=0, const char* name=0);
00200     virtual State validate(QString&, int&) const;
00201     virtual void fixup ( QString & input ) const;
00202     State date(const QString&, QDate&) const;
00203 };
00204 
00218 class KDateTable : public QGridView
00219 {
00220     Q_OBJECT
00221 public:
00225     KDateTable(QWidget *parent=0,
00226                QDate date=QDate::currentDate(),
00227                const char* name=0, WFlags f=0);
00235     virtual QSize sizeHint() const;
00239     void setFontSize(int size);
00243     bool setDate(const QDate&);
00244     const QDate& getDate() const;
00245 
00246 
00247 protected:
00251     virtual void paintCell(QPainter*, int, int);
00255     virtual void viewportResizeEvent(QResizeEvent *);
00259     virtual void contentsMousePressEvent(QMouseEvent *);
00260     virtual void keyPressEvent( QKeyEvent *e );
00261     virtual void focusInEvent( QFocusEvent *e );
00262     virtual void focusOutEvent( QFocusEvent *e );
00266     int fontsize;
00270     QDate date;
00274     int firstday;
00278     int numdays;
00282     int numDaysPrevMonth;
00286     bool unused_hasSelection;
00290     QRect maxCell;
00291 signals:
00295     void dateChanged(QDate);
00299     void tableClicked();
00300 
00301 protected:
00302   virtual void virtual_hook( int id, void* data );
00303 private:
00304     class KDateTablePrivate;
00305     KDateTablePrivate *d;
00306 };
00307 
00308 #endif // KDATETBL_H

Generated on Sat Nov 5 16:17:11 2005 for OPIE by  doxygen 1.4.2