kplato
kptreportview.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KPTREPORTVIEW_H
00021 #define KPTREPORTVIEW_H
00022
00023 #include "kptcontext.h"
00024 #include "kptproject.h"
00025 #include "kpttask.h"
00026 #include "kptresource.h"
00027 #include "kptduration.h"
00028 #include <qsplitter.h>
00029 #include <qstring.h>
00030
00031 #include <klistview.h>
00032
00033 class KAction;
00034 class KPrinter;
00035
00036 namespace Kugar
00037 {
00038 class MReportViewer;
00039 }
00040
00041
00042 class QStringList;
00043 class QDomDocument;
00044 class QDomNode;
00045 class QIODevice;
00046
00047 namespace KPlato
00048 {
00049
00050 class View;
00051 class Node;
00052 class KugarReportViewer;
00053 class ReportTagsPrivate;
00054
00055 class ReportView : public QSplitter
00056 {
00057 Q_OBJECT
00058
00059 public:
00060
00061 ReportView(View *view, QWidget *parent);
00062
00063 ~ReportView();
00064
00065 void zoom(double ) {}
00066
00067 void draw(const QString &report);
00068 View *mainView() const { return m_mainview; }
00069
00070 void setup(KPrinter &printer);
00071 void print(KPrinter &printer);
00072
00073 void setReportData();
00074
00075 void getTemplateFile(const QString &tpl);
00076 void openTemplateFile(const QString &file);
00077 void loadTemplate(QIODevice &dev);
00078 void loadTemplate(QDomDocument &doc);
00079 void handleHeader(QDomNode &node);
00080 void handleDetail(QDomElement &elem);
00081 void handleKPlato(QDomElement &elem);
00082 void replaceTags(QDomNode &node);
00083
00084 QString setReportDetail();
00085 QString setTaskChildren(Node *node);
00086 QString setTaskDetail(Node *node);
00087 QStringList getProperties(QDomElement &elem);
00088
00089 QString setResourceDetail(Resource *res);
00090 QString setResourceGroupDetail(ResourceGroup *group);
00091
00092 QString setDetail(const QString &source, QStringList &properties, QString &level);
00093
00094 virtual bool setContext(Context::Reportview &context);
00095 virtual void getContext(Context::Reportview &context) const;
00096
00097 void enableNavigationBtn();
00098
00099 signals:
00100 void setFirstPageActionEnabled(bool);
00101 void setNextPageActionEnabled(bool);
00102 void setPriorPageActionEnabled(bool);
00103 void setLastPageActionEnabled(bool);
00104
00105 public slots:
00106 void slotFirstPage();
00107 void slotNextPage();
00108 void slotPrevPage();
00109 void slotLastPage();
00110
00111 protected slots:
00112 void slotReportListClicked(QListViewItem* item);
00113 void slotReportListSelectionChanged(QListViewItem* item);
00114
00115 private:
00116 class ReportItem : public KListViewItem {
00117 public:
00118 ReportItem(KListView *p, QString name, QString _url)
00119 : KListViewItem(p, name),
00120 url(_url)
00121 {}
00122 QString url;
00123 };
00124 void initReportList();
00125
00126 private:
00127 View *m_mainview;
00128 KListView *m_reportList;
00129 KugarReportViewer *m_reportview;
00130 int m_defaultFontSize;
00131
00132 QDomDocument templateDoc;
00133
00134 ReportTagsPrivate *m_reportTags;
00135 };
00136
00137 }
00138
00139 #endif
|