kalarm

timeselector.h

00001 /*
00002  *  timeselector.h  -  widget to optionally set a time period
00003  *  Program:  kalarm
00004  *  Copyright (C) 2004 by David Jarvie <software@astrojar.org.uk>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef TIMESELECTOR_H
00022 #define TIMESELECTOR_H
00023 
00024 #include <qframe.h>
00025 #include "timeperiod.h"
00026 
00027 class QLabel;
00028 class CheckBox;
00029 
00030 
00031 class TimeSelector : public QFrame
00032 {
00033         Q_OBJECT
00034     public:
00035         TimeSelector(const QString& selectText, const QString& postfix, const QString& selectWhatsThis,
00036                      const QString& valueWhatsThis, bool allowHourMinute, QWidget* parent, const char* name = 0);
00037         bool         isChecked() const;
00038         void         setChecked(bool on);
00039         int          minutes() const;
00040         void         setMinutes(int minutes, bool dateOnly, TimePeriod::Units defaultUnits);
00041         void         setReadOnly(bool);
00042         void         setDateOnly(bool dateOnly = true);
00043         void         setMaximum(int hourmin, int days);
00044         void         setFocusOnCount();
00045 
00046     signals:
00047         void         toggled(bool);             // selection checkbox has been toggled
00048         void         valueChanged(int minutes); // value has changed
00049 
00050     protected slots:
00051         void         selectToggled(bool);
00052         void         periodChanged(int minutes);
00053 
00054     private:
00055         CheckBox*    mSelect;
00056         TimePeriod*  mPeriod;
00057         QLabel*      mLabel;
00058         bool         mReadOnly;           // the widget is read only
00059 };
00060 
00061 #endif // TIMESELECTOR_H
KDE Home | KDE Accessibility Home | Description of Access Keys