kdatepicker.h
/* -*- C++ -*-
This file is part of the KDE libraries
Copyright (C) 1997 Tim D. Gilman (tdgilman@best.org)
(C) 1998-2001 Mirko Boehm (mirko@kde.org)
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDATEPICKER_H
#define KDATEPICKER_H
#include <qdatetime.h>
#include <qframe.h>
#include <kdelibs_export.h>
class QLineEdit;
class QToolButton;
class KDateValidator;
class KDateTable;
class KDEUI_EXPORT KDatePicker: public QFrame
{
Q_OBJECT
Q_PROPERTY( QDate date READ date WRITE setDate)
Q_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton )
Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize )
public:
KDatePicker(QWidget *parent=0,
QDate=QDate::currentDate(),
const char *name=0);
KDatePicker(QWidget *parent,
QDate,
const char *name,
WFlags f); // ### KDE 4.0: Merge
KDatePicker( QWidget *parent, const char *name );
virtual ~KDatePicker();
QSize sizeHint() const;
bool setDate(const QDate&);
const QDate& getDate() const KDE_DEPRECATED;
const QDate &date() const;
void setEnabled(bool);
KDateTable *dateTable() const { return table; }
void setFontSize(int);
int fontSize() const
{ return fontsize; }
void setCloseButton( bool enable );
bool hasCloseButton() const;
protected:
virtual bool eventFilter(QObject *o, QEvent *e );
virtual void resizeEvent(QResizeEvent*);
QToolButton *yearForward;
QToolButton *yearBackward;
QToolButton *monthForward;
QToolButton *monthBackward;
QToolButton *selectMonth;
QToolButton *selectYear;
QLineEdit *line;
KDateValidator *val;
KDateTable *table;
// QSize sizehint;
QSize maxMonthRect;
protected slots:
void dateChangedSlot(QDate);
void tableClickedSlot();
void monthForwardClicked();
void monthBackwardClicked();
void yearForwardClicked();
void yearBackwardClicked();
void selectWeekClicked();
void selectMonthClicked();
void selectYearClicked();
void lineEnterPressed();
void todayButtonClicked();
void weekSelected(int);
signals:
// ### KDE 4.0 Make all QDate parameters const references
void dateChanged(QDate);
void dateSelected(QDate);
void dateEntered(QDate);
void tableClicked();
private slots:
void ensureSelectYearIsUp();
private:
int fontsize;
protected:
virtual void virtual_hook( int id, void* data );
private:
void init( const QDate &dt );
void fillWeeksCombo(const QDate &date);
class KDatePickerPrivate;
KDatePickerPrivate *d;
};
#endif // KDATEPICKER_H
KDatePicker::monthForward
QToolButton * monthForward
the month forward button
Definition: kdatepicker.h:164
KDatePicker::dateTable
KDateTable * dateTable() const
Definition: kdatepicker.h:124
KDateTable
Date selection table.
Definition: kdatetbl.h:263
KDatePicker::selectYear
QToolButton * selectYear
the button for selecting the year directly
Definition: kdatepicker.h:170
KDatePicker::monthBackward
QToolButton * monthBackward
the month backward button
Definition: kdatepicker.h:166
KDatePicker::table
KDateTable * table
the date table
Definition: kdatepicker.h:176
KDatePicker::fontSize
int fontSize() const
Returns the font size of the widget elements.
Definition: kdatepicker.h:133
KDatePicker::yearBackward
QToolButton * yearBackward
the year backward button
Definition: kdatepicker.h:162
KDateValidator
Validates user-entered dates.
Definition: kdatetbl.h:241
KDatePicker::val
KDateValidator * val
the validator for the line edit:
Definition: kdatepicker.h:174
KDatePicker::yearForward
QToolButton * yearForward
the year forward button
Definition: kdatepicker.h:160
KDatePicker::maxMonthRect
QSize maxMonthRect
the size calculated during resize events
Definition: kdatepicker.h:180
KDatePicker::line
QLineEdit * line
the line edit to enter the date directly
Definition: kdatepicker.h:172
KDatePicker::selectMonth
QToolButton * selectMonth
the button for selecting the month directly
Definition: kdatepicker.h:168
KDatePicker
A date selection widget.
Definition: kdatepicker.h:51

KDE Home | KDE Accessibility Home | Description of Access Keys