2 * latecancel.h - widget to specify cancellation if late
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.
24 #include "timeperiod.h"
25 #include "timeselector.h"
33 class LateCancelSelector
: public QFrame
37 LateCancelSelector(bool allowHourMinute
, QWidget
* parent
);
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
52 void changed(); // emitted whenever any change occurs
55 void slotToggled(bool);
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
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