summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.h
Unidiff
Diffstat (limited to 'korganizer/kotodoview.h') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kotodoview.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index f11518d..68e29bb 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -15,111 +15,114 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
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 <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 *); 63 void todoDropped(Todo *, int);
64 void double_Clicked(QListViewItem *item); 64 void double_Clicked(QListViewItem *item);
65 65 void reparentTodoSignal( Todo *,Todo * );
66 void unparentTodoSignal(Todo *);
67 void deleteTodo( Todo * );
66 protected: 68 protected:
67 void contentsDragEnterEvent(QDragEnterEvent *); 69 void contentsDragEnterEvent(QDragEnterEvent *);
68 void contentsDragMoveEvent(QDragMoveEvent *); 70 void contentsDragMoveEvent(QDragMoveEvent *);
69 void contentsDragLeaveEvent(QDragLeaveEvent *); 71 void contentsDragLeaveEvent(QDragLeaveEvent *);
70 void contentsDropEvent(QDropEvent *); 72 void contentsDropEvent(QDropEvent *);
71 73
72 void contentsMousePressEvent(QMouseEvent *); 74 void contentsMousePressEvent(QMouseEvent *);
73 void contentsMouseMoveEvent(QMouseEvent *); 75 void contentsMouseMoveEvent(QMouseEvent *);
74 void contentsMouseReleaseEvent(QMouseEvent *); 76 void contentsMouseReleaseEvent(QMouseEvent *);
75 void contentsMouseDoubleClickEvent(QMouseEvent *); 77 void contentsMouseDoubleClickEvent(QMouseEvent *);
76 78
77 private: 79 private:
80 bool internalDrop;
78 QString mName; 81 QString mName;
79 Calendar *mCalendar; 82 Calendar *mCalendar;
80 QPoint mPressPos; 83 QPoint mPressPos;
81 bool mMousePressed; 84 bool mMousePressed;
82 QListViewItem *mOldCurrent; 85 QListViewItem *mOldCurrent;
83 void keyPressEvent ( QKeyEvent * ) ; 86 void keyPressEvent ( QKeyEvent * ) ;
84}; 87};
85 88
86 89
87/** 90/**
88 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
89*/ 92*/
90class KOQuickTodo : public QLineEdit 93class KOQuickTodo : public QLineEdit
91{ 94{
92 public: 95 public:
93 KOQuickTodo(QWidget *parent=0); 96 KOQuickTodo(QWidget *parent=0);
94 protected: 97 protected:
95 void focusInEvent(QFocusEvent *ev); 98 void focusInEvent(QFocusEvent *ev);
96 void focusOutEvent(QFocusEvent *ev); 99 void focusOutEvent(QFocusEvent *ev);
97}; 100};
98 101
99 102
100/** 103/**
101 This class provides a multi-column list view of todo events. 104 This class provides a multi-column list view of todo events.
102 105
103 @short multi-column list view of todo events. 106 @short multi-column list view of todo events.
104 @author Cornelius Schumacher <schumacher@kde.org> 107 @author Cornelius Schumacher <schumacher@kde.org>
105*/ 108*/
106class KOTodoView : public KOrg::BaseView 109class KOTodoView : public KOrg::BaseView
107{ 110{
108 Q_OBJECT 111 Q_OBJECT
109 public: 112 public:
110 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 113 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
111 ~KOTodoView(); 114 ~KOTodoView();
112 115
113 QPtrList<Incidence> selectedIncidences(); 116 QPtrList<Incidence> selectedIncidences();
114 QPtrList<Todo> selectedTodos(); 117 QPtrList<Todo> selectedTodos();
115 118
116 DateList selectedDates() 119 DateList selectedDates()
117 {DateList q; 120 {DateList q;
118 return q;} 121 return q;}
119 122
120 /** Return number of shown dates. TodoView does not show dates, */ 123 /** Return number of shown dates. TodoView does not show dates, */
121 int currentDateCount() { return 0; } 124 int currentDateCount() { return 0; }
122 125
123 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 126 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
124 127
125 void setDocumentId( const QString & ); 128 void setDocumentId( const QString & );
@@ -152,93 +155,93 @@ class KOTodoView : public KOrg::BaseView
152 void showTodo(); 155 void showTodo();
153 void editTodo(); 156 void editTodo();
154 void cloneTodo(); 157 void cloneTodo();
155 void cancelTodo(); 158 void cancelTodo();
156 void moveTodo(); 159 void moveTodo();
157 void beamTodo(); 160 void beamTodo();
158 void deleteTodo(); 161 void deleteTodo();
159 162
160 void setNewPriority(int); 163 void setNewPriority(int);
161 void setNewPercentage(int); 164 void setNewPercentage(int);
162 void changedCategories(int); 165 void changedCategories(int);
163 166
164 void setAllOpen(); 167 void setAllOpen();
165 void setAllClose(); 168 void setAllClose();
166 void setAllFlat(); 169 void setAllFlat();
167 170
168 void purgeCompleted(); 171 void purgeCompleted();
169 void toggleCompleted(); 172 void toggleCompleted();
170 void toggleRunning(); 173 void toggleRunning();
171 void toggleQuickTodo(); 174 void toggleQuickTodo();
172 void updateTodo( Todo *, int ); 175 void updateTodo( Todo *, int );
173 176
174 void itemClicked(QListViewItem *); 177 void itemClicked(QListViewItem *);
175 void itemStateChanged(QListViewItem *); 178 void itemStateChanged(QListViewItem *);
176 void modified(bool); 179 void modified(bool);
177 void itemDoubleClicked(QListViewItem *item); 180 void itemDoubleClicked(QListViewItem *item);
178 181
179 signals: 182 signals:
180 void newTodoSignal(); 183 void newTodoSignal();
181 void newSubTodoSignal(Todo *); 184 void newSubTodoSignal(Todo *);
182 void unparentTodoSignal(Todo *); 185 void unparentTodoSignal(Todo *);
183 void reparentTodoSignal( Todo *,Todo * ); 186 void reparentTodoSignal( Todo *,Todo * );
184 void showTodoSignal(Todo *); 187 void showTodoSignal(Todo *);
185 188
186 void editTodoSignal(Todo *); 189 void editTodoSignal(Todo *);
187 void deleteTodoSignal(Todo *); 190 void deleteTodoSignal(Todo *);
188 void todoModifiedSignal (Todo *, int); 191 void todoModifiedSignal (Todo *, int);
189 192
190 void isModified(bool); 193 void isModified(bool);
191 void cloneTodoSignal( Incidence * ); 194 void cloneTodoSignal( Incidence * );
192 void cancelTodoSignal( Incidence * ); 195 void cancelTodoSignal( Incidence * );
193 void moveTodoSignal( Incidence * ); 196 void moveTodoSignal( Incidence * );
194 void beamTodoSignal( Incidence * ); 197 void beamTodoSignal( Incidence * );
195 void purgeCompletedSignal(); 198 void purgeCompletedSignal();
196 199
197 protected slots: 200 protected slots:
198 void processSelectionChange(); 201 void processSelectionChange();
199 void addQuickTodo(); 202 void addQuickTodo();
203 void setTodoModified( Todo* );
204 void todoModified(Todo *, int );
200 205
201 private: 206 private:
202 /* 207 /*
203 * the TodoEditor approach is rather unscaling in the long 208 * the TodoEditor approach is rather unscaling in the long
204 * run. 209 * run.
205 * Korganizer keeps it in memory and we need to update 210 * Korganizer keeps it in memory and we need to update
206 * 1. make KOTodoViewItem a QObject again? 211 * 1. make KOTodoViewItem a QObject again?
207 * 2. add a public method for setting one todo modified? 212 * 2. add a public method for setting one todo modified?
208 * 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?
209 * -- zecke 2002-07-08 214 * -- zecke 2002-07-08
210 */ 215 */
211 friend class KOTodoViewItem; 216 friend class KOTodoViewItem;
212 void setTodoModified( Todo* );
213 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 217 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
214 void restoreItemState( QListViewItem * ); 218 void restoreItemState( QListViewItem * );
215 219
216 bool checkTodo( Todo * ); 220 bool checkTodo( Todo * );
217 bool isFlatDisplay; 221 bool isFlatDisplay;
218 void setOpen( QListViewItem*, bool setOpen); 222 void setOpen( QListViewItem*, bool setOpen);
219 KOTodoListView *mTodoListView; 223 KOTodoListView *mTodoListView;
220 QPopupMenu *mItemPopupMenu; 224 QPopupMenu *mItemPopupMenu;
221 QPopupMenu *mPopupMenu; 225 QPopupMenu *mPopupMenu;
222 QPopupMenu *mPriorityPopupMenu; 226 QPopupMenu *mPriorityPopupMenu;
223 QPopupMenu *mPercentageCompletedPopupMenu; 227 QPopupMenu *mPercentageCompletedPopupMenu;
224 QPopupMenu *mCategoryPopupMenu; 228 QPopupMenu *mCategoryPopupMenu;
225 229
226 QMap<int, int> mPercentage; 230 QMap<int, int> mPercentage;
227 QMap<int, int> mPriority; 231 QMap<int, int> mPriority;
228 QMap<int, QString> mCategory; 232 QMap<int, QString> mCategory;
229 KOTodoViewItem *mActiveItem; 233 KOTodoViewItem *mActiveItem;
230 234
231 QMap<Todo *,KOTodoViewItem *> mTodoMap; 235 QMap<Todo *,KOTodoViewItem *> mTodoMap;
232 QString mName; 236 QString mName;
233 237
234 DocPrefs *mDocPrefs; 238 DocPrefs *mDocPrefs;
235 QString mCurrentDoc; 239 QString mCurrentDoc;
236 KOQuickTodo *mQuickAdd; 240 KOQuickTodo *mQuickAdd;
237 bool mBlockUpdate; 241 bool mBlockUpdate;
238 void todoModified(Todo *, int );
239 void keyPressEvent ( QKeyEvent * ) ; 242 void keyPressEvent ( QKeyEvent * ) ;
240 KOTodoViewItem * pendingSubtodo; 243 KOTodoViewItem * pendingSubtodo;
241 DateNavigator* mNavigator; 244 DateNavigator* mNavigator;
242}; 245};
243 246
244#endif 247#endif