summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ui/opimrecurrencewidget.h
Unidiff
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 @@
1/*
2 * GPL and based on the widget from TT
3 */
4
5#ifndef OPIE_PIM_RECURRENCE_WIDGET_H
6#define OPIE_PIM_RECURRENCE_WIDGET_H
7
8#include <opie2/opimrecurrence.h>
9
10#include <qpe/datebookmonth.h>
11
12#include <qlist.h>
13#include <qtoolbutton.h>
14#include <qcheckbox.h>
15#include <qdatetime.h>
16#include <qbuttongroup.h>
17
18#include "opimrecurrencebase.h"
19
20using namespace Opie;
21
22/**
23 * A widget to let the user select rules for recurrences.
24 * This widget can take care of weekly, monthly, daily and yearly recurrence
25 * It is used inside todolist and datebook.
26 *
27 *
28 * @short Widget of selecting Recurrance
29 * @author Trolltech, Holger Freyther
30 * @version 0.9
31 */
32class OPimRecurrenceWidget : public OPimRecurrenceBase {
33 Q_OBJECT
34public:
35 OPimRecurrenceWidget( bool startOnMonday,
36 const QDate& start, QWidget* parent = 0,
37 const char* name = 0, bool modal = TRUE,
38 WFlags fl = 0 );
39 OPimRecurrenceWidget( bool startOnMonday,
40 const OPimRecurrence& rp, const QDate& start,
41 QWidget* parent = 0, const char* name =0,
42 bool modal = TRUE, WFlags = 0 );
43 ~OPimRecurrenceWidget();
44 OPimRecurrence recurrence()const;
45 QDate endDate()const;
46
47public slots:
48 void slotSetRType( int );
49 /**
50 * set the new end date
51 */
52 void endDateChanged( int, int, int );
53 /**
54 * enable/disable end date
55 */
56 void slotNoEnd( bool unused );
57 void setStartDate( const QDate& );
58 void setRecurrence( const OPimRecurrence& recur, const QDate& start );
59 void setRecurrence( const OPimRecurrence& recur );
60
61private slots:
62 void setupRepeatLabel( const QString& );
63 void setupRepeatLabel( int );
64 void slotWeekLabel();
65 void slotMonthLabel( int );
66 void slotChangeStartOfWeek( bool onMonday );
67
68private:
69 void setupNone();
70 void setupDaily();
71 void setupWeekly();
72 void setupMonthly();
73 void setupYearly();
74
75 enum repeatButtons { None, Day, Week, Month, Year };
76 void init();
77 void hideExtras();
78 void showRepeatStuff();
79
80 QList<QToolButton> listRTypeButtons;
81 QList<QToolButton> listExtra;
82 QDate start; // only used in one spot...
83 QDate end;
84 repeatButtons currInterval;
85 bool startWeekOnMonday : 1;
86 DateBookMonth *repeatPicker;
87
88 class Private;
89 Private *d;
90
91};
92
93#endif