00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef REPETITION_H
00022 #define REPETITION_H
00023
00024 #include <tqpushbutton.h>
00025 #include <kdialogbase.h>
00026
00027 class ButtonGroup;
00028 class RadioButton;
00029 class SpinBox;
00030 class TimeSelector;
00031 class TimePeriod;
00032 class RepetitionDlg;
00033
00034
00035 class RepetitionButton : public TQPushButton
00036 {
00037 Q_OBJECT
00038 TQ_OBJECT
00039 public:
00040 RepetitionButton(const TQString& caption, bool waitForInitialisation, TQWidget* parent, const char* name = 0);
00041 void set(int interval, int count);
00042 void set(int interval, int count, bool dateOnly, int maxDuration = -1);
00043 void initialise(int interval, int count, bool dateOnly, int maxDuration = -1);
00044 void activate() { activate(false); }
00045 int interval() const { return mInterval; }
00046 int count() const { return mCount; }
00047 virtual void setReadOnly(bool ro) { mReadOnly = ro; }
00048 virtual bool isReadOnly() const { return mReadOnly; }
00049
00050 signals:
00051 void needsInitialisation();
00052 void changed();
00053
00054 private slots:
00055 void slotPressed() { activate(mWaitForInit); }
00056
00057 private:
00058 void activate(bool waitForInitialisation);
00059 void displayDialog();
00060
00061 RepetitionDlg* mDialog;
00062 int mInterval;
00063 int mCount;
00064 int mMaxDuration;
00065 bool mDateOnly;
00066 bool mWaitForInit;
00067 bool mReadOnly;
00068 };
00069
00070
00071 class RepetitionDlg : public KDialogBase
00072 {
00073 Q_OBJECT
00074 TQ_OBJECT
00075 public:
00076 RepetitionDlg(const TQString& caption, bool readOnly, TQWidget* parent = 0, const char* name = 0);
00077 void setReadOnly(bool);
00078 void set(int interval, int count, bool dateOnly = false, int maxDuration = -1);
00079 int interval() const;
00080 int count() const;
00081
00082 private slots:
00083 void typeClicked();
00084 void intervalChanged(int);
00085 void countChanged(int);
00086 void durationChanged(int);
00087 void repetitionToggled(bool);
00088
00089 private:
00090 TimeSelector* mTimeSelector;
00091 ButtonGroup* mButtonGroup;
00092 RadioButton* mCountButton;
00093 SpinBox* mCount;
00094 RadioButton* mDurationButton;
00095 TimePeriod* mDuration;
00096 int mMaxDuration;
00097 bool mDateOnly;
00098 bool mReadOnly;
00099 };
00100
00101 #endif // REPETITION_H