summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.h
authorMichael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
committer Michael Krelin <hacker@klever.net>2007-07-04 11:23:42 (UTC)
commita08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff)
tree8ee90d686081c52e7c69b5ce946e9b1a7d690001 /korganizer/kotodoview.h
parent11edc920afe4f274c0964436633aa632c8288a40 (diff)
downloadkdepimpi-p1.zip
kdepimpi-p1.tar.gz
kdepimpi-p1.tar.bz2
initial public commit of qt4 portp1
Diffstat (limited to 'korganizer/kotodoview.h') (more/less context) (show 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
@@ -5,57 +5,67 @@
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
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 <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
50class QDragEnterEvent; 60class QDragEnterEvent;
51class QDragMoveEvent; 61class QDragMoveEvent;
52class QDragLeaveEvent; 62class QDragLeaveEvent;
53class QDropEvent; 63class QDropEvent;
54class KOTodoViewWhatsThis; 64class KOTodoViewWhatsThis;
55class KDateEdit; 65class KDateEdit;
56class KOTimeEdit; 66class KOTimeEdit;
57 67
58class DocPrefs; 68class DocPrefs;
59 69
60 70
61class KOStopTodoPrefs : public QDialog 71class KOStopTodoPrefs : public QDialog
@@ -80,170 +90,170 @@ private:
80class KOStartTodoPrefs : public QDialog 90class KOStartTodoPrefs : public QDialog
81{ 91{
82 Q_OBJECT 92 Q_OBJECT
83 public: 93 public:
84 KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; 94 KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ;
85 95
86 bool stopAll() { return mStopAll; } 96 bool stopAll() { return mStopAll; }
87private slots: 97private slots:
88 void doStop(); 98 void doStop();
89private: 99private:
90 bool mStopAll; 100 bool mStopAll;
91 101
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:
140 KOQuickTodo(QWidget *parent=0); 150 KOQuickTodo(QWidget *parent=0);
141 protected: 151 protected:
142 void focusInEvent(QFocusEvent *ev); 152 void focusInEvent(QFocusEvent *ev);
143 void focusOutEvent(QFocusEvent *ev); 153 void focusOutEvent(QFocusEvent *ev);
144}; 154};
145 155
146 156
147/** 157/**
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
174 void saveLayout(KConfig *config, const QString &group) const; 184 void saveLayout(KConfig *config, const QString &group) const;
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
207 void setNewPriority(int); 217 void setNewPriority(int);
208 void setNewPercentage(int); 218 void setNewPercentage(int);
209 void changedCategories(int); 219 void changedCategories(int);
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
238 void editTodoSignal(Todo *); 248 void editTodoSignal(Todo *);
239 void deleteTodoSignal(Todo *); 249 void deleteTodoSignal(Todo *);
240 void todoModifiedSignal (Todo *, int); 250 void todoModifiedSignal (Todo *, int);
241 251
242 void isModified(bool); 252 void isModified(bool);
243 void cloneTodoSignal( Incidence * ); 253 void cloneTodoSignal( Incidence * );
244 void cancelTodoSignal( Incidence * ); 254 void cancelTodoSignal( Incidence * );
245 void moveTodoSignal( Incidence * ); 255 void moveTodoSignal( Incidence * );
246 void beamTodoSignal( Incidence * ); 256 void beamTodoSignal( Incidence * );
247 void purgeCompletedSignal(); 257 void purgeCompletedSignal();
248 258
249 protected slots: 259 protected slots:
@@ -252,60 +262,60 @@ class KOTodoView : public KOrg::BaseView
252 void paintNeeded(); 262 void paintNeeded();
253 void processSelectionChange(); 263 void processSelectionChange();
254 void addQuickTodo(); 264 void addQuickTodo();
255 void setTodoModified( Todo* ); 265 void setTodoModified( Todo* );
256 void todoModified(Todo *, int ); 266 void todoModified(Todo *, int );
257 267
258 private: 268 private:
259 bool mIsActiveWindow; 269 bool mIsActiveWindow;
260 void addQuickTodoPar( Todo * parentTodo); 270 void addQuickTodoPar( Todo * parentTodo);
261 /* 271 /*
262 * the TodoEditor approach is rather unscaling in the long 272 * the TodoEditor approach is rather unscaling in the long
263 * run. 273 * run.
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;
300 KOQuickTodo *mQuickAdd; 310 KOQuickTodo *mQuickAdd;
301 bool mBlockUpdate; 311 bool mBlockUpdate;
302 void keyPressEvent ( QKeyEvent * ) ; 312 void keyPressEvent ( QKeyEvent * ) ;
303 KOTodoViewItem * pendingSubtodo; 313 KOTodoViewItem * pendingSubtodo;
304 DateNavigator* mNavigator; 314 DateNavigator* mNavigator;
305 void storeCurrentItem(); 315 void storeCurrentItem();
306 void resetCurrentItem(); 316 void resetCurrentItem();
307 Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; 317 Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove;
308 QPushButton * mNewSubBut; 318 QPushButton * mNewSubBut;
309}; 319};
310 320
311#endif 321#endif