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
00028
00029
00030
00031 #ifndef REPEATENTRY_H
00032 #define REPEATENTRY_H
00033
00034 #include "repeatentrybase.h"
00035
00036 #include <qpe/event.h>
00037
00038 #include <qcheckbox.h>
00039 #include <qbuttongroup.h>
00040 #include <qdatetime.h>
00041 #include <qlist.h>
00042 #include <qtoolbutton.h>
00043
00044 class DateBookMonth;
00045
00046 class RepeatEntry : public RepeatEntryBase
00047 {
00048 Q_OBJECT
00049 public:
00050 RepeatEntry( bool startOnMonday,
00051 const QDate &start, QWidget *parent = 0, const char *name = 0,
00052 bool modal = TRUE, WFlags fl = 0 );
00053 RepeatEntry( bool startOnMonday,
00054 const Event::RepeatPattern &rp, const QDate &start,
00055 QWidget *parent = 0, const char *name = 0, bool modal = TRUE,
00056 WFlags fl = 0 );
00057 ~RepeatEntry();
00058
00059 Event::RepeatPattern repeatPattern();
00060 QDate endDate() { return end; };
00061
00062 public slots:
00063 void slotSetRType( int );
00064 void endDateChanged( int, int, int );
00065 void slotNoEnd( bool unused );
00066
00067 private slots:
00068 void setupRepeatLabel( const QString& );
00069 void setupRepeatLabel( int );
00070 void slotWeekLabel();
00071 void slotMonthLabel( int );
00072 void slotChangeStartOfWeek( bool onMonday );
00073
00074 private:
00075 void setupNone();
00076 void setupDaily();
00077 void setupWeekly();
00078 void setupMonthly();
00079 void setupYearly();
00080
00081 enum repeatButtons { NONE, DAY, WEEK, MONTH, YEAR };
00082 void init();
00083 inline void hideExtras();
00084 void showRepeatStuff();
00085
00086 QList<QToolButton> listRTypeButtons;
00087 QList<QToolButton> listExtra;
00088 QDate start;
00089 QDate end;
00090 repeatButtons currInterval;
00091 bool startWeekOnMonday;
00092 DateBookMonth *repeatPicker;
00093 };
00094
00095 inline void RepeatEntry::hideExtras()
00096 {
00097
00098 fraExtra->hide();
00099 chkNoEnd->hide();
00100 QListIterator<QToolButton> it( listExtra );
00101 for ( ; *it; ++it ) {
00102 (*it)->hide();
00103 (*it)->setOn( FALSE );
00104 }
00105
00106 }
00107
00108 #endif