kplato
kptresourceview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTRESOURCEVIEW_H
00021 #define KPTRESOURCEVIEW_H
00022
00023 #include <qsplitter.h>
00024 #include <qdatetime.h>
00025 #include <qvaluelist.h>
00026
00027 #include "kptcontext.h"
00028
00029 class QPoint;
00030 class QListViewItem;
00031
00032 class KPrinter;
00033
00034 namespace KPlato
00035 {
00036 class ResListView;
00037
00038 class View;
00039 class Project;
00040 class Resource;
00041 class Node;
00042
00043 class ResourceAppointmentsView;
00044 class ResourceGroup;
00045 class Resource;
00046 class ResourceItemPrivate;
00047
00048
00049 class ResourceView : public QSplitter
00050 {
00051 Q_OBJECT
00052
00053 public:
00054 ResourceView(View *view, QWidget *parent);
00055
00056
00057
00058 void zoom(double zoom);
00059
00060 void draw(Project &project);
00061 View *mainView();
00062
00063 Resource *currentResource();
00064
00065 QValueList<int> listOffsets(int pageHeight) const;
00066 void print(KPrinter &printer);
00067
00068 Node *currentNode() const { return m_currentNode; }
00069
00070 virtual bool setContext(Context::Resourceview &context);
00071 virtual void getContext(Context::Resourceview &context) const;
00072
00073 virtual QSize sizeHint() const;
00074
00075 public slots:
00076 void setShowAppointments(bool on) { m_showAppointments = on; }
00077
00078 signals:
00079 void itemDoubleClicked();
00080
00081 protected slots:
00082 void resSelectionChanged();
00083 void resSelectionChanged(QListViewItem *item);
00084 void slotItemDoubleClicked(QListViewItem*);
00085 void popupMenuRequested(QListViewItem * item, const QPoint & pos, int);
00086
00087 private:
00088 void drawResources(const Project &proj, QListViewItem *parent, ResourceGroup *group);
00089
00090 private:
00091 View *m_mainview;
00092 int m_defaultFontSize;
00093
00094 ResourceItemPrivate *m_selectedItem;
00095 ResListView *resList;
00096 ResourceAppointmentsView *m_appview;
00097 Node *m_currentNode;
00098 QDate m_start;
00099 QDate m_end;
00100
00101 bool m_showAppointments;
00102
00103 };
00104
00105 }
00106
00107 #endif
|