KDEUI
kdatepicker.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 (C) 2007 John Layt <john@layt.net> 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., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KDATEPICKER_H 00023 #define KDATEPICKER_H 00024 00025 #include <kdeui_export.h> 00026 00027 #include <QtCore/QDateTime> 00028 #include <QtGui/QFrame> 00029 00030 #include <klocale.h> 00031 00032 class QLineEdit; 00033 class KDateTable; 00034 class KCalendarSystem; 00035 00055 class KDEUI_EXPORT KDatePicker: public QFrame 00056 { 00057 Q_OBJECT 00058 Q_PROPERTY( QDate date READ date WRITE setDate NOTIFY dateChanged USER true ) 00059 //FIXME Q_PROPERTY( KCalendarSystem calendar READ calendar WRITE setCalendar USER true ) 00060 Q_PROPERTY( bool closeButton READ hasCloseButton WRITE setCloseButton ) 00061 Q_PROPERTY( int fontSize READ fontSize WRITE setFontSize ) 00062 00063 public: 00067 explicit KDatePicker( QWidget *parent = 0 ); 00068 00072 explicit KDatePicker( const QDate &dt, QWidget *parent = 0 ); 00073 00077 virtual ~KDatePicker(); 00078 00085 QSize sizeHint() const; 00086 00092 bool setDate( const QDate& date ); 00093 00097 const QDate &date() const; 00098 00104 const KCalendarSystem *calendar() const; 00105 00113 bool setCalendar( KCalendarSystem *calendar = 0 ); 00114 00122 bool setCalendar( const QString &calendarType ); 00123 00132 bool setCalendarSystem( KLocale::CalendarSystem calendarSystem ); 00133 00137 void setEnabled( bool enable ); 00138 00143 KDateTable *dateTable() const; 00144 00148 void setFontSize( int ); 00149 00153 int fontSize() const; 00154 00163 void setCloseButton( bool enable ); 00164 00169 bool hasCloseButton() const; 00170 00171 protected: 00173 virtual bool eventFilter( QObject *o, QEvent *e ); 00175 virtual void resizeEvent( QResizeEvent* ); 00176 00177 protected Q_SLOTS: 00178 void dateChangedSlot( const QDate& date ); 00179 void tableClickedSlot(); 00180 void monthForwardClicked(); 00181 void monthBackwardClicked(); 00182 void yearForwardClicked(); 00183 void yearBackwardClicked(); 00184 void selectMonthClicked(); 00185 void selectYearClicked(); 00186 void uncheckYearSelector(); 00187 void lineEnterPressed(); 00188 void todayButtonClicked(); 00189 void weekSelected( int ); 00190 00191 Q_SIGNALS: 00198 void dateChanged( const QDate &date ); 00199 00205 void dateSelected( const QDate &date ); 00206 00212 void dateEntered( const QDate &date ); 00213 00217 void tableClicked(); 00218 00219 private: 00220 void init( const QDate &date ); 00221 class KDatePickerPrivate; 00222 friend class KDatePickerPrivate; 00223 KDatePickerPrivate *const d; 00224 }; 00225 00226 #endif // KDATEPICKER_H
KDE 4.6 API Reference