21 #ifndef RECURRENCEEDITPRIVATE_H
22 #define RECURRENCEEDITPRIVATE_H
25 #include <tqvaluelist.h>
26 #include <tqbitarray.h>
39 class NoRule : public TQFrame
42 NoRule(TQWidget* parent, const char* name = 0) : TQFrame(parent, name)
43 { setFrameStyle(TQFrame::NoFrame); }
44 virtual int frequency() const { return 0; }
47 class Rule : public NoRule
52 Rule( const TQString& freqText, const TQString& freqWhatsThis, bool time, bool readOnly,
53 TQWidget* parent, const char* name = 0);
54 int frequency() const;
55 void setFrequency( int);
56 virtual void setFrequencyFocus() { mSpinBox->setFocus(); }
57 TQVBoxLayout* layout() const { return mLayout; }
58 virtual TQWidget* validate(TQString&) { return 0; }
59 virtual void saveState();
60 virtual bool stateChanged() const;
62 void frequencyChanged();
66 TimeSpinBox* mTimeSpinBox;
67 TQVBoxLayout* mLayout;
73 class SubDailyRule : public Rule
78 SubDailyRule( bool readOnly, TQWidget* parent, const char* name = 0);
82 class DayWeekRule : public Rule
87 DayWeekRule( const TQString& freqText, const TQString& freqWhatsThis, const TQString& daysWhatsThis,
88 bool readOnly, TQWidget* parent, const char* name = 0);
89 TQBitArray days() const;
91 void setDays( const TQBitArray& days);
92 void setDay( int dayOfWeek);
93 virtual TQWidget* validate(TQString& errorMessage);
94 virtual void saveState();
95 virtual bool stateChanged() const;
99 TQBitArray mSavedDays;
103 class DailyRule : public DayWeekRule
106 DailyRule( bool readOnly, TQWidget* parent, const char* name = 0);
110 class WeeklyRule : public DayWeekRule
113 WeeklyRule( bool readOnly, TQWidget* parent, const char* name = 0);
117 class MonthYearRule : public Rule
122 enum DayPosType { DATE, POS };
124 MonthYearRule( const TQString& freqText, const TQString& freqWhatsThis, bool allowEveryWeek,
125 bool readOnly, TQWidget* parent, const char* name = 0);
126 DayPosType type() const;
129 int dayOfWeek() const;
130 void setType(DayPosType);
131 void setDate( int dayOfMonth);
132 void setPosition( int week, int dayOfWeek);
133 void setDefaultValues( int dayOfMonth, int dayOfWeek);
134 virtual void saveState();
135 virtual bool stateChanged() const;
137 void typeChanged(DayPosType);
139 DayPosType buttonType( int id) const { return id == mDayButtonId ? DATE : POS; }
140 virtual void daySelected( int ) { }
142 virtual void clicked( int id);
144 virtual void slotDaySelected( int index);
146 void enableSelection(DayPosType);
148 ButtonGroup* mButtonGroup;
149 RadioButton* mDayButton;
150 RadioButton* mPosButton;
152 ComboBox* mWeekCombo;
153 ComboBox* mDayOfWeekCombo;
165 class MonthlyRule : public MonthYearRule
168 MonthlyRule( bool readOnly, TQWidget* parent, const char* name = 0);
172 class YearlyRule : public MonthYearRule
177 YearlyRule( bool readOnly, TQWidget* parent, const char* name = 0);
178 TQValueList<int> months() const;
179 void setMonths( const TQValueList<int>& months);
180 void setDefaultValues( int dayOfMonth, int dayOfWeek, int month);
181 KARecurrence::Feb29Type feb29Type() const;
182 void setFeb29Type(KARecurrence::Feb29Type);
183 virtual TQWidget* validate(TQString& errorMessage);
184 virtual void saveState();
185 virtual bool stateChanged() const;
187 virtual void daySelected( int day);
189 virtual void clicked( int id);
193 CheckBox* mMonthBox[12];
194 TQLabel* mFeb29Label;
195 ComboBox* mFeb29Combo;
197 TQValueList<int> mSavedMonths;
|