libkdepim Library API Documentation

kdateedit.h

00001 /*
00002     This file is part of libkdepim.
00003 
00004     Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019 
00020     As a special exception, permission is given to link this program
00021     with any edition of Qt, and distribute the resulting executable,
00022     without including the source code for Qt in the source distribution.
00023 */
00024 #ifndef KDATEEDIT_H
00025 #define KDATEEDIT_H
00026 
00027 #include <qvbox.h>
00028 #include <qdatetime.h>
00029 #include <qcombobox.h>
00030 #include <qmap.h>
00031 
00032 class QEvent;
00033 class KDatePicker;
00034 
00049 class KDateEdit : public QComboBox
00050 {
00051     Q_OBJECT
00052   public:
00053     KDateEdit(QWidget *parent=0, const char *name=0);
00054     virtual ~KDateEdit();
00055 
00060     bool inputIsValid() const;
00061 
00065     QDate date() const;
00066 
00072     void setDate(const QDate& date);
00073 
00076     QDate defaultDate() const;
00077 
00082     void setDefaultDate(const QDate& date);
00083 
00089     void setHandleInvalid(bool handleInvalid);
00090 
00097     virtual bool validate(const QDate &newDate);
00098 
00099     virtual void popup();
00100 
00101   signals:
00106     void dateChanged(QDate);
00107 
00110     void invalidDateEntered();
00111 
00112   protected slots:
00113     void dateSelected(QDate);
00114     void dateEntered(QDate);
00115     void lineEnterPressed();
00116     void slotTextChanged(const QString &);
00117     virtual void mousePressEvent(QMouseEvent *);
00118 
00119   private:
00120     virtual bool eventFilter(QObject *o, QEvent *e);
00121     bool readDate(QDate& result) const;
00122 
00126     QMap<QString, int> mKeywordMap;
00127     bool mTextChanged;
00128     bool mHandleInvalid;
00129 
00130     KDatePicker *mDatePicker;
00131     QVBox *mDateFrame;
00132     QDate  defaultValue;
00133     QDate  value;
00134     bool   mDiscardNextMousePress;
00135 };
00136 
00137 #endif
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:00 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001