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 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00018 Boston, MA 02111-1307, USA. 00019 */ 00020 #ifndef MICROKDE_KDATEPICKER_H 00021 #define MICROKDE_KDATEPICKER_H 00022 #include <qdatetime.h> 00023 #include <qframe.h> 00024 00025 class QLineEdit; 00026 class QToolButton; 00027 class KDateValidator; 00028 class KDateTable; 00029 00049 class KDatePicker: public QFrame 00050 { 00051 Q_OBJECT 00052 public: 00056 KDatePicker(QWidget *parent=0, 00057 QDate=QDate::currentDate(), 00058 const char *name=0); 00062 virtual ~KDatePicker(); 00063 00070 QSize sizeHint() const; 00071 00078 bool setDate(const QDate&); 00079 00084 const QDate& getDate() const; 00085 00089 const QDate &date() const; 00090 00094 void setEnabled(bool); 00095 00099 void setFontSize(int); 00103 int fontSize() const 00104 { return fontsize; } 00105 00106 protected: 00108 void resizeEvent(QResizeEvent*); 00110 QToolButton *yearForward; 00112 QToolButton *yearBackward; 00114 QToolButton *monthForward; 00116 QToolButton *monthBackward; 00118 QToolButton *selectMonth; 00120 QToolButton *selectYear; 00122 QLineEdit *line; 00124 KDateValidator *val; 00126 KDateTable *table; 00128 // QSize sizehint; 00130 QSize maxMonthRect; 00131 protected slots: 00132 void dateChangedSlot(QDate); 00133 void tableClickedSlot(); 00134 void monthForwardClicked(); 00135 void monthBackwardClicked(); 00136 void yearForwardClicked(); 00137 void yearBackwardClicked(); 00138 void selectMonthClicked(); 00139 void selectYearClicked(); 00140 void lineEnterPressed(); 00141 signals: 00148 void dateChanged(QDate); 00154 void dateSelected(QDate); 00160 void dateEntered(QDate); 00164 void tableClicked(); 00165 00166 private: 00168 int fontsize; 00169 00170 protected: 00171 virtual void virtual_hook( int id, void* data ); 00172 private: 00173 class KDatePickerPrivate; 00174 KDatePickerPrivate *d; 00175 }; 00176 00177 #endif // KDATEPICKER_H
1.4.2