libtdepim

kdateedit.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
5  Copyright (c) 2002 David Jarvie <software@astrojar.org.uk>
6  Copyright (c) 2004 Tobias Koenig <tokoe@kde.org>
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation; either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  along with this library; see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef KDATEEDIT_H
25 #define KDATEEDIT_H
26 
27 #include <tqcombobox.h>
28 #include <tqdatetime.h>
29 #include <tqmap.h>
30 
31 #include <tdemacros.h>
32 
33 #include "kdatepickerpopup.h"
34 
35 class TQEvent;
36 
54 class TDE_EXPORT KDateEdit : public TQComboBox
55 {
56  TQ_OBJECT
57 
58 
59  public:
60  KDateEdit( TQWidget *parent = 0, const char *name = 0 );
61  virtual ~KDateEdit();
62 
67  TQDate date() const;
68 
75  void setReadOnly( bool readOnly );
76 
80  bool isReadOnly() const;
81 
82  virtual void popup();
83 
84  signals:
91  void dateEntered( const TQDate &date );
92 
97  void dateChanged( const TQDate &date );
98 
99  public slots:
106  void setDate( const TQDate &date );
107 
108  protected slots:
109  void lineEnterPressed();
110  void slotTextChanged( const TQString& );
111  void dateSelected( TQDate );
112 
113  protected:
114  virtual bool eventFilter( TQObject*, TQEvent* );
115  virtual void mousePressEvent( TQMouseEvent* );
116 
128  virtual bool assignDate( const TQDate &date );
129 
134  void setupKeywords();
135 
136  private:
137  TQDate parseDate( bool* = 0 ) const;
138  void updateView();
139 
140  KDatePickerPopup *mPopup;
141 
142  TQDate mDate;
143  bool mReadOnly;
144  bool mTextChanged;
145  bool mDiscardNextMousePress;
146 
147  TQMap<TQString, int> mKeywordMap;
148 };
149 
150 #endif
A date editing widget that consists of an editable combo box.
Definition: kdateedit.h:55
void dateEntered(const TQDate &date)
This signal is emitted whenever the user has entered a new date.
void dateChanged(const TQDate &date)
This signal is emitted whenever the user modifies the date.
This menu helps the user to select a date quickly.