Fix dnd email
[kdepim.git] / kalarm / latecancel.h
blobb4829d81a8fd76b4e5a01617a8fd666eeb6b5e78
1 /*
2 * latecancel.h - widget to specify cancellation if late
3 * Program: kalarm
4 * Copyright © 2004,2005,2007,2009 by David Jarvie <djarvie@kde.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef LATECANCEL_H
22 #define LATECANCEL_H
24 #include "timeperiod.h"
25 #include "timeselector.h"
27 #include <QFrame>
29 class QStackedWidget;
30 class CheckBox;
33 class LateCancelSelector : public QFrame
35 Q_OBJECT
36 public:
37 LateCancelSelector(bool allowHourMinute, QWidget* parent);
38 int minutes() const;
39 void setMinutes(int Minutes, bool dateOnly, TimePeriod::Units defaultUnits);
40 void setDateOnly(bool dateOnly);
41 void showAutoClose(bool show);
42 bool isAutoClose() const;
43 void setAutoClose(bool autoClose);
44 bool isReadOnly() const { return mReadOnly; }
45 void setReadOnly(bool);
47 static QString i18n_chk_CancelIfLate(); // text of 'Cancel if late' checkbox
48 static QString i18n_chk_AutoCloseWin(); // text of 'Auto-close window after this time' checkbox
49 static QString i18n_chk_AutoCloseWinLC(); // text of 'Auto-close window after late-cancellation time' checkbox
51 Q_SIGNALS:
52 void changed(); // emitted whenever any change occurs
54 private Q_SLOTS:
55 void slotToggled(bool);
57 private:
58 QStackedWidget* mStack; // contains mCheckboxFrame and mTimeSelectorFrame
59 QFrame* mCheckboxFrame;
60 CheckBox* mCheckbox; // displayed when late cancellation is not selected
61 QFrame* mTimeSelectorFrame;
62 TimeSelector* mTimeSelector; // displayed when late cancellation is selected
63 CheckBox* mAutoClose;
64 bool mDateOnly; // hours/minutes units not allowed
65 bool mReadOnly; // widget is read-only
66 bool mAutoCloseShown; // auto-close checkbox is visible
69 #endif // LATECANCEL_H
71 // vim: et sw=4: