24 #ifndef RECURRENCEEDIT_H
25 #define RECURRENCEEDIT_H
28 #include <tqdatetime.h>
29 #include <tqvaluelist.h>
45 class RepetitionButton;
56 class RecurrenceEdit :
public TQFrame
62 enum RepeatType { INVALID_RECUR = -1, NO_RECUR, AT_LOGIN, SUBDAILY, DAILY, WEEKLY, MONTHLY, ANNUAL };
64 RecurrenceEdit(
bool readOnly, TQWidget* parent,
const char* name = 0);
65 virtual ~RecurrenceEdit() { }
68 void setDefaults(
const TQDateTime& from);
70 void set(
const KAEvent&,
bool keepDuration);
72 void updateEvent(
KAEvent&,
bool adjustStart);
73 TQWidget* checkData(
const TQDateTime& startDateTime, TQString& errorMessage)
const;
74 RepeatType repeatType()
const {
return mRuleButtonType; }
75 bool isTimedRepeatType()
const {
return mRuleButtonType >= SUBDAILY; }
76 int subRepeatCount(
int* subRepeatInterval = 0)
const;
77 void setSubRepetition(
int reminderMinutes,
bool dateOnly);
78 void setStartDate(
const TQDate&,
const TQDate& today);
79 void setDefaultEndDate(
const TQDate&);
80 void setEndDateTime(
const DateTime&);
81 DateTime endDateTime()
const;
82 bool stateChanged()
const;
83 void activateSubRepetition();
85 static TQString i18n_Norecur();
86 static TQString i18n_NoRecur();
87 static TQString i18n_AtLogin();
88 static TQString i18n_l_Atlogin();
89 static TQString i18n_HourlyMinutely();
90 static TQString i18n_u_HourlyMinutely();
91 static TQString i18n_Daily();
92 static TQString i18n_d_Daily();
93 static TQString i18n_Weekly();
94 static TQString i18n_w_Weekly();
95 static TQString i18n_Monthly();
96 static TQString i18n_m_Monthly();
97 static TQString i18n_Yearly();
98 static TQString i18n_y_Yearly();
101 void setDateTime(
const TQDateTime& start) { mCurrStartDateTime = start; }
105 void typeChanged(
int recurType);
106 void frequencyChanged();
107 void repeatNeedsInitialisation();
110 virtual void showEvent(TQShowEvent*);
113 void periodClicked(
int);
114 void rangeTypeClicked();
115 void repeatCountChanged(
int value);
116 void slotAnyTimeToggled(
bool);
118 void changeException();
119 void deleteException();
120 void enableExceptionButtons();
123 void setRuleDefaults(
const TQDate& start);
127 TQWidgetStack* mRuleStack;
130 SubDailyRule* mSubDailyRule;
131 DailyRule* mDailyRule;
132 WeeklyRule* mWeeklyRule;
133 MonthlyRule* mMonthlyRule;
134 YearlyRule* mYearlyRule;
136 ButtonGroup* mRuleButtonGroup;
137 RadioButton* mNoneButton;
138 RadioButton* mAtLoginButton;
139 RadioButton* mSubDailyButton;
140 RadioButton* mDailyButton;
141 RadioButton* mWeeklyButton;
142 RadioButton* mMonthlyButton;
143 RadioButton* mYearlyButton;
145 int mAtLoginButtonId;
146 int mSubDailyButtonId;
149 int mMonthlyButtonId;
151 RepeatType mRuleButtonType;
158 ButtonGroup* mRangeButtonGroup;
159 RadioButton* mNoEndDateButton;
160 RadioButton* mRepeatCountButton;
161 SpinBox* mRepeatCountEntry;
162 TQLabel* mRepeatCountLabel;
163 RadioButton* mEndDateButton;
164 DateEdit* mEndDateEdit;
165 TimeEdit* mEndTimeEdit;
166 CheckBox* mEndAnyTimeCheckBox;
169 TQGroupBox* mExceptionGroup;
170 TQListBox* mExceptionDateList;
171 DateEdit* mExceptionDateEdit;
172 TQPushButton* mChangeExceptionButton;
173 TQPushButton* mDeleteExceptionButton;
174 TQValueList<TQDate> mExceptionDates;
177 TQDateTime mCurrStartDateTime;
178 RepetitionButton* mSubRepetition;
179 bool mNoEmitTypeChanged;
183 TQButton* mSavedRuleButton;
184 TQButton* mSavedRangeButton;
185 int mSavedRecurCount;
186 DateTime mSavedEndDateTime;
187 TQValueList<TQDate> mSavedExceptionDates;
188 int mSavedRepeatInterval;
189 int mSavedRepeatCount;
192 #endif // RECURRENCEEDIT_H