kotodoview.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KOTODOVIEW_H
00025 #define KOTODOVIEW_H
00026
00027 #include <qmap.h>
00028 #include <qtooltip.h>
00029
00030 #include <klistview.h>
00031
00032 #include <libkcal/todo.h>
00033 #include <korganizer/baseview.h>
00034 #include "calprinter.h"
00035
00036 class QDragEnterEvent;
00037 class QDragMoveEvent;
00038 class QDragLeaveEvent;
00039 class QDropEvent;
00040 class QPopupMenu;
00041
00042 class KOTodoListView;
00043 class KOTodoViewItem;
00044 class KDatePickerPopup;
00045
00046 class DocPrefs;
00047
00048 namespace KPIM {
00049 class ClickLineEdit;
00050 }
00051 namespace KCal {
00052 class Incidence;
00053 class Calendar;
00054 }
00055 using namespace KCal;
00056
00057 class KOTodoListViewToolTip : public QToolTip
00058 {
00059 public:
00060 KOTodoListViewToolTip( QWidget *parent, KOTodoListView *lv );
00061
00062 protected:
00063 void maybeTip( const QPoint &pos );
00064
00065 private:
00066 KOTodoListView *todolist;
00067 };
00068
00069
00070 class KOTodoListView : public KListView
00071 {
00072 Q_OBJECT
00073 public:
00074 KOTodoListView( QWidget *parent = 0, const char *name = 0 );
00075 ~KOTodoListView();
00076
00077 void setCalendar( Calendar * );
00078 Calendar * calendar() const { return mCalendar; }
00079
00080 signals:
00081 void incidenceAdded( Incidence* );
00082 void incidenceChanged( Incidence*, Incidence* );
00083 void incidenceDeleted( Incidence* );
00084 void incidenceToBeDeleted( Incidence* );
00085
00086 protected:
00087 virtual bool event( QEvent * );
00088
00089 void contentsDragEnterEvent( QDragEnterEvent * );
00090 void contentsDragMoveEvent( QDragMoveEvent * );
00091 void contentsDragLeaveEvent( QDragLeaveEvent * );
00092 void contentsDropEvent( QDropEvent * );
00093
00094 void contentsMousePressEvent( QMouseEvent * );
00095 void contentsMouseMoveEvent( QMouseEvent * );
00096 void contentsMouseReleaseEvent( QMouseEvent * );
00097 void contentsMouseDoubleClickEvent( QMouseEvent * );
00098
00099 private:
00100 Calendar *mCalendar;
00101
00102 QPoint mPressPos;
00103 bool mMousePressed;
00104 QListViewItem *mOldCurrent;
00105 KOTodoListViewToolTip *tooltip;
00106 };
00107
00108
00115 class KOTodoView : public KOrg::BaseView
00116 {
00117 Q_OBJECT
00118 public:
00119 KOTodoView( Calendar *cal, QWidget *parent = 0, const char *name = 0 );
00120 ~KOTodoView();
00121
00122 void setCalendar( Calendar * );
00123
00124 Incidence::List selectedIncidences();
00125 Todo::List selectedTodos();
00126
00127 DateList selectedDates() { return DateList(); }
00128
00130 int currentDateCount() { return 0; }
00131
00132 void printPreview( CalPrinter *calPrinter, const QDate &fd,
00133 const QDate &td );
00134
00135 CalPrinter::PrintType printType();
00136
00137 void setDocumentId( const QString & );
00138
00139 void saveLayout( KConfig *config, const QString &group ) const;
00140 void restoreLayout( KConfig *config, const QString &group );
00142 QPopupMenu *getCategoryPopupMenu( KOTodoViewItem *todoItem );
00143
00144 public slots:
00145 void updateView();
00146 void updateConfig();
00147
00148 void changeIncidenceDisplay( Incidence *, int );
00149
00150 void showDates( const QDate &start, const QDate &end );
00151 void showIncidences( const Incidence::List & );
00152
00153 void clearSelection();
00154
00155 void editItem( QListViewItem *item, const QPoint &, int );
00156 void editItem( QListViewItem *item );
00157 void showItem( QListViewItem *item, const QPoint &, int );
00158 void showItem( QListViewItem *item );
00159 void popupMenu( QListViewItem *item, const QPoint &, int );
00160 void newTodo();
00161 void newSubTodo();
00162 void showTodo();
00163 void editTodo();
00164 void deleteTodo();
00165
00166 void setNewPriority( int );
00167 void setNewPercentage( int );
00168 void setNewDate( QDate );
00169 void copyTodoToDate( QDate );
00170 void changedCategories( int );
00171
00172 void purgeCompleted();
00173
00174 void itemStateChanged( QListViewItem * );
00175 void setTodoModified( Todo *oldTodo, Todo *todo )
00176 {
00177 emit incidenceChanged( oldTodo, todo );
00178 }
00179 void emitCompletedSignal( Todo * );
00180
00181 signals:
00182 void unSubTodoSignal();
00183
00184 void todoCompleted( Todo * );
00185
00186 void purgeCompletedSignal();
00187
00188 protected slots:
00189 void processSelectionChange();
00190 void addQuickTodo();
00191 void removeTodoItems();
00192
00193 private:
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203 friend class KOTodoViewItem;
00204
00205 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem( Todo *todo );
00206 bool scheduleRemoveTodoItem( KOTodoViewItem *todoItem );
00207 void restoreItemState( QListViewItem * );
00208
00209 KOTodoListView *mTodoListView;
00210 QPopupMenu *mItemPopupMenu;
00211 QPopupMenu *mPopupMenu;
00212 QPopupMenu *mPriorityPopupMenu;
00213 QPopupMenu *mPercentageCompletedPopupMenu;
00214 QPopupMenu *mCategoryPopupMenu;
00215 KDatePickerPopup *mMovePopupMenu;
00216 KDatePickerPopup *mCopyPopupMenu;
00217
00218 QMap<int, int> mPercentage;
00219 QMap<int, int> mPriority;
00220 QMap<int, QString> mCategory;
00221
00222 KOTodoViewItem *mActiveItem;
00223
00224 QMap<Todo *,KOTodoViewItem *> mTodoMap;
00225 QPtrList<KOTodoViewItem> mItemsToDelete;
00226
00227 DocPrefs *mDocPrefs;
00228 QString mCurrentDoc;
00229 KPIM::ClickLineEdit *mQuickAdd;
00230
00231 static const int POPUP_UNSUBTODO;
00232 };
00233
00234 #endif
This file is part of the documentation for korganizer Library Version 3.3.2.