ktimeedit.h
00001 /* 00002 This file is part of libtdepim. 00003 00004 Copyright (c) 1999 Preston Brown <pbrown@kde.org> 00005 Copyright (c) 1999 Ian Dawes <iadawes@globalserve.net> 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 00021 As a special exception, permission is given to link this program 00022 with any edition of TQt, and distribute the resulting executable, 00023 without including the source code for TQt in the source distribution. 00024 */ 00025 #ifndef _KTIMEEDIT_H 00026 #define _KTIMEEDIT_H 00027 00028 #include <tqevent.h> 00029 #include <tqkeycode.h> 00030 #include <tqstring.h> 00031 #include <tqdatetime.h> 00032 #include <tqcombobox.h> 00033 00034 #include <tdeapplication.h> 00035 #include <tdepimmacros.h> 00036 00044 class KDE_EXPORT KTimeEdit : public TQComboBox 00045 { 00046 Q_OBJECT 00047 00048 public: 00050 KTimeEdit(TQWidget *parent=0, TQTime qt=TQTime(12,0), const char *name=0); 00051 00052 virtual ~KTimeEdit(); 00053 00057 bool hasTime() const; 00058 00060 TQTime getTime() const; 00061 00063 TQSizePolicy sizePolicy() const; 00064 00066 bool inputIsValid() const; 00067 00068 signals: 00073 void timeChanged(TQTime newt); 00074 00075 public slots: 00077 void setTime(TQTime qt); 00078 00079 protected slots: 00080 void active(int); 00081 void hilit(int); 00082 void changedText(); 00083 00084 protected: 00085 virtual void keyPressEvent(TQKeyEvent *qke); 00086 void addTime(TQTime qt); 00087 void subTime(TQTime qt); 00088 // Update the lineedit text from mTime 00089 void updateText(); 00090 00091 private: 00092 TQTime mTime; // the widget's displayed time. 00093 //TQString mNoTimeString; 00094 }; 00095 00096 #endif