kalarm

latecancel.h

00001 /*
00002  *  latecancel.h  -  widget to specify cancellation if late
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 LATECANCEL_H
00022 #define LATECANCEL_H
00023 
00024 #include <qframe.h>
00025 
00026 #include "timeperiod.h"
00027 #include "timeselector.h"
00028 class QBoxLayout;
00029 class QWidgetStack;
00030 class CheckBox;
00031 
00032 
00033 class LateCancelSelector : public QFrame
00034 {
00035         Q_OBJECT
00036     public:
00037         LateCancelSelector(bool allowHourMinute, QWidget* parent, const char* name = 0);
00038         int            minutes() const;
00039         void           setMinutes(int Minutes, bool dateOnly, TimePeriod::Units defaultUnits);
00040         void           setDateOnly(bool dateOnly);
00041         void           showAutoClose(bool show);
00042         bool           isAutoClose() const;
00043         void           setAutoClose(bool autoClose);
00044         bool           isReadOnly() const     { return mReadOnly; }
00045         void           setReadOnly(bool);
00046 
00047         static QString i18n_CancelIfLate();     // plain text of 'Cancel if late' checkbox
00048         static QString i18n_n_CancelIfLate();   // text of 'Cancel if late' checkbox, with 'N' shortcut
00049         static QString i18n_AutoCloseWin();     // plain text of 'Auto-close window after this time' checkbox
00050         static QString i18n_AutoCloseWinLC();   // plain text of 'Auto-close window after late-cancelation time' checkbox
00051         static QString i18n_i_AutoCloseWinLC(); // text of 'Auto-close window after late-cancelation time' checkbox, with 'I' shortcut
00052 
00053     private slots:
00054         void           slotToggled(bool);
00055 
00056     private:
00057         QBoxLayout*    mLayout;            // overall layout for the widget
00058         QWidgetStack*  mStack;             // contains mCheckboxFrame and mTimeSelectorFrame
00059         QFrame*        mCheckboxFrame;
00060         CheckBox*      mCheckbox;          // displayed when late cancellation is not selected
00061         QFrame*        mTimeSelectorFrame;
00062         TimeSelector*  mTimeSelector;      // displayed when late cancellation is selected
00063         CheckBox*      mAutoClose;
00064         bool           mDateOnly;          // hours/minutes units not allowed
00065         bool           mReadOnly;          // widget is read-only
00066         bool           mAutoCloseShown;    // auto-close checkbox is visible
00067 };
00068 
00069 #endif // LATECANCEL_H
KDE Home | KDE Accessibility Home | Description of Access Keys