-rw-r--r-- | korganizer/kofilterview.h | 118 |
1 files changed, 70 insertions, 48 deletions
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index 060108f..aaf0eb6 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -28,61 +28,15 @@ | |||
28 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
29 | #include <kconfig.h> | 29 | #include <kconfig.h> |
30 | #include "kofilterview_base.h" | 30 | #include "kofilterview_base.h" |
31 | 31 | ||
32 | #include <libkcal/calfilter.h> | 32 | #include <libkcal/calfilter.h> |
33 | 33 | ||
34 | using namespace KCal; | 34 | class QGridLayout; |
35 | |||
36 | class KOFilterView : public KOFilterView_base | ||
37 | { | ||
38 | Q_OBJECT | ||
39 | public: | ||
40 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | ||
41 | ~KOFilterView(); | ||
42 | |||
43 | void updateFilters(); | ||
44 | |||
45 | bool filtersEnabled(); | ||
46 | void setFiltersEnabled(bool); | ||
47 | CalFilter *selectedFilter(); | ||
48 | void setSelectedFilter(QString); | ||
49 | void setSelectedFilter( int ); | ||
50 | |||
51 | signals: | ||
52 | void filterChanged(); | ||
53 | void editFilters(); | ||
54 | |||
55 | private: | ||
56 | QPtrList<CalFilter> *mFilters; | ||
57 | }; | ||
58 | |||
59 | class KOCalEditView : public QWidget | ||
60 | { | ||
61 | Q_OBJECT | ||
62 | public: | ||
63 | KOCalEditView( QWidget* parent=0,const char* name=0); | ||
64 | ~KOCalEditView(); | ||
65 | |||
66 | void readConfig( KConfig *); | ||
67 | public slots: | ||
68 | void addCal(); | ||
69 | void enableAll(); | ||
70 | void enableAlarm(); | ||
71 | void disableRO(); | ||
72 | void deleteAll(); | ||
73 | signals: | ||
74 | void alarmEnabled ( int cal, bool enable ); | ||
75 | void calendarEnabled ( int cal, bool enable ); | ||
76 | void calendarReadonly ( int cal, bool readonly ); | ||
77 | void setCalendarDefault ( int cal ); | ||
78 | void removeCalendar ( int cal ); | ||
79 | |||
80 | private: | ||
81 | }; | ||
82 | 35 | ||
36 | using namespace KCal; | ||
83 | class KOCalButton : public QPushButton | 37 | class KOCalButton : public QPushButton |
84 | { | 38 | { |
85 | Q_OBJECT | 39 | Q_OBJECT |
86 | public: | 40 | public: |
87 | KOCalButton( QWidget *parent=0, const char *name=0 ) : | 41 | KOCalButton( QWidget *parent=0, const char *name=0 ) : |
88 | QPushButton( parent, name) | 42 | QPushButton( parent, name) |
@@ -111,12 +65,14 @@ class KOCalCheckButton : public QCheckBox | |||
111 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : | 65 | KOCalCheckButton( QWidget *parent=0, const char *name=0 ) : |
112 | QCheckBox( parent, name) | 66 | QCheckBox( parent, name) |
113 | { | 67 | { |
114 | connect( this, SIGNAL( toggled ( bool ) ), | 68 | connect( this, SIGNAL( toggled ( bool ) ), |
115 | SLOT( bottonClicked( bool ) )); | 69 | SLOT( bottonClicked( bool ) )); |
116 | mNumber = -1; | 70 | mNumber = -1; |
71 | //setMaximumWidth( 10 ); | ||
72 | |||
117 | } | 73 | } |
118 | void setNum ( int num ) {mNumber = num; } | 74 | void setNum ( int num ) {mNumber = num; } |
119 | signals: | 75 | signals: |
120 | void selectNum ( int, bool ); | 76 | void selectNum ( int, bool ); |
121 | private: | 77 | private: |
122 | int mNumber; | 78 | int mNumber; |
@@ -127,7 +83,73 @@ private: | |||
127 | 83 | ||
128 | private slots : | 84 | private slots : |
129 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 85 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
130 | }; | 86 | }; |
131 | 87 | ||
132 | 88 | ||
89 | |||
90 | class KOFilterView : public KOFilterView_base | ||
91 | { | ||
92 | Q_OBJECT | ||
93 | public: | ||
94 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | ||
95 | ~KOFilterView(); | ||
96 | |||
97 | void updateFilters(); | ||
98 | |||
99 | bool filtersEnabled(); | ||
100 | void setFiltersEnabled(bool); | ||
101 | CalFilter *selectedFilter(); | ||
102 | void setSelectedFilter(QString); | ||
103 | void setSelectedFilter( int ); | ||
104 | |||
105 | signals: | ||
106 | void filterChanged(); | ||
107 | void editFilters(); | ||
108 | |||
109 | private: | ||
110 | QPtrList<CalFilter> *mFilters; | ||
111 | }; | ||
112 | |||
113 | class KOCalEditView : public QWidget | ||
114 | { | ||
115 | Q_OBJECT | ||
116 | public: | ||
117 | KOCalEditView( QWidget* parent=0,const char* name=0); | ||
118 | ~KOCalEditView(); | ||
119 | |||
120 | void readConfig(); | ||
121 | public slots: | ||
122 | void addCal(); | ||
123 | void enableAll(); | ||
124 | void enableAlarm(); | ||
125 | void disableRO(); | ||
126 | void deleteAll(); | ||
127 | void selectStdCal(int,bool ); | ||
128 | void selectCal(int,bool ); | ||
129 | void selectCalAlarm(int,bool ); | ||
130 | void selectReadOnly(int,bool ); | ||
131 | void setColor(const QColor &,int) ; | ||
132 | void deleteCal(int) ; | ||
133 | void infoCal(int) ; | ||
134 | signals: | ||
135 | void alarmEnabled ( int cal, bool enable ); | ||
136 | void calendarEnabled ( int cal, bool enable ); | ||
137 | void calendarReadonly ( int cal, bool readonly ); | ||
138 | void setCalendarDefault ( int cal ); | ||
139 | void removeCalendar ( int cal ); | ||
140 | void calendarAdded( int ); | ||
141 | |||
142 | private: | ||
143 | QVBoxLayout* ml; | ||
144 | QWidget *mw; | ||
145 | void toggleList ( QPtrList<KOCalCheckButton> ); | ||
146 | QPtrList<KOCalCheckButton> mStdandardB; | ||
147 | QPtrList<KOCalCheckButton> mEnabledB; | ||
148 | QPtrList<KOCalCheckButton> mAlarmB; | ||
149 | QPtrList<KOCalCheckButton> mROB; | ||
150 | QGridLayout* mainLayout; | ||
151 | }; | ||
152 | |||
153 | |||
154 | |||
133 | #endif // KOFILTERVIEW_H | 155 | #endif // KOFILTERVIEW_H |