summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ui/opimrecurrencewidget.h
authordrw <drw>2004-02-25 16:28:34 (UTC)
committer drw <drw>2004-02-25 16:28:34 (UTC)
commitf84a46fce6c1b7702ec1eaebd40e363b67253649 (patch) (side-by-side diff)
tree8ce368593373f66cd3e5b090ee222a7cc7835739 /libopie2/opiepim/ui/opimrecurrencewidget.h
parent25e87d9ccc92b7a4c12518532576f55b11726b26 (diff)
downloadopie-f84a46fce6c1b7702ec1eaebd40e363b67253649.zip
opie-f84a46fce6c1b7702ec1eaebd40e363b67253649.tar.gz
opie-f84a46fce6c1b7702ec1eaebd40e363b67253649.tar.bz2
Added OPimRecurrenceBase & OPimRecurrenceWidget to libopiepim2
Diffstat (limited to 'libopie2/opiepim/ui/opimrecurrencewidget.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/ui/opimrecurrencewidget.h93
1 files changed, 93 insertions, 0 deletions
diff --git a/libopie2/opiepim/ui/opimrecurrencewidget.h b/libopie2/opiepim/ui/opimrecurrencewidget.h
new file mode 100644
index 0000000..3f28565
--- a/dev/null
+++ b/libopie2/opiepim/ui/opimrecurrencewidget.h
@@ -0,0 +1,93 @@
+/*
+ * GPL and based on the widget from TT
+ */
+
+#ifndef OPIE_PIM_RECURRENCE_WIDGET_H
+#define OPIE_PIM_RECURRENCE_WIDGET_H
+
+#include <opie2/opimrecurrence.h>
+
+#include <qpe/datebookmonth.h>
+
+#include <qlist.h>
+#include <qtoolbutton.h>
+#include <qcheckbox.h>
+#include <qdatetime.h>
+#include <qbuttongroup.h>
+
+#include "opimrecurrencebase.h"
+
+using namespace Opie;
+
+/**
+ * A widget to let the user select rules for recurrences.
+ * This widget can take care of weekly, monthly, daily and yearly recurrence
+ * It is used inside todolist and datebook.
+ *
+ *
+ * @short Widget of selecting Recurrance
+ * @author Trolltech, Holger Freyther
+ * @version 0.9
+ */
+class OPimRecurrenceWidget : public OPimRecurrenceBase {
+ Q_OBJECT
+public:
+ OPimRecurrenceWidget( bool startOnMonday,
+ const QDate& start, QWidget* parent = 0,
+ const char* name = 0, bool modal = TRUE,
+ WFlags fl = 0 );
+ OPimRecurrenceWidget( bool startOnMonday,
+ const OPimRecurrence& rp, const QDate& start,
+ QWidget* parent = 0, const char* name =0,
+ bool modal = TRUE, WFlags = 0 );
+ ~OPimRecurrenceWidget();
+ OPimRecurrence recurrence()const;
+ QDate endDate()const;
+
+public slots:
+ void slotSetRType( int );
+ /**
+ * set the new end date
+ */
+ void endDateChanged( int, int, int );
+ /**
+ * enable/disable end date
+ */
+ void slotNoEnd( bool unused );
+ void setStartDate( const QDate& );
+ void setRecurrence( const OPimRecurrence& recur, const QDate& start );
+ void setRecurrence( const OPimRecurrence& recur );
+
+private slots:
+ void setupRepeatLabel( const QString& );
+ void setupRepeatLabel( int );
+ void slotWeekLabel();
+ void slotMonthLabel( int );
+ void slotChangeStartOfWeek( bool onMonday );
+
+private:
+ void setupNone();
+ void setupDaily();
+ void setupWeekly();
+ void setupMonthly();
+ void setupYearly();
+
+ enum repeatButtons { None, Day, Week, Month, Year };
+ void init();
+ void hideExtras();
+ void showRepeatStuff();
+
+ QList<QToolButton> listRTypeButtons;
+ QList<QToolButton> listExtra;
+ QDate start; // only used in one spot...
+ QDate end;
+ repeatButtons currInterval;
+ bool startWeekOnMonday : 1;
+ DateBookMonth *repeatPicker;
+
+ class Private;
+ Private *d;
+
+};
+
+#endif