libtdepim

kdatepickerpopup.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2004 Bram Schoenmakers <bramschoenmakers@kde.nl>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 #ifndef KDATEPICKERPOPUP_H
22 #define KDATEPICKERPOPUP_H
23 
24 #include <tqdatetime.h>
25 #include <tqpopupmenu.h>
26 
27 #include <tdemacros.h>
28 #include <kdatepicker.h>
29 
45 class TDE_EXPORT KDatePickerPopup: public TQPopupMenu
46 {
47  TQ_OBJECT
48 
49  public:
50  enum { NoDate = 1, DatePicker = 2, Words = 4 };
51 
60  KDatePickerPopup( int items = DatePicker, const TQDate &date = TQDate::currentDate(),
61  TQWidget *parent = 0, const char *name = 0 );
62 
67  KDatePicker *datePicker() const;
68 
69  void setDate( const TQDate &date );
70 
71 #if 0
75  void setItems( int items = 1 );
76 #endif
78  int items() const { return mItems; }
79 
80  signals:
81 
86  void dateChanged ( TQDate );
87 
88  protected slots:
89  void slotDateChanged ( TQDate );
90 
91  void slotToday();
92  void slotTomorrow();
93  void slotNextWeek();
94  void slotNextMonth();
95  void slotNoDate();
96 
97  private:
98  void buildMenu();
99 
100  KDatePicker *mDatePicker;
101  int mItems;
102 };
103 
104 #endif
This menu helps the user to select a date quickly.
void dateChanged(TQDate)
This signal emits the new date (selected with datepicker or other menu-items).