recurrenceedit.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef RECURRENCEEDIT_H
00028 #define RECURRENCEEDIT_H
00029
00030 #include <qradiobutton.h>
00031 #include <qbuttongroup.h>
00032 #include <libkcal/event.h>
00033
00034 class QWidgetStack;
00035 class QLabel;
00036 class QSpinBox;
00037 class QComboBox;
00038 class QCheckBox;
00039 class DateEdit;
00040 class TimeSpinBox;
00041 class ButtonGroup;
00042 class KAlarmEvent;
00043
00044 using namespace KCal;
00045
00046
00047 class RecurrenceEdit : public QFrame
00048 {
00049 Q_OBJECT
00050 public:
00051 enum RepeatType { SUBDAILY, DAILY, WEEKLY, MONTHLY, ANNUAL };
00052
00053 RecurrenceEdit(QWidget* parent, const char* name = 0L);
00054 virtual ~RecurrenceEdit() { }
00055
00057 void setDefaults(const QDateTime& from);
00059 void set(const KAlarmEvent&);
00061 void updateEvent(KAlarmEvent&);
00062 QWidget* checkData(const QDateTime& startDateTime, bool& noTime) const;
00063 RepeatType repeatType() const { return ruleButtonType; }
00064 void setStartDate(const QDate&);
00065 void setEndDate(const QDate&);
00066
00067 public slots:
00068 void setDateTime(const QDateTime& start) { currStartDateTime = start; }
00069
00070 signals:
00071 void shown();
00072 void typeChanged(int recurType);
00073
00074 protected slots:
00075 void periodClicked(int);
00076 void monthlyClicked(int);
00077 void yearlyClicked(int);
00078 void disableRange(bool);
00079 void enableDurationRange(bool);
00080 void enableDateRange(bool);
00081
00082 protected:
00083 virtual void showEvent(QShowEvent*);
00084
00085 private:
00086 void unsetAllCheckboxes();
00087 void checkDay(int day);
00088 void getCheckedDays(QBitArray& rDays);
00089 void setCheckedDays(QBitArray& rDays);
00090
00091 void initNone();
00092 void initSubdaily();
00093 void initDaily();
00094 void initWeekly();
00095 void initMonthly();
00096 void initYearly();
00097
00098
00099 QGroupBox* recurGroup;
00100 QFrame* ruleFrame;
00101 QWidgetStack* ruleStack;
00102
00103 ButtonGroup* ruleButtonGroup;
00104 QLabel* recurEveryLabel;
00105 QRadioButton* subdailyButton;
00106 QRadioButton* dailyButton;
00107 QRadioButton* weeklyButton;
00108 QRadioButton* monthlyButton;
00109 QRadioButton* yearlyButton;
00110 int subdailyButtonId;
00111 int dailyButtonId;
00112 int weeklyButtonId;
00113 int monthlyButtonId;
00114 int yearlyButtonId;
00115 RepeatType ruleButtonType;
00116
00117 QWidgetStack* recurFrequencyStack;
00118 QSpinBox* recurFrequency;
00119 TimeSpinBox* recurHourMinFrequency;
00120
00121
00122 QFrame* noneFrame;
00123
00124
00125 QFrame* weeklyFrame;
00126 QCheckBox* dayBox[7];
00127
00128
00129 QFrame* monthlyFrame;
00130 ButtonGroup* monthlyButtonGroup;
00131 QRadioButton* onNthDayButton;
00132 QComboBox* nthDayEntry;
00133 QRadioButton* onNthTypeOfDayButton;
00134 QComboBox* nthNumberEntry;
00135 QComboBox* nthTypeOfDayEntry;
00136 int onNthDayButtonId;
00137 int onNthTypeOfDayButtonId;
00138
00139
00140 QFrame* yearlyFrame;
00141 ButtonGroup* yearlyButtonGroup;
00142 QRadioButton* mYearRuleFeb29Button;
00143 QRadioButton* yearMonthButton;
00144
00145 QRadioButton* yearlyOnNthTypeOfDayButton;
00146
00147 QComboBox* yearlyNthNumberEntry;
00148 QComboBox* yearlyNthTypeOfDayEntry;
00149 QComboBox* yeardayMonthComboBox;
00150 int mYearRuleFeb29ButtonId;
00151 int yearMonthButtonId;
00152
00153 int yearlyOnNthTypeOfDayButtonId;
00154
00155
00156 QButtonGroup* rangeButtonGroup;
00157 QRadioButton* noEndDateButton;
00158 QRadioButton* repeatCountButton;
00159 QSpinBox* repeatCountEntry;
00160 QLabel* repeatCountLabel;
00161 QRadioButton* endDateButton;
00162 DateEdit* endDateEdit;
00163 TimeSpinBox* endTimeEdit;
00164
00165
00166 QDateTime currStartDateTime;
00167 bool noEmitTypeChanged;
00168 };
00169
00170 #endif // RECURRENCEEDIT_H
This file is part of the documentation for kdelibs Version 3.1.4.