summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.h
Unidiff
Diffstat (limited to 'korganizer/kotodoview.h') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.h58
1 files changed, 34 insertions, 24 deletions
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 0cbc087..a9e7f30 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -17,33 +17,43 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOTODOVIEW_H 23#ifndef KOTODOVIEW_H
24#define KOTODOVIEW_H 24#define KOTODOVIEW_H
25 25
26#include <qfont.h> 26#include <qfont.h>
27#include <qfontmetrics.h> 27#include <qfontmetrics.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qptrlist.h> 29#include <q3ptrlist.h>
30#include <qstrlist.h> 30#include <q3strlist.h>
31#include <qlistbox.h> 31#include <q3listbox.h>
32#include <qpopupmenu.h> 32#include <q3popupmenu.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qmap.h> 34#include <qmap.h>
35#include <qdialog.h> 35#include <qdialog.h>
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qlistview.h> 37#include <q3listview.h>
38//Added by qt3to4:
39#include <QDragMoveEvent>
40#include <QDropEvent>
41#include <QDragLeaveEvent>
42#include <QWheelEvent>
43#include <QPaintEvent>
44#include <QFocusEvent>
45#include <QMouseEvent>
46#include <QKeyEvent>
47#include <QDragEnterEvent>
38#include <klistview.h> 48#include <klistview.h>
39 49
40#include <libkcal/calendar.h> 50#include <libkcal/calendar.h>
41#include <libkcal/todo.h> 51#include <libkcal/todo.h>
42 52
43#include <korganizer/baseview.h> 53#include <korganizer/baseview.h>
44 54
45#include "kotodoviewitem.h" 55#include "kotodoviewitem.h"
46#include "koprefs.h" 56#include "koprefs.h"
47#include "koglobals.h" 57#include "koglobals.h"
48#include "datenavigator.h" 58#include "datenavigator.h"
49 59
@@ -92,48 +102,48 @@ private:
92}; 102};
93 103
94class KOTodoListView : public KListView 104class KOTodoListView : public KListView
95{ 105{
96 Q_OBJECT 106 Q_OBJECT
97 public: 107 public:
98 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 108 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
99 virtual ~KOTodoListView() {} 109 virtual ~KOTodoListView() {}
100 110
101 signals: 111 signals:
102 void paintNeeded(); 112 void paintNeeded();
103 void todoDropped(Todo *, int); 113 void todoDropped(Todo *, int);
104 void double_Clicked(QListViewItem *item); 114 void double_Clicked(Q3ListViewItem *item);
105 void reparentTodoSignal( Todo *,Todo * ); 115 void reparentTodoSignal( Todo *,Todo * );
106 void unparentTodoSignal(Todo *); 116 void unparentTodoSignal(Todo *);
107 void deleteTodo( Todo * ); 117 void deleteTodo( Todo * );
108 protected: 118 protected:
109 void wheelEvent (QWheelEvent *e); 119 void wheelEvent (QWheelEvent *e);
110 void contentsDragEnterEvent(QDragEnterEvent *); 120 void contentsDragEnterEvent(QDragEnterEvent *);
111 void contentsDragMoveEvent(QDragMoveEvent *); 121 void contentsDragMoveEvent(QDragMoveEvent *);
112 void contentsDragLeaveEvent(QDragLeaveEvent *); 122 void contentsDragLeaveEvent(QDragLeaveEvent *);
113 void contentsDropEvent(QDropEvent *); 123 void contentsDropEvent(QDropEvent *);
114 124
115 void contentsMousePressEvent(QMouseEvent *); 125 void contentsMousePressEvent(QMouseEvent *);
116 void contentsMouseMoveEvent(QMouseEvent *); 126 void contentsMouseMoveEvent(QMouseEvent *);
117 void contentsMouseReleaseEvent(QMouseEvent *); 127 void contentsMouseReleaseEvent(QMouseEvent *);
118 void contentsMouseDoubleClickEvent(QMouseEvent *); 128 void contentsMouseDoubleClickEvent(QMouseEvent *);
119 129
120 private: 130 private:
121 void paintEvent(QPaintEvent * pevent); 131 void paintEvent(QPaintEvent * pevent);
122 bool internalDrop; 132 bool internalDrop;
123 QString mName; 133 QString mName;
124 Calendar *mCalendar; 134 Calendar *mCalendar;
125 QPoint mPressPos; 135 QPoint mPressPos;
126 bool mMousePressed; 136 bool mMousePressed;
127 QListViewItem *mOldCurrent; 137 Q3ListViewItem *mOldCurrent;
128 bool mFlagKeyPressed; 138 bool mFlagKeyPressed;
129 void keyPressEvent ( QKeyEvent * ) ; 139 void keyPressEvent ( QKeyEvent * ) ;
130 void keyReleaseEvent ( QKeyEvent * ) ; 140 void keyReleaseEvent ( QKeyEvent * ) ;
131}; 141};
132 142
133 143
134/** 144/**
135 This is the line-edit on top of the todoview for fast addition of new todos 145 This is the line-edit on top of the todoview for fast addition of new todos
136*/ 146*/
137class KOQuickTodo : public QLineEdit 147class KOQuickTodo : public QLineEdit
138{ 148{
139 public: 149 public:
@@ -148,26 +158,26 @@ class KOQuickTodo : public QLineEdit
148 This class provides a multi-column list view of todo events. 158 This class provides a multi-column list view of todo events.
149 159
150 @short multi-column list view of todo events. 160 @short multi-column list view of todo events.
151 @author Cornelius Schumacher <schumacher@kde.org> 161 @author Cornelius Schumacher <schumacher@kde.org>
152*/ 162*/
153class KOTodoView : public KOrg::BaseView 163class KOTodoView : public KOrg::BaseView
154{ 164{
155 Q_OBJECT 165 Q_OBJECT
156 public: 166 public:
157 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 167 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
158 ~KOTodoView(); 168 ~KOTodoView();
159 169
160 QPtrList<Incidence> selectedIncidences(); 170 Q3PtrList<Incidence> selectedIncidences();
161 QPtrList<Todo> selectedTodos(); 171 Q3PtrList<Todo> selectedTodos();
162 172
163 DateList selectedDates() 173 DateList selectedDates()
164 {DateList q; 174 {DateList q;
165 return q;} 175 return q;}
166 176
167 /** Return number of shown dates. TodoView does not show dates, */ 177 /** Return number of shown dates. TodoView does not show dates, */
168 int currentDateCount() { return 0; } 178 int currentDateCount() { return 0; }
169 179
170 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 180 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
171 181
172 void setDocumentId( const QString & ); 182 void setDocumentId( const QString & );
173 183
@@ -175,32 +185,32 @@ class KOTodoView : public KOrg::BaseView
175 void restoreLayout(KConfig *config, const QString &group); 185 void restoreLayout(KConfig *config, const QString &group);
176 void setNavigator( DateNavigator* nav ) {mNavigator = nav;} 186 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
177 QString getWhatsThisText(QPoint p); 187 QString getWhatsThisText(QPoint p);
178 void clearList( bool saveCurrentItem = true ); 188 void clearList( bool saveCurrentItem = true );
179 189
180 public slots: 190 public slots:
181 void updateView(); 191 void updateView();
182 void updateConfig(); 192 void updateConfig();
183 193
184 void changeEventDisplay(Event *, int); 194 void changeEventDisplay(Event *, int);
185 195
186 void showDates(const QDate &start, const QDate &end); 196 void showDates(const QDate &start, const QDate &end);
187 void showEvents(QPtrList<Event> eventList); 197 void showEvents(Q3PtrList<Event> eventList);
188 198
189 void clearSelection(); 199 void clearSelection();
190 void jumpToDate (); 200 void jumpToDate ();
191 201
192 void editItem(QListViewItem *item); 202 void editItem(Q3ListViewItem *item);
193 void showItem(QListViewItem *item,const QPoint &,int); 203 void showItem(Q3ListViewItem *item,const QPoint &,int);
194 void popupMenu(QListViewItem *item,const QPoint &,int); 204 void popupMenu(Q3ListViewItem *item,const QPoint &,int);
195 void newTodo(); 205 void newTodo();
196 void newSubTodo(); 206 void newSubTodo();
197 void unparentTodo(); 207 void unparentTodo();
198 void reparentTodo(); 208 void reparentTodo();
199 void showTodo(); 209 void showTodo();
200 void editTodo(); 210 void editTodo();
201 void cloneTodo(); 211 void cloneTodo();
202 void cancelTodo(); 212 void cancelTodo();
203 void moveTodo(); 213 void moveTodo();
204 void beamTodo(); 214 void beamTodo();
205 void deleteTodo(); 215 void deleteTodo();
206 216
@@ -210,28 +220,28 @@ class KOTodoView : public KOrg::BaseView
210 220
211 void setAllOpen(); 221 void setAllOpen();
212 void setAllClose(); 222 void setAllClose();
213 void setAllFlat(); 223 void setAllFlat();
214 void displayAllFlat(); 224 void displayAllFlat();
215 225
216 void purgeCompleted(); 226 void purgeCompleted();
217 void toggleCompleted(); 227 void toggleCompleted();
218 void toggleRunning(); 228 void toggleRunning();
219 void toggleQuickTodo(); 229 void toggleQuickTodo();
220 void updateTodo( Todo *, int ); 230 void updateTodo( Todo *, int );
221 231
222 void itemClicked(QListViewItem *); 232 void itemClicked(Q3ListViewItem *);
223 void itemStateChanged(QListViewItem *); 233 void itemStateChanged(Q3ListViewItem *);
224 void modified(bool); 234 void modified(bool);
225 void itemDoubleClicked(QListViewItem *item); 235 void itemDoubleClicked(Q3ListViewItem *item);
226 void resetFocusToList(); 236 void resetFocusToList();
227 void fillCategories (); 237 void fillCategories ();
228 void fillCal (); 238 void fillCal ();
229 void changedCal (int); 239 void changedCal (int);
230 240
231 signals: 241 signals:
232 void newTodoSignal(); 242 void newTodoSignal();
233 void newSubTodoSignal(Todo *); 243 void newSubTodoSignal(Todo *);
234 void unparentTodoSignal(Todo *); 244 void unparentTodoSignal(Todo *);
235 void reparentTodoSignal( Todo *,Todo * ); 245 void reparentTodoSignal( Todo *,Todo * );
236 void showTodoSignal(Todo *); 246 void showTodoSignal(Todo *);
237 247
@@ -264,36 +274,36 @@ class KOTodoView : public KOrg::BaseView
264 * Korganizer keeps it in memory and we need to update 274 * Korganizer keeps it in memory and we need to update
265 * 1. make KOTodoViewItem a QObject again? 275 * 1. make KOTodoViewItem a QObject again?
266 * 2. add a public method for setting one todo modified? 276 * 2. add a public method for setting one todo modified?
267 * 3. add a private method for setting a todo modified + friend here? 277 * 3. add a private method for setting a todo modified + friend here?
268 * -- zecke 2002-07-08 278 * -- zecke 2002-07-08
269 */ 279 */
270 KOTodoViewWhatsThis* mKOTodoViewWhatsThis; 280 KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
271 friend class KOTodoListView; 281 friend class KOTodoListView;
272 void paintEvent(QPaintEvent * pevent); 282 void paintEvent(QPaintEvent * pevent);
273 bool mPendingUpdateBeforeRepaint; 283 bool mPendingUpdateBeforeRepaint;
274 friend class KOTodoViewItem; 284 friend class KOTodoViewItem;
275 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 285 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
276 void restoreItemState( QListViewItem * ); 286 void restoreItemState( Q3ListViewItem * );
277 287
278 bool checkTodo( Todo * ); 288 bool checkTodo( Todo * );
279 bool isFlatDisplay; 289 bool isFlatDisplay;
280 void setOpen( QListViewItem*, bool setOpen); 290 void setOpen( Q3ListViewItem*, bool setOpen);
281 KOTodoListView *mTodoListView; 291 KOTodoListView *mTodoListView;
282 QPopupMenu *mItemPopupMenu; 292 Q3PopupMenu *mItemPopupMenu;
283 QPopupMenu *mPopupMenu; 293 Q3PopupMenu *mPopupMenu;
284 QPopupMenu *mPriorityPopupMenu; 294 Q3PopupMenu *mPriorityPopupMenu;
285 QPopupMenu *mPercentageCompletedPopupMenu; 295 Q3PopupMenu *mPercentageCompletedPopupMenu;
286 QPopupMenu *mCategoryPopupMenu; 296 Q3PopupMenu *mCategoryPopupMenu;
287 QPopupMenu *mCalPopupMenu; 297 Q3PopupMenu *mCalPopupMenu;
288 298
289 QMap<int, int> mPercentage; 299 QMap<int, int> mPercentage;
290 QMap<int, int> mPriority; 300 QMap<int, int> mPriority;
291 QMap<int, QString> mCategory; 301 QMap<int, QString> mCategory;
292 KOTodoViewItem *mActiveItem; 302 KOTodoViewItem *mActiveItem;
293 303
294 QMap<Todo *,KOTodoViewItem *> mTodoMap; 304 QMap<Todo *,KOTodoViewItem *> mTodoMap;
295 QString mName; 305 QString mName;
296 QWidget* mQuickBar; 306 QWidget* mQuickBar;
297 307
298 DocPrefs *mDocPrefs; 308 DocPrefs *mDocPrefs;
299 QString mCurrentDoc; 309 QString mCurrentDoc;