libtdepim

ktimeedit.h
1 /*
2  This file is part of libtdepim.
3 
4  Copyright (c) 1999 Preston Brown <pbrown@kde.org>
5  Copyright (c) 1999 Ian Dawes <iadawes@globalserve.net>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 #ifndef _KTIMEEDIT_H
26 #define _KTIMEEDIT_H
27 
28 #include <tqevent.h>
29 #include <tqkeycode.h>
30 #include <tqstring.h>
31 #include <tqdatetime.h>
32 #include <tqcombobox.h>
33 
34 #include <tdeapplication.h>
35 #include <tdemacros.h>
36 
44 class TDE_EXPORT KTimeEdit : public TQComboBox
45 {
46  TQ_OBJECT
47 
48  public:
50  KTimeEdit(TQWidget *parent=0, TQTime qt=TQTime(12,0), const char *name=0);
51 
52  virtual ~KTimeEdit();
53 
57  bool hasTime() const;
58 
60  TQTime getTime() const;
61 
63  TQSizePolicy sizePolicy() const;
64 
66  bool inputIsValid() const;
67 
68  signals:
73  void timeChanged(TQTime newt);
74 
75  public slots:
77  void setTime(TQTime qt);
78 
79  protected slots:
80  void active(int);
81  void hilit(int);
82  void changedText();
83 
84  protected:
85  virtual void keyPressEvent(TQKeyEvent *qke);
86  void addTime(TQTime qt);
87  void subTime(TQTime qt);
88  // Update the lineedit text from mTime
89  void updateText();
90 
91 private:
92  TQTime mTime; // the widget's displayed time.
93  //TQString mNoTimeString;
94 };
95 
96 #endif
This is a class that provides an easy, user friendly way to edit times.
Definition: ktimeedit.h:45
void timeChanged(TQTime newt)
Emitted every time the time displayed changes.