2009-03-31 21:06:56 +00:00
|
|
|
/*******************************************************************
|
|
|
|
* kdatecombo.h
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
******************************************************************/
|
2001-10-18 09:14:25 +00:00
|
|
|
|
|
|
|
#ifndef KDATECOMBO_H
|
|
|
|
#define KDATECOMBO_H
|
|
|
|
|
2012-04-09 22:20:00 +00:00
|
|
|
#include <QWidget>
|
2007-05-09 22:23:52 +00:00
|
|
|
#include <QtCore/QDate>
|
2001-10-18 09:14:25 +00:00
|
|
|
|
2009-03-31 21:06:56 +00:00
|
|
|
#include <kcombobox.h>
|
|
|
|
|
2001-10-18 09:14:25 +00:00
|
|
|
/**
|
|
|
|
*@author Beppe Grimaldi
|
|
|
|
*/
|
|
|
|
|
|
|
|
class KDatePicker;
|
|
|
|
class KPopupFrame;
|
|
|
|
|
2009-03-31 21:06:56 +00:00
|
|
|
class KDateCombo : public KComboBox {
|
2001-10-18 09:14:25 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2005-10-03 13:25:36 +00:00
|
|
|
KDateCombo(QWidget *parent=0);
|
2007-05-26 01:57:37 +00:00
|
|
|
explicit KDateCombo(const QDate & date, QWidget *parent=0);
|
2001-10-18 09:14:25 +00:00
|
|
|
~KDateCombo();
|
|
|
|
|
|
|
|
QDate & getDate(QDate *currentDate);
|
|
|
|
bool setDate(const QDate & newDate);
|
|
|
|
|
|
|
|
private:
|
|
|
|
KPopupFrame * popupFrame;
|
|
|
|
KDatePicker * datePicker;
|
|
|
|
|
2005-10-03 13:25:36 +00:00
|
|
|
void initObject(const QDate & date);
|
2001-10-18 09:14:25 +00:00
|
|
|
|
|
|
|
QString date2String(const QDate &);
|
|
|
|
QDate & string2Date(const QString &, QDate * );
|
|
|
|
|
|
|
|
protected:
|
2003-08-07 08:39:27 +00:00
|
|
|
bool eventFilter (QObject*, QEvent*);
|
|
|
|
virtual void mousePressEvent (QMouseEvent * e);
|
2005-10-03 13:25:36 +00:00
|
|
|
|
2006-01-20 11:09:06 +00:00
|
|
|
protected Q_SLOTS:
|
2007-06-23 18:53:52 +00:00
|
|
|
void dateEnteredEvent(const QDate &d=QDate());
|
2001-10-18 09:14:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|