libkdepim

ktimeedit.h

00001 /*
00002     This file is part of libkdepim.
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 Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef _KTIMEEDIT_H
00026 #define _KTIMEEDIT_H
00027 
00028 #include <qevent.h>
00029 #include <qkeycode.h>
00030 #include <qstring.h>
00031 #include <qdatetime.h>
00032 #include <qcombobox.h>
00033 
00034 #include <kapplication.h>
00035 #include <kdepimmacros.h>
00036 
00044 class KDE_EXPORT KTimeEdit : public QComboBox
00045 {
00046     Q_OBJECT
00047   public:
00049     KTimeEdit(QWidget *parent=0, QTime qt=QTime(12,0), const char *name=0);
00050 
00051     virtual ~KTimeEdit();
00052 
00056     bool hasTime() const;
00057 
00059     QTime getTime() const;
00060 
00062     QSizePolicy sizePolicy() const;
00063 
00065     bool inputIsValid() const;
00066 
00067   signals:
00072     void timeChanged(QTime newt);
00073 
00074   public slots:
00076     void setTime(QTime qt);
00077 
00078   protected slots:
00079     void active(int);
00080     void hilit(int);
00081     void changedText();
00082 
00083   protected:
00084     virtual void keyPressEvent(QKeyEvent *qke);
00085     void addTime(QTime qt);
00086     void subTime(QTime qt);
00087     // Update the lineedit text from mTime
00088     void updateText();
00089 
00090 private:
00091     QTime mTime;                   // the widget's displayed time.
00092     //QString mNoTimeString;
00093 };
00094 
00095 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys