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