kdatepickerpopup_p.h

00001 /*
00002     This file is part of Akonadi Contact.
00003 
00004   Copyright (c) 2004 Bram Schoenmakers <bramschoenmakers@kde.nl>
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., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KDATEPICKERPOPUP_P_H
00023 #define KDATEPICKERPOPUP_P_H
00024 
00025 #include <QtCore/QDateTime>
00026 #include <QtGui/QMenu>
00027 
00028 class KDatePicker;
00029 
00030 namespace KPIM {
00031 
00049 class KDatePickerPopup: public QMenu
00050 {
00051   Q_OBJECT
00052 
00053   public:
00054     enum ItemFlag {
00055       NoDate = 1,
00056       DatePicker = 2,
00057       Words = 4
00058     };
00059 
00060     Q_DECLARE_FLAGS( Items, ItemFlag )
00061 
00062     
00070     explicit KDatePickerPopup( Items items = DatePicker,
00071                                const QDate &date = QDate::currentDate(),
00072                                QWidget *parent = 0 );
00073 
00078     KDatePicker *datePicker() const;
00079 
00080     void setDate( const QDate &date );
00081 
00082 #if 0
00083 
00087     void setItems( int items = 1 );
00088 #endif
00089 
00090     int items() const { return mItems; }
00091 
00092   Q_SIGNALS:
00093 
00098     void dateChanged ( const QDate &date );
00099 
00100   protected Q_SLOTS:
00101     void slotDateChanged ( const QDate &date );
00102 
00103     void slotToday();
00104     void slotTomorrow();
00105     void slotNextWeek();
00106     void slotNextMonth();
00107     void slotNoDate();
00108 
00109   private:
00110     void buildMenu();
00111 
00112     KDatePicker *mDatePicker;
00113     Items mItems;
00114 };
00115 
00116 Q_DECLARE_OPERATORS_FOR_FLAGS( KDatePickerPopup::Items )
00117 
00118 }
00119 
00120 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys