kalarm

latecancel.h
1 /*
2  * latecancel.h - widget to specify cancellation if late
3  * Program: kalarm
4  * Copyright (C) 2004 by David Jarvie <software@astrojar.org.uk>
5  *
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.
10  *
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.
15  *
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.
19  */
20 
21 #ifndef LATECANCEL_H
22 #define LATECANCEL_H
23 
24 #include <tqframe.h>
25 
26 #include "timeperiod.h"
27 #include "timeselector.h"
28 class TQBoxLayout;
29 class TQWidgetStack;
30 class CheckBox;
31 
32 
33 class LateCancelSelector : public TQFrame
34 {
35  TQ_OBJECT
36 
37  public:
38  LateCancelSelector(bool allowHourMinute, TQWidget* parent, const char* name = 0);
39  int minutes() const;
40  void setMinutes(int Minutes, bool dateOnly, TimePeriod::Units defaultUnits);
41  void setDateOnly(bool dateOnly);
42  void showAutoClose(bool show);
43  bool isAutoClose() const;
44  void setAutoClose(bool autoClose);
45  bool isReadOnly() const { return mReadOnly; }
46  void setReadOnly(bool);
47 
48  static TQString i18n_CancelIfLate(); // plain text of 'Cancel if late' checkbox
49  static TQString i18n_n_CancelIfLate(); // text of 'Cancel if late' checkbox, with 'N' shortcut
50  static TQString i18n_AutoCloseWin(); // plain text of 'Auto-close window after this time' checkbox
51  static TQString i18n_AutoCloseWinLC(); // plain text of 'Auto-close window after late-cancelation time' checkbox
52  static TQString i18n_i_AutoCloseWinLC(); // text of 'Auto-close window after late-cancelation time' checkbox, with 'I' shortcut
53 
54  private slots:
55  void slotToggled(bool);
56 
57  private:
58  TQBoxLayout* mLayout; // overall layout for the widget
59  TQWidgetStack* mStack; // contains mCheckboxFrame and mTimeSelectorFrame
60  TQFrame* mCheckboxFrame;
61  CheckBox* mCheckbox; // displayed when late cancellation is not selected
62  TQFrame* mTimeSelectorFrame;
63  TimeSelector* mTimeSelector; // displayed when late cancellation is selected
64  CheckBox* mAutoClose;
65  bool mDateOnly; // hours/minutes units not allowed
66  bool mReadOnly; // widget is read-only
67  bool mAutoCloseShown; // auto-close checkbox is visible
68 };
69 
70 #endif // LATECANCEL_H