kontact
todosummarywidget.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef TODO_SUMMARYWIDGET_H
00027 #define TODO_SUMMARYWIDGET_H
00028
00029 #include <kontactinterfaces/summary.h>
00030 #include <QList>
00031
00032 namespace KCal {
00033 class CalendarResources;
00034 class Todo;
00035 }
00036
00037 class TodoPlugin;
00038
00039 class QEvent;
00040 class QGridLayout;
00041 class QLabel;
00042 class QWidget;
00043
00044 class TodoSummaryWidget : public Kontact::Summary
00045 {
00046 Q_OBJECT
00047
00048 public:
00049 TodoSummaryWidget( TodoPlugin *plugin, QWidget *parent );
00050 ~TodoSummaryWidget();
00051
00052 int summaryHeight() const { return 3; }
00053 QStringList configModules() const;
00054
00055 public slots:
00056 void updateSummary( bool force = false )
00057 {
00058 Q_UNUSED( force );
00059 updateView();
00060 }
00061
00062 protected:
00063 virtual bool eventFilter( QObject *obj, QEvent *e );
00064
00065 private slots:
00066 void updateView();
00067 void popupMenu( const QString &uid );
00068 void viewTodo( const QString &uid );
00069 void removeTodo( const QString &uid );
00070 void completeTodo( const QString &uid );
00071
00072 private:
00073 TodoPlugin *mPlugin;
00074 QGridLayout *mLayout;
00075
00076 bool mDaysToGo;
00077 bool mHideInProgress;
00078 bool mHideOverdue;
00079 bool mHideCompleted;
00080 bool mHideOpenEnded;
00081 bool mHideNotStarted;
00082
00083 QList<QLabel*> mLabels;
00084 KCal::CalendarResources *mCalendar;
00085
00086
00087
00093 bool inProgress( KCal::Todo *todo );
00099 bool overdue( KCal::Todo *todo );
00105 bool starts( KCal::Todo *todo );
00111 bool completed( KCal::Todo *todo );
00117 bool openEnded( KCal::Todo *todo );
00123 bool notStarted( KCal::Todo *todo );
00124
00130 const QString stateStr( KCal::Todo *todo );
00131 };
00132
00133 #endif