-rw-r--r-- | korganizer/kotodoview.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index eab0754..e553d0e 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -41,97 +41,99 @@ | |||
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 | ||
48 | class QDragEnterEvent; | 48 | class QDragEnterEvent; |
49 | class QDragMoveEvent; | 49 | class QDragMoveEvent; |
50 | class QDragLeaveEvent; | 50 | class QDragLeaveEvent; |
51 | class QDropEvent; | 51 | class QDropEvent; |
52 | class KOTodoViewWhatsThis; | 52 | class KOTodoViewWhatsThis; |
53 | 53 | ||
54 | class DocPrefs; | 54 | class DocPrefs; |
55 | 55 | ||
56 | class KOTodoListView : public KListView | 56 | class KOTodoListView : public KListView |
57 | { | 57 | { |
58 | Q_OBJECT | 58 | Q_OBJECT |
59 | public: | 59 | public: |
60 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 60 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
61 | virtual ~KOTodoListView() {} | 61 | virtual ~KOTodoListView() {} |
62 | 62 | ||
63 | signals: | 63 | signals: |
64 | void paintNeeded(); | 64 | void paintNeeded(); |
65 | void todoDropped(Todo *, int); | 65 | void todoDropped(Todo *, int); |
66 | void double_Clicked(QListViewItem *item); | 66 | void double_Clicked(QListViewItem *item); |
67 | void reparentTodoSignal( Todo *,Todo * ); | 67 | void reparentTodoSignal( Todo *,Todo * ); |
68 | void unparentTodoSignal(Todo *); | 68 | void unparentTodoSignal(Todo *); |
69 | void deleteTodo( Todo * ); | 69 | void deleteTodo( Todo * ); |
70 | protected: | 70 | protected: |
71 | void contentsDragEnterEvent(QDragEnterEvent *); | 71 | void contentsDragEnterEvent(QDragEnterEvent *); |
72 | void contentsDragMoveEvent(QDragMoveEvent *); | 72 | void contentsDragMoveEvent(QDragMoveEvent *); |
73 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 73 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
74 | void contentsDropEvent(QDropEvent *); | 74 | void contentsDropEvent(QDropEvent *); |
75 | 75 | ||
76 | void contentsMousePressEvent(QMouseEvent *); | 76 | void contentsMousePressEvent(QMouseEvent *); |
77 | void contentsMouseMoveEvent(QMouseEvent *); | 77 | void contentsMouseMoveEvent(QMouseEvent *); |
78 | void contentsMouseReleaseEvent(QMouseEvent *); | 78 | void contentsMouseReleaseEvent(QMouseEvent *); |
79 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 79 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
80 | 80 | ||
81 | private: | 81 | private: |
82 | void paintEvent(QPaintEvent * pevent); | 82 | void paintEvent(QPaintEvent * pevent); |
83 | bool internalDrop; | 83 | bool internalDrop; |
84 | QString mName; | 84 | QString mName; |
85 | Calendar *mCalendar; | 85 | Calendar *mCalendar; |
86 | QPoint mPressPos; | 86 | QPoint mPressPos; |
87 | bool mMousePressed; | 87 | bool mMousePressed; |
88 | QListViewItem *mOldCurrent; | 88 | QListViewItem *mOldCurrent; |
89 | bool mFlagKeyPressed; | ||
89 | void keyPressEvent ( QKeyEvent * ) ; | 90 | void keyPressEvent ( QKeyEvent * ) ; |
91 | void keyReleaseEvent ( QKeyEvent * ) ; | ||
90 | }; | 92 | }; |
91 | 93 | ||
92 | 94 | ||
93 | /** | 95 | /** |
94 | This is the line-edit on top of the todoview for fast addition of new todos | 96 | This is the line-edit on top of the todoview for fast addition of new todos |
95 | */ | 97 | */ |
96 | class KOQuickTodo : public QLineEdit | 98 | class KOQuickTodo : public QLineEdit |
97 | { | 99 | { |
98 | public: | 100 | public: |
99 | KOQuickTodo(QWidget *parent=0); | 101 | KOQuickTodo(QWidget *parent=0); |
100 | protected: | 102 | protected: |
101 | void focusInEvent(QFocusEvent *ev); | 103 | void focusInEvent(QFocusEvent *ev); |
102 | void focusOutEvent(QFocusEvent *ev); | 104 | void focusOutEvent(QFocusEvent *ev); |
103 | }; | 105 | }; |
104 | 106 | ||
105 | 107 | ||
106 | /** | 108 | /** |
107 | This class provides a multi-column list view of todo events. | 109 | This class provides a multi-column list view of todo events. |
108 | 110 | ||
109 | @short multi-column list view of todo events. | 111 | @short multi-column list view of todo events. |
110 | @author Cornelius Schumacher <schumacher@kde.org> | 112 | @author Cornelius Schumacher <schumacher@kde.org> |
111 | */ | 113 | */ |
112 | class KOTodoView : public KOrg::BaseView | 114 | class KOTodoView : public KOrg::BaseView |
113 | { | 115 | { |
114 | Q_OBJECT | 116 | Q_OBJECT |
115 | public: | 117 | public: |
116 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 118 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
117 | ~KOTodoView(); | 119 | ~KOTodoView(); |
118 | 120 | ||
119 | QPtrList<Incidence> selectedIncidences(); | 121 | QPtrList<Incidence> selectedIncidences(); |
120 | QPtrList<Todo> selectedTodos(); | 122 | QPtrList<Todo> selectedTodos(); |
121 | 123 | ||
122 | DateList selectedDates() | 124 | DateList selectedDates() |
123 | {DateList q; | 125 | {DateList q; |
124 | return q;} | 126 | return q;} |
125 | 127 | ||
126 | /** Return number of shown dates. TodoView does not show dates, */ | 128 | /** Return number of shown dates. TodoView does not show dates, */ |
127 | int currentDateCount() { return 0; } | 129 | int currentDateCount() { return 0; } |
128 | 130 | ||
129 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); | 131 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); |
130 | 132 | ||
131 | void setDocumentId( const QString & ); | 133 | void setDocumentId( const QString & ); |
132 | 134 | ||
133 | void saveLayout(KConfig *config, const QString &group) const; | 135 | void saveLayout(KConfig *config, const QString &group) const; |
134 | void restoreLayout(KConfig *config, const QString &group); | 136 | void restoreLayout(KConfig *config, const QString &group); |
135 | /** Create a popup menu to set categories */ | 137 | /** Create a popup menu to set categories */ |
136 | QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); | 138 | QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); |
137 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} | 139 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} |
@@ -207,51 +209,54 @@ class KOTodoView : public KOrg::BaseView | |||
207 | void processSelectionChange(); | 209 | void processSelectionChange(); |
208 | void addQuickTodo(); | 210 | void addQuickTodo(); |
209 | void setTodoModified( Todo* ); | 211 | void setTodoModified( Todo* ); |
210 | void todoModified(Todo *, int ); | 212 | void todoModified(Todo *, int ); |
211 | 213 | ||
212 | private: | 214 | private: |
213 | /* | 215 | /* |
214 | * the TodoEditor approach is rather unscaling in the long | 216 | * the TodoEditor approach is rather unscaling in the long |
215 | * run. | 217 | * run. |
216 | * Korganizer keeps it in memory and we need to update | 218 | * Korganizer keeps it in memory and we need to update |
217 | * 1. make KOTodoViewItem a QObject again? | 219 | * 1. make KOTodoViewItem a QObject again? |
218 | * 2. add a public method for setting one todo modified? | 220 | * 2. add a public method for setting one todo modified? |
219 | * 3. add a private method for setting a todo modified + friend here? | 221 | * 3. add a private method for setting a todo modified + friend here? |
220 | * -- zecke 2002-07-08 | 222 | * -- zecke 2002-07-08 |
221 | */ | 223 | */ |
222 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; | 224 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; |
223 | friend class KOTodoListView; | 225 | friend class KOTodoListView; |
224 | void paintEvent(QPaintEvent * pevent); | 226 | void paintEvent(QPaintEvent * pevent); |
225 | bool mPendingUpdateBeforeRepaint; | 227 | bool mPendingUpdateBeforeRepaint; |
226 | friend class KOTodoViewItem; | 228 | friend class KOTodoViewItem; |
227 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 229 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
228 | void restoreItemState( QListViewItem * ); | 230 | void restoreItemState( QListViewItem * ); |
229 | 231 | ||
230 | bool checkTodo( Todo * ); | 232 | bool checkTodo( Todo * ); |
231 | bool isFlatDisplay; | 233 | bool isFlatDisplay; |
232 | void setOpen( QListViewItem*, bool setOpen); | 234 | void setOpen( QListViewItem*, bool setOpen); |
233 | KOTodoListView *mTodoListView; | 235 | KOTodoListView *mTodoListView; |
234 | QPopupMenu *mItemPopupMenu; | 236 | QPopupMenu *mItemPopupMenu; |
235 | QPopupMenu *mPopupMenu; | 237 | QPopupMenu *mPopupMenu; |
236 | QPopupMenu *mPriorityPopupMenu; | 238 | QPopupMenu *mPriorityPopupMenu; |
237 | QPopupMenu *mPercentageCompletedPopupMenu; | 239 | QPopupMenu *mPercentageCompletedPopupMenu; |
238 | QPopupMenu *mCategoryPopupMenu; | 240 | QPopupMenu *mCategoryPopupMenu; |
239 | 241 | ||
240 | QMap<int, int> mPercentage; | 242 | QMap<int, int> mPercentage; |
241 | QMap<int, int> mPriority; | 243 | QMap<int, int> mPriority; |
242 | QMap<int, QString> mCategory; | 244 | QMap<int, QString> mCategory; |
243 | KOTodoViewItem *mActiveItem; | 245 | KOTodoViewItem *mActiveItem; |
244 | 246 | ||
245 | QMap<Todo *,KOTodoViewItem *> mTodoMap; | 247 | QMap<Todo *,KOTodoViewItem *> mTodoMap; |
246 | QString mName; | 248 | QString mName; |
247 | 249 | ||
248 | DocPrefs *mDocPrefs; | 250 | DocPrefs *mDocPrefs; |
249 | QString mCurrentDoc; | 251 | QString mCurrentDoc; |
250 | KOQuickTodo *mQuickAdd; | 252 | KOQuickTodo *mQuickAdd; |
251 | bool mBlockUpdate; | 253 | bool mBlockUpdate; |
252 | void keyPressEvent ( QKeyEvent * ) ; | 254 | void keyPressEvent ( QKeyEvent * ) ; |
253 | KOTodoViewItem * pendingSubtodo; | 255 | KOTodoViewItem * pendingSubtodo; |
254 | DateNavigator* mNavigator; | 256 | DateNavigator* mNavigator; |
257 | void storeCurrentItem(); | ||
258 | void resetCurrentItem(); | ||
259 | Incidence * mCurItem, *mCurItemRootParent,*mCurItemAbove; | ||
255 | }; | 260 | }; |
256 | 261 | ||
257 | #endif | 262 | #endif |