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();
84 bool validateDate(
const DateTime &date)
const;
86 static TQString i18n_Norecur();
87 static TQString i18n_NoRecur();
88 static TQString i18n_AtLogin();
89 static TQString i18n_l_Atlogin();
90 static TQString i18n_HourlyMinutely();
91 static TQString i18n_u_HourlyMinutely();
92 static TQString i18n_Daily();
93 static TQString i18n_d_Daily();
94 static TQString i18n_Weekly();
95 static TQString i18n_w_Weekly();
96 static TQString i18n_Monthly();
97 static TQString i18n_m_Monthly();
98 static TQString i18n_Yearly();
99 static TQString i18n_y_Yearly();
102 void setDateTime(
const TQDateTime& start) { mCurrStartDateTime = start; }
106 void typeChanged(
int recurType);
107 void frequencyChanged();
108 void repeatNeedsInitialisation();
111 virtual void showEvent(TQShowEvent*);
114 void periodClicked(
int);
115 void rangeTypeClicked();
116 void repeatCountChanged(
int value);
117 void slotAnyTimeToggled(
bool);
119 void changeException();
120 void deleteException();
121 void enableExceptionButtons();
124 void setRuleDefaults(
const TQDate& start);
128 TQWidgetStack* mRuleStack;
131 SubDailyRule* mSubDailyRule;
132 DailyRule* mDailyRule;
133 WeeklyRule* mWeeklyRule;
134 MonthlyRule* mMonthlyRule;
135 YearlyRule* mYearlyRule;
137 ButtonGroup* mRuleButtonGroup;
138 RadioButton* mNoneButton;
139 RadioButton* mAtLoginButton;
140 RadioButton* mSubDailyButton;
141 RadioButton* mDailyButton;
142 RadioButton* mWeeklyButton;
143 RadioButton* mMonthlyButton;
144 RadioButton* mYearlyButton;
146 int mAtLoginButtonId;
147 int mSubDailyButtonId;
150 int mMonthlyButtonId;
152 RepeatType mRuleButtonType;
159 ButtonGroup* mRangeButtonGroup;
160 RadioButton* mNoEndDateButton;
161 RadioButton* mRepeatCountButton;
162 SpinBox* mRepeatCountEntry;
163 TQLabel* mRepeatCountLabel;
164 RadioButton* mEndDateButton;
165 DateEdit* mEndDateEdit;
166 TimeEdit* mEndTimeEdit;
167 CheckBox* mEndAnyTimeCheckBox;
170 TQGroupBox* mExceptionGroup;
171 TQListBox* mExceptionDateList;
172 DateEdit* mExceptionDateEdit;
173 TQPushButton* mChangeExceptionButton;
174 TQPushButton* mDeleteExceptionButton;
175 TQValueList<TQDate> mExceptionDates;
178 TQDateTime mCurrStartDateTime;
179 RepetitionButton* mSubRepetition;
180 bool mNoEmitTypeChanged;
184 TQButton* mSavedRuleButton;
185 TQButton* mSavedRangeButton;
186 int mSavedRecurCount;
187 DateTime mSavedEndDateTime;
188 TQValueList<TQDate> mSavedExceptionDates;
189 int mSavedRepeatInterval;
190 int mSavedRepeatCount;
KAEvent corresponds to a KCal::Event instance.