-rw-r--r-- | korganizer/kotodoview.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 9ae7f53..79cc756 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -79,225 +79,227 @@ private: | |||
79 | class KOStartTodoPrefs : public QDialog | 79 | class KOStartTodoPrefs : public QDialog |
80 | { | 80 | { |
81 | Q_OBJECT | 81 | Q_OBJECT |
82 | public: | 82 | public: |
83 | KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; | 83 | KOStartTodoPrefs( QString sum, QWidget *parent=0, const char *name=0 ) ; |
84 | 84 | ||
85 | bool stopAll() { return mStopAll; } | 85 | bool stopAll() { return mStopAll; } |
86 | private slots: | 86 | private slots: |
87 | void doStop(); | 87 | void doStop(); |
88 | private: | 88 | private: |
89 | bool mStopAll; | 89 | bool mStopAll; |
90 | 90 | ||
91 | }; | 91 | }; |
92 | 92 | ||
93 | class KOTodoListView : public KListView | 93 | class KOTodoListView : public KListView |
94 | { | 94 | { |
95 | Q_OBJECT | 95 | Q_OBJECT |
96 | public: | 96 | public: |
97 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); | 97 | KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); |
98 | virtual ~KOTodoListView() {} | 98 | virtual ~KOTodoListView() {} |
99 | 99 | ||
100 | signals: | 100 | signals: |
101 | void paintNeeded(); | 101 | void paintNeeded(); |
102 | void todoDropped(Todo *, int); | 102 | void todoDropped(Todo *, int); |
103 | void double_Clicked(QListViewItem *item); | 103 | void double_Clicked(QListViewItem *item); |
104 | void reparentTodoSignal( Todo *,Todo * ); | 104 | void reparentTodoSignal( Todo *,Todo * ); |
105 | void unparentTodoSignal(Todo *); | 105 | void unparentTodoSignal(Todo *); |
106 | void deleteTodo( Todo * ); | 106 | void deleteTodo( Todo * ); |
107 | protected: | 107 | protected: |
108 | void wheelEvent (QWheelEvent *e); | 108 | void wheelEvent (QWheelEvent *e); |
109 | void contentsDragEnterEvent(QDragEnterEvent *); | 109 | void contentsDragEnterEvent(QDragEnterEvent *); |
110 | void contentsDragMoveEvent(QDragMoveEvent *); | 110 | void contentsDragMoveEvent(QDragMoveEvent *); |
111 | void contentsDragLeaveEvent(QDragLeaveEvent *); | 111 | void contentsDragLeaveEvent(QDragLeaveEvent *); |
112 | void contentsDropEvent(QDropEvent *); | 112 | void contentsDropEvent(QDropEvent *); |
113 | 113 | ||
114 | void contentsMousePressEvent(QMouseEvent *); | 114 | void contentsMousePressEvent(QMouseEvent *); |
115 | void contentsMouseMoveEvent(QMouseEvent *); | 115 | void contentsMouseMoveEvent(QMouseEvent *); |
116 | void contentsMouseReleaseEvent(QMouseEvent *); | 116 | void contentsMouseReleaseEvent(QMouseEvent *); |
117 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 117 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
118 | 118 | ||
119 | private: | 119 | private: |
120 | void paintEvent(QPaintEvent * pevent); | 120 | void paintEvent(QPaintEvent * pevent); |
121 | bool internalDrop; | 121 | bool internalDrop; |
122 | QString mName; | 122 | QString mName; |
123 | Calendar *mCalendar; | 123 | Calendar *mCalendar; |
124 | QPoint mPressPos; | 124 | QPoint mPressPos; |
125 | bool mMousePressed; | 125 | bool mMousePressed; |
126 | QListViewItem *mOldCurrent; | 126 | QListViewItem *mOldCurrent; |
127 | bool mFlagKeyPressed; | 127 | bool mFlagKeyPressed; |
128 | void keyPressEvent ( QKeyEvent * ) ; | 128 | void keyPressEvent ( QKeyEvent * ) ; |
129 | void keyReleaseEvent ( QKeyEvent * ) ; | 129 | void keyReleaseEvent ( QKeyEvent * ) ; |
130 | }; | 130 | }; |
131 | 131 | ||
132 | 132 | ||
133 | /** | 133 | /** |
134 | This is the line-edit on top of the todoview for fast addition of new todos | 134 | This is the line-edit on top of the todoview for fast addition of new todos |
135 | */ | 135 | */ |
136 | class KOQuickTodo : public QLineEdit | 136 | class KOQuickTodo : public QLineEdit |
137 | { | 137 | { |
138 | public: | 138 | public: |
139 | KOQuickTodo(QWidget *parent=0); | 139 | KOQuickTodo(QWidget *parent=0); |
140 | protected: | 140 | protected: |
141 | void focusInEvent(QFocusEvent *ev); | 141 | void focusInEvent(QFocusEvent *ev); |
142 | void focusOutEvent(QFocusEvent *ev); | 142 | void focusOutEvent(QFocusEvent *ev); |
143 | }; | 143 | }; |
144 | 144 | ||
145 | 145 | ||
146 | /** | 146 | /** |
147 | This class provides a multi-column list view of todo events. | 147 | This class provides a multi-column list view of todo events. |
148 | 148 | ||
149 | @short multi-column list view of todo events. | 149 | @short multi-column list view of todo events. |
150 | @author Cornelius Schumacher <schumacher@kde.org> | 150 | @author Cornelius Schumacher <schumacher@kde.org> |
151 | */ | 151 | */ |
152 | class KOTodoView : public KOrg::BaseView | 152 | class KOTodoView : public KOrg::BaseView |
153 | { | 153 | { |
154 | Q_OBJECT | 154 | Q_OBJECT |
155 | public: | 155 | public: |
156 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 156 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
157 | ~KOTodoView(); | 157 | ~KOTodoView(); |
158 | 158 | ||
159 | QPtrList<Incidence> selectedIncidences(); | 159 | QPtrList<Incidence> selectedIncidences(); |
160 | QPtrList<Todo> selectedTodos(); | 160 | QPtrList<Todo> selectedTodos(); |
161 | 161 | ||
162 | DateList selectedDates() | 162 | DateList selectedDates() |
163 | {DateList q; | 163 | {DateList q; |
164 | return q;} | 164 | return q;} |
165 | 165 | ||
166 | /** Return number of shown dates. TodoView does not show dates, */ | 166 | /** Return number of shown dates. TodoView does not show dates, */ |
167 | int currentDateCount() { return 0; } | 167 | int currentDateCount() { return 0; } |
168 | 168 | ||
169 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); | 169 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); |
170 | 170 | ||
171 | void setDocumentId( const QString & ); | 171 | void setDocumentId( const QString & ); |
172 | 172 | ||
173 | void saveLayout(KConfig *config, const QString &group) const; | 173 | void saveLayout(KConfig *config, const QString &group) const; |
174 | void restoreLayout(KConfig *config, const QString &group); | 174 | void restoreLayout(KConfig *config, const QString &group); |
175 | /** Create a popup menu to set categories */ | ||
176 | QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); | ||
177 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} | 175 | void setNavigator( DateNavigator* nav ) {mNavigator = nav;} |
178 | QString getWhatsThisText(QPoint p); | 176 | QString getWhatsThisText(QPoint p); |
179 | void clearList() {mTodoListView->clear(); } | 177 | void clearList() {mTodoListView->clear(); } |
180 | 178 | ||
181 | public slots: | 179 | public slots: |
182 | void updateView(); | 180 | void updateView(); |
183 | void updateConfig(); | 181 | void updateConfig(); |
184 | 182 | ||
185 | void changeEventDisplay(Event *, int); | 183 | void changeEventDisplay(Event *, int); |
186 | 184 | ||
187 | void showDates(const QDate &start, const QDate &end); | 185 | void showDates(const QDate &start, const QDate &end); |
188 | void showEvents(QPtrList<Event> eventList); | 186 | void showEvents(QPtrList<Event> eventList); |
189 | 187 | ||
190 | void clearSelection(); | 188 | void clearSelection(); |
191 | void jumpToDate (); | 189 | void jumpToDate (); |
192 | 190 | ||
193 | void editItem(QListViewItem *item); | 191 | void editItem(QListViewItem *item); |
194 | void showItem(QListViewItem *item,const QPoint &,int); | 192 | void showItem(QListViewItem *item,const QPoint &,int); |
195 | void popupMenu(QListViewItem *item,const QPoint &,int); | 193 | void popupMenu(QListViewItem *item,const QPoint &,int); |
196 | void newTodo(); | 194 | void newTodo(); |
197 | void newSubTodo(); | 195 | void newSubTodo(); |
198 | void unparentTodo(); | 196 | void unparentTodo(); |
199 | void reparentTodo(); | 197 | void reparentTodo(); |
200 | void showTodo(); | 198 | void showTodo(); |
201 | void editTodo(); | 199 | void editTodo(); |
202 | void cloneTodo(); | 200 | void cloneTodo(); |
203 | void cancelTodo(); | 201 | void cancelTodo(); |
204 | void moveTodo(); | 202 | void moveTodo(); |
205 | void beamTodo(); | 203 | void beamTodo(); |
206 | void deleteTodo(); | 204 | void deleteTodo(); |
207 | 205 | ||
208 | void setNewPriority(int); | 206 | void setNewPriority(int); |
209 | void setNewPercentage(int); | 207 | void setNewPercentage(int); |
210 | void changedCategories(int); | 208 | void changedCategories(int); |
211 | 209 | ||
212 | void setAllOpen(); | 210 | void setAllOpen(); |
213 | void setAllClose(); | 211 | void setAllClose(); |
214 | void setAllFlat(); | 212 | void setAllFlat(); |
215 | void displayAllFlat(); | 213 | void displayAllFlat(); |
216 | 214 | ||
217 | void purgeCompleted(); | 215 | void purgeCompleted(); |
218 | void toggleCompleted(); | 216 | void toggleCompleted(); |
219 | void toggleRunning(); | 217 | void toggleRunning(); |
220 | void toggleQuickTodo(); | 218 | void toggleQuickTodo(); |
221 | void updateTodo( Todo *, int ); | 219 | void updateTodo( Todo *, int ); |
222 | 220 | ||
223 | void itemClicked(QListViewItem *); | 221 | void itemClicked(QListViewItem *); |
224 | void itemStateChanged(QListViewItem *); | 222 | void itemStateChanged(QListViewItem *); |
225 | void modified(bool); | 223 | void modified(bool); |
226 | void itemDoubleClicked(QListViewItem *item); | 224 | void itemDoubleClicked(QListViewItem *item); |
227 | void resetFocusToList(); | 225 | void resetFocusToList(); |
226 | void fillCategories (); | ||
227 | void fillCal (); | ||
228 | void changedCal (int); | ||
228 | 229 | ||
229 | signals: | 230 | signals: |
230 | void newTodoSignal(); | 231 | void newTodoSignal(); |
231 | void newSubTodoSignal(Todo *); | 232 | void newSubTodoSignal(Todo *); |
232 | void unparentTodoSignal(Todo *); | 233 | void unparentTodoSignal(Todo *); |
233 | void reparentTodoSignal( Todo *,Todo * ); | 234 | void reparentTodoSignal( Todo *,Todo * ); |
234 | void showTodoSignal(Todo *); | 235 | void showTodoSignal(Todo *); |
235 | 236 | ||
236 | void editTodoSignal(Todo *); | 237 | void editTodoSignal(Todo *); |
237 | void deleteTodoSignal(Todo *); | 238 | void deleteTodoSignal(Todo *); |
238 | void todoModifiedSignal (Todo *, int); | 239 | void todoModifiedSignal (Todo *, int); |
239 | 240 | ||
240 | void isModified(bool); | 241 | void isModified(bool); |
241 | void cloneTodoSignal( Incidence * ); | 242 | void cloneTodoSignal( Incidence * ); |
242 | void cancelTodoSignal( Incidence * ); | 243 | void cancelTodoSignal( Incidence * ); |
243 | void moveTodoSignal( Incidence * ); | 244 | void moveTodoSignal( Incidence * ); |
244 | void beamTodoSignal( Incidence * ); | 245 | void beamTodoSignal( Incidence * ); |
245 | void purgeCompletedSignal(); | 246 | void purgeCompletedSignal(); |
246 | 247 | ||
247 | protected slots: | 248 | protected slots: |
248 | void toggleRunningItem(); | 249 | void toggleRunningItem(); |
249 | void paintNeeded(); | 250 | void paintNeeded(); |
250 | void processSelectionChange(); | 251 | void processSelectionChange(); |
251 | void addQuickTodo(); | 252 | void addQuickTodo(); |
252 | void setTodoModified( Todo* ); | 253 | void setTodoModified( Todo* ); |
253 | void todoModified(Todo *, int ); | 254 | void todoModified(Todo *, int ); |
254 | 255 | ||
255 | private: | 256 | private: |
256 | /* | 257 | /* |
257 | * the TodoEditor approach is rather unscaling in the long | 258 | * the TodoEditor approach is rather unscaling in the long |
258 | * run. | 259 | * run. |
259 | * Korganizer keeps it in memory and we need to update | 260 | * Korganizer keeps it in memory and we need to update |
260 | * 1. make KOTodoViewItem a QObject again? | 261 | * 1. make KOTodoViewItem a QObject again? |
261 | * 2. add a public method for setting one todo modified? | 262 | * 2. add a public method for setting one todo modified? |
262 | * 3. add a private method for setting a todo modified + friend here? | 263 | * 3. add a private method for setting a todo modified + friend here? |
263 | * -- zecke 2002-07-08 | 264 | * -- zecke 2002-07-08 |
264 | */ | 265 | */ |
265 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; | 266 | KOTodoViewWhatsThis* mKOTodoViewWhatsThis; |
266 | friend class KOTodoListView; | 267 | friend class KOTodoListView; |
267 | void paintEvent(QPaintEvent * pevent); | 268 | void paintEvent(QPaintEvent * pevent); |
268 | bool mPendingUpdateBeforeRepaint; | 269 | bool mPendingUpdateBeforeRepaint; |
269 | friend class KOTodoViewItem; | 270 | friend class KOTodoViewItem; |
270 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 271 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
271 | void restoreItemState( QListViewItem * ); | 272 | void restoreItemState( QListViewItem * ); |
272 | 273 | ||
273 | bool checkTodo( Todo * ); | 274 | bool checkTodo( Todo * ); |
274 | bool isFlatDisplay; | 275 | bool isFlatDisplay; |
275 | void setOpen( QListViewItem*, bool setOpen); | 276 | void setOpen( QListViewItem*, bool setOpen); |
276 | KOTodoListView *mTodoListView; | 277 | KOTodoListView *mTodoListView; |
277 | QPopupMenu *mItemPopupMenu; | 278 | QPopupMenu *mItemPopupMenu; |
278 | QPopupMenu *mPopupMenu; | 279 | QPopupMenu *mPopupMenu; |
279 | QPopupMenu *mPriorityPopupMenu; | 280 | QPopupMenu *mPriorityPopupMenu; |
280 | QPopupMenu *mPercentageCompletedPopupMenu; | 281 | QPopupMenu *mPercentageCompletedPopupMenu; |
281 | QPopupMenu *mCategoryPopupMenu; | 282 | QPopupMenu *mCategoryPopupMenu; |
283 | QPopupMenu *mCalPopupMenu; | ||
282 | 284 | ||
283 | QMap<int, int> mPercentage; | 285 | QMap<int, int> mPercentage; |
284 | QMap<int, int> mPriority; | 286 | QMap<int, int> mPriority; |
285 | QMap<int, QString> mCategory; | 287 | QMap<int, QString> mCategory; |
286 | KOTodoViewItem *mActiveItem; | 288 | KOTodoViewItem *mActiveItem; |
287 | 289 | ||
288 | QMap<Todo *,KOTodoViewItem *> mTodoMap; | 290 | QMap<Todo *,KOTodoViewItem *> mTodoMap; |
289 | QString mName; | 291 | QString mName; |
290 | 292 | ||
291 | DocPrefs *mDocPrefs; | 293 | DocPrefs *mDocPrefs; |
292 | QString mCurrentDoc; | 294 | QString mCurrentDoc; |
293 | KOQuickTodo *mQuickAdd; | 295 | KOQuickTodo *mQuickAdd; |
294 | bool mBlockUpdate; | 296 | bool mBlockUpdate; |
295 | void keyPressEvent ( QKeyEvent * ) ; | 297 | void keyPressEvent ( QKeyEvent * ) ; |
296 | KOTodoViewItem * pendingSubtodo; | 298 | KOTodoViewItem * pendingSubtodo; |
297 | DateNavigator* mNavigator; | 299 | DateNavigator* mNavigator; |
298 | void storeCurrentItem(); | 300 | void storeCurrentItem(); |
299 | void resetCurrentItem(); | 301 | void resetCurrentItem(); |
300 | Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; | 302 | Incidence * mCurItem, *mCurItemRootParent, *mCurItemParent,*mCurItemAbove; |
301 | }; | 303 | }; |
302 | 304 | ||
303 | #endif | 305 | #endif |