summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.h
Unidiff
Diffstat (limited to 'korganizer/kotodoview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 68e29bb..16bc133 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -24,224 +24,226 @@
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 <qptrlist.h>
30#include <qstrlist.h> 30#include <qstrlist.h>
31#include <qlistbox.h> 31#include <qlistbox.h>
32#include <qpopupmenu.h> 32#include <qpopupmenu.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qmap.h> 34#include <qmap.h>
35#include <qlistview.h> 35#include <qlistview.h>
36#include <klistview.h> 36#include <klistview.h>
37 37
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40 40
41#include <korganizer/baseview.h> 41#include <korganizer/baseview.h>
42 42
43#include "kotodoviewitem.h" 43#include "kotodoviewitem.h"
44#include "koprefs.h" 44#include "koprefs.h"
45#include "koglobals.h" 45#include "koglobals.h"
46#include "datenavigator.h" 46#include "datenavigator.h"
47 47
48class QDragEnterEvent; 48class QDragEnterEvent;
49class QDragMoveEvent; 49class QDragMoveEvent;
50class QDragLeaveEvent; 50class QDragLeaveEvent;
51class QDropEvent; 51class QDropEvent;
52 52
53class DocPrefs; 53class DocPrefs;
54 54
55class KOTodoListView : public KListView 55class KOTodoListView : public KListView
56{ 56{
57 Q_OBJECT 57 Q_OBJECT
58 public: 58 public:
59 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 59 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
60 virtual ~KOTodoListView() {} 60 virtual ~KOTodoListView() {}
61 61
62 signals: 62 signals:
63 void todoDropped(Todo *, int); 63 void todoDropped(Todo *, int);
64 void double_Clicked(QListViewItem *item); 64 void double_Clicked(QListViewItem *item);
65 void reparentTodoSignal( Todo *,Todo * ); 65 void reparentTodoSignal( Todo *,Todo * );
66 void unparentTodoSignal(Todo *); 66 void unparentTodoSignal(Todo *);
67 void deleteTodo( Todo * ); 67 void deleteTodo( Todo * );
68 protected: 68 protected:
69 void contentsDragEnterEvent(QDragEnterEvent *); 69 void contentsDragEnterEvent(QDragEnterEvent *);
70 void contentsDragMoveEvent(QDragMoveEvent *); 70 void contentsDragMoveEvent(QDragMoveEvent *);
71 void contentsDragLeaveEvent(QDragLeaveEvent *); 71 void contentsDragLeaveEvent(QDragLeaveEvent *);
72 void contentsDropEvent(QDropEvent *); 72 void contentsDropEvent(QDropEvent *);
73 73
74 void contentsMousePressEvent(QMouseEvent *); 74 void contentsMousePressEvent(QMouseEvent *);
75 void contentsMouseMoveEvent(QMouseEvent *); 75 void contentsMouseMoveEvent(QMouseEvent *);
76 void contentsMouseReleaseEvent(QMouseEvent *); 76 void contentsMouseReleaseEvent(QMouseEvent *);
77 void contentsMouseDoubleClickEvent(QMouseEvent *); 77 void contentsMouseDoubleClickEvent(QMouseEvent *);
78 78
79 private: 79 private:
80 bool internalDrop; 80 bool internalDrop;
81 QString mName; 81 QString mName;
82 Calendar *mCalendar; 82 Calendar *mCalendar;
83 QPoint mPressPos; 83 QPoint mPressPos;
84 bool mMousePressed; 84 bool mMousePressed;
85 QListViewItem *mOldCurrent; 85 QListViewItem *mOldCurrent;
86 void keyPressEvent ( QKeyEvent * ) ; 86 void keyPressEvent ( QKeyEvent * ) ;
87}; 87};
88 88
89 89
90/** 90/**
91 This is the line-edit on top of the todoview for fast addition of new todos 91 This is the line-edit on top of the todoview for fast addition of new todos
92*/ 92*/
93class KOQuickTodo : public QLineEdit 93class KOQuickTodo : public QLineEdit
94{ 94{
95 public: 95 public:
96 KOQuickTodo(QWidget *parent=0); 96 KOQuickTodo(QWidget *parent=0);
97 protected: 97 protected:
98 void focusInEvent(QFocusEvent *ev); 98 void focusInEvent(QFocusEvent *ev);
99 void focusOutEvent(QFocusEvent *ev); 99 void focusOutEvent(QFocusEvent *ev);
100}; 100};
101 101
102 102
103/** 103/**
104 This class provides a multi-column list view of todo events. 104 This class provides a multi-column list view of todo events.
105 105
106 @short multi-column list view of todo events. 106 @short multi-column list view of todo events.
107 @author Cornelius Schumacher <schumacher@kde.org> 107 @author Cornelius Schumacher <schumacher@kde.org>
108*/ 108*/
109class KOTodoView : public KOrg::BaseView 109class KOTodoView : public KOrg::BaseView
110{ 110{
111 Q_OBJECT 111 Q_OBJECT
112 public: 112 public:
113 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 113 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
114 ~KOTodoView(); 114 ~KOTodoView();
115 115
116 QPtrList<Incidence> selectedIncidences(); 116 QPtrList<Incidence> selectedIncidences();
117 QPtrList<Todo> selectedTodos(); 117 QPtrList<Todo> selectedTodos();
118 118
119 DateList selectedDates() 119 DateList selectedDates()
120 {DateList q; 120 {DateList q;
121 return q;} 121 return q;}
122 122
123 /** Return number of shown dates. TodoView does not show dates, */ 123 /** Return number of shown dates. TodoView does not show dates, */
124 int currentDateCount() { return 0; } 124 int currentDateCount() { return 0; }
125 125
126 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 126 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
127 127
128 void setDocumentId( const QString & ); 128 void setDocumentId( const QString & );
129 129
130 void saveLayout(KConfig *config, const QString &group) const; 130 void saveLayout(KConfig *config, const QString &group) const;
131 void restoreLayout(KConfig *config, const QString &group); 131 void restoreLayout(KConfig *config, const QString &group);
132 /** Create a popup menu to set categories */ 132 /** Create a popup menu to set categories */
133 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); 133 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
134 void setNavigator( DateNavigator* nav ) {mNavigator = nav;} 134 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
135 135
136 public slots: 136 public slots:
137 void updateView(); 137 void updateView();
138 void updateConfig(); 138 void updateConfig();
139 139
140 void changeEventDisplay(Event *, int); 140 void changeEventDisplay(Event *, int);
141 141
142 void showDates(const QDate &start, const QDate &end); 142 void showDates(const QDate &start, const QDate &end);
143 void showEvents(QPtrList<Event> eventList); 143 void showEvents(QPtrList<Event> eventList);
144 144
145 void clearSelection(); 145 void clearSelection();
146 void jumpToDate (); 146 void jumpToDate ();
147 147
148 void editItem(QListViewItem *item); 148 void editItem(QListViewItem *item);
149 void showItem(QListViewItem *item,const QPoint &,int); 149 void showItem(QListViewItem *item,const QPoint &,int);
150 void popupMenu(QListViewItem *item,const QPoint &,int); 150 void popupMenu(QListViewItem *item,const QPoint &,int);
151 void newTodo(); 151 void newTodo();
152 void newSubTodo(); 152 void newSubTodo();
153 void unparentTodo(); 153 void unparentTodo();
154 void reparentTodo(); 154 void reparentTodo();
155 void showTodo(); 155 void showTodo();
156 void editTodo(); 156 void editTodo();
157 void cloneTodo(); 157 void cloneTodo();
158 void cancelTodo(); 158 void cancelTodo();
159 void moveTodo(); 159 void moveTodo();
160 void beamTodo(); 160 void beamTodo();
161 void deleteTodo(); 161 void deleteTodo();
162 162
163 void setNewPriority(int); 163 void setNewPriority(int);
164 void setNewPercentage(int); 164 void setNewPercentage(int);
165 void changedCategories(int); 165 void changedCategories(int);
166 166
167 void setAllOpen(); 167 void setAllOpen();
168 void setAllClose(); 168 void setAllClose();
169 void setAllFlat(); 169 void setAllFlat();
170 170
171 void purgeCompleted(); 171 void purgeCompleted();
172 void toggleCompleted(); 172 void toggleCompleted();
173 void toggleRunning(); 173 void toggleRunning();
174 void toggleQuickTodo(); 174 void toggleQuickTodo();
175 void updateTodo( Todo *, int ); 175 void updateTodo( Todo *, int );
176 176
177 void itemClicked(QListViewItem *); 177 void itemClicked(QListViewItem *);
178 void itemStateChanged(QListViewItem *); 178 void itemStateChanged(QListViewItem *);
179 void modified(bool); 179 void modified(bool);
180 void itemDoubleClicked(QListViewItem *item); 180 void itemDoubleClicked(QListViewItem *item);
181 181
182 signals: 182 signals:
183 void newTodoSignal(); 183 void newTodoSignal();
184 void newSubTodoSignal(Todo *); 184 void newSubTodoSignal(Todo *);
185 void unparentTodoSignal(Todo *); 185 void unparentTodoSignal(Todo *);
186 void reparentTodoSignal( Todo *,Todo * ); 186 void reparentTodoSignal( Todo *,Todo * );
187 void showTodoSignal(Todo *); 187 void showTodoSignal(Todo *);
188 188
189 void editTodoSignal(Todo *); 189 void editTodoSignal(Todo *);
190 void deleteTodoSignal(Todo *); 190 void deleteTodoSignal(Todo *);
191 void todoModifiedSignal (Todo *, int); 191 void todoModifiedSignal (Todo *, int);
192 192
193 void isModified(bool); 193 void isModified(bool);
194 void cloneTodoSignal( Incidence * ); 194 void cloneTodoSignal( Incidence * );
195 void cancelTodoSignal( Incidence * ); 195 void cancelTodoSignal( Incidence * );
196 void moveTodoSignal( Incidence * ); 196 void moveTodoSignal( Incidence * );
197 void beamTodoSignal( Incidence * ); 197 void beamTodoSignal( Incidence * );
198 void purgeCompletedSignal(); 198 void purgeCompletedSignal();
199 199
200 protected slots: 200 protected slots:
201 void processSelectionChange(); 201 void processSelectionChange();
202 void addQuickTodo(); 202 void addQuickTodo();
203 void setTodoModified( Todo* ); 203 void setTodoModified( Todo* );
204 void todoModified(Todo *, int ); 204 void todoModified(Todo *, int );
205 205
206 private: 206 private:
207 /* 207 /*
208 * the TodoEditor approach is rather unscaling in the long 208 * the TodoEditor approach is rather unscaling in the long
209 * run. 209 * run.
210 * Korganizer keeps it in memory and we need to update 210 * Korganizer keeps it in memory and we need to update
211 * 1. make KOTodoViewItem a QObject again? 211 * 1. make KOTodoViewItem a QObject again?
212 * 2. add a public method for setting one todo modified? 212 * 2. add a public method for setting one todo modified?
213 * 3. add a private method for setting a todo modified + friend here? 213 * 3. add a private method for setting a todo modified + friend here?
214 * -- zecke 2002-07-08 214 * -- zecke 2002-07-08
215 */ 215 */
216 void paintEvent(QPaintEvent * pevent);
217 bool mPendingUpdateBeforeRepaint;
216 friend class KOTodoViewItem; 218 friend class KOTodoViewItem;
217 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 219 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
218 void restoreItemState( QListViewItem * ); 220 void restoreItemState( QListViewItem * );
219 221
220 bool checkTodo( Todo * ); 222 bool checkTodo( Todo * );
221 bool isFlatDisplay; 223 bool isFlatDisplay;
222 void setOpen( QListViewItem*, bool setOpen); 224 void setOpen( QListViewItem*, bool setOpen);
223 KOTodoListView *mTodoListView; 225 KOTodoListView *mTodoListView;
224 QPopupMenu *mItemPopupMenu; 226 QPopupMenu *mItemPopupMenu;
225 QPopupMenu *mPopupMenu; 227 QPopupMenu *mPopupMenu;
226 QPopupMenu *mPriorityPopupMenu; 228 QPopupMenu *mPriorityPopupMenu;
227 QPopupMenu *mPercentageCompletedPopupMenu; 229 QPopupMenu *mPercentageCompletedPopupMenu;
228 QPopupMenu *mCategoryPopupMenu; 230 QPopupMenu *mCategoryPopupMenu;
229 231
230 QMap<int, int> mPercentage; 232 QMap<int, int> mPercentage;
231 QMap<int, int> mPriority; 233 QMap<int, int> mPriority;
232 QMap<int, QString> mCategory; 234 QMap<int, QString> mCategory;
233 KOTodoViewItem *mActiveItem; 235 KOTodoViewItem *mActiveItem;
234 236
235 QMap<Todo *,KOTodoViewItem *> mTodoMap; 237 QMap<Todo *,KOTodoViewItem *> mTodoMap;
236 QString mName; 238 QString mName;
237 239
238 DocPrefs *mDocPrefs; 240 DocPrefs *mDocPrefs;
239 QString mCurrentDoc; 241 QString mCurrentDoc;
240 KOQuickTodo *mQuickAdd; 242 KOQuickTodo *mQuickAdd;
241 bool mBlockUpdate; 243 bool mBlockUpdate;
242 void keyPressEvent ( QKeyEvent * ) ; 244 void keyPressEvent ( QKeyEvent * ) ;
243 KOTodoViewItem * pendingSubtodo; 245 KOTodoViewItem * pendingSubtodo;
244 DateNavigator* mNavigator; 246 DateNavigator* mNavigator;
245}; 247};
246 248
247#endif 249#endif