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 library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library 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 GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 #ifndef KDATEEDIT_H 00022 #define KDATEEDIT_H 00023 00024 #include <qvbox.h> 00025 #include <qdatetime.h> 00026 #include <qcombobox.h> 00027 #include <qmap.h> 00028 00029 class QEvent; 00030 class KDatePicker; 00031 00046 class KDateEdit : public QComboBox 00047 { 00048 Q_OBJECT 00049 public: 00050 KDateEdit(QWidget *parent=0, const char *name=0); 00051 virtual ~KDateEdit(); 00052 00057 bool inputIsValid() const; 00058 00062 QDate date() const; 00063 00069 void setDate(const QDate& date); 00070 00073 QDate defaultDate() const; 00074 00079 void setDefaultDate(const QDate& date); 00080 00086 void setHandleInvalid(bool handleInvalid); 00087 00089 bool handlesInvalid() const; 00090 00095 void setReadOnly(bool readOnly); 00096 00098 bool isReadOnly() const; 00099 00106 virtual bool validate(const QDate &newDate); 00107 00108 virtual void popup(); 00109 00110 signals: 00115 void dateChanged(QDate); 00116 00119 void invalidDateEntered(); 00120 00121 protected slots: 00122 void dateSelected(QDate); 00123 void dateEntered(QDate); 00124 void lineEnterPressed(); 00125 void slotTextChanged(const QString &); 00126 virtual void mousePressEvent(QMouseEvent *); 00127 00128 private: 00129 virtual bool eventFilter(QObject *o, QEvent *e); 00130 bool readDate(QDate& result) const; 00131 00135 QMap<QString, int> mKeywordMap; 00136 bool mTextChanged; 00137 bool mHandleInvalid; 00138 00139 KDatePicker *mDatePicker; 00140 QVBox *mDateFrame; 00141 QDate defaultValue; 00142 QDate value; 00143 bool mReadOnly; 00144 bool mDiscardNextMousePress; 00145 }; 00146 00147 #endif
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:57:46 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003