kplato

kptreportview.h
1/* This file is part of the KDE project
2 Copyright (C) 2003 - 2005 Dag Andersen <danders@get2net.dk>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation;
7 version 2 of the License.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KPTREPORTVIEW_H
21#define KPTREPORTVIEW_H
22
23#include "kptcontext.h"
24#include "kptproject.h"
25#include "kpttask.h"
26#include "kptresource.h"
27#include "kptduration.h"
28#include <tqsplitter.h>
29#include <tqstring.h>
30
31#include <tdelistview.h>
32
33class TDEAction;
34class KPrinter;
35
36namespace Kugar
37{
38 class MReportViewer;
39} // Kugar namespace
40
41//class TQString;
42class TQStringList;
43class TQDomDocument;
44class TQDomNode;
45class TQIODevice;
46
47namespace KPlato
48{
49
50class View;
51class Node;
52class KugarReportViewer;
53class ReportTagsPrivate;
54
55class ReportView : public TQSplitter
56{
57 TQ_OBJECT
58
59
60 public:
61
62 ReportView(View *view, TQWidget *parent);
63
64 ~ReportView();
65
66 void zoom(double /*zoom*/) {}
67
68 void draw(const TQString &report);
69 View *mainView() const { return m_mainview; }
70
71 void setup(KPrinter &printer);
72 void print(KPrinter &printer);
73
74 void setReportData();
75
76 void getTemplateFile(const TQString &tpl);
77 void openTemplateFile(const TQString &file);
78 void loadTemplate(TQIODevice &dev);
79 void loadTemplate(TQDomDocument &doc);
80 void handleHeader(TQDomNode &node);
81 void handleDetail(TQDomElement &elem);
82 void handleKPlato(TQDomElement &elem);
83 void replaceTags(TQDomNode &node);
84
85 TQString setReportDetail();
86 TQString setTaskChildren(Node *node);
87 TQString setTaskDetail(Node *node);
88 TQStringList getProperties(TQDomElement &elem);
89
90 TQString setResourceDetail(Resource *res);
91 TQString setResourceGroupDetail(ResourceGroup *group);
92
93 TQString setDetail(const TQString &source, TQStringList &properties, TQString &level);
94
95 virtual bool setContext(Context::Reportview &context);
96 virtual void getContext(Context::Reportview &context) const;
97
98 void enableNavigationBtn();
99
100signals:
101 void setFirstPageActionEnabled(bool);
102 void setNextPageActionEnabled(bool);
103 void setPriorPageActionEnabled(bool);
104 void setLastPageActionEnabled(bool);
105
106public slots:
107 void slotFirstPage();
108 void slotNextPage();
109 void slotPrevPage();
110 void slotLastPage();
111
112protected slots:
113 void slotReportListClicked(TQListViewItem* item);
114 void slotReportListSelectionChanged(TQListViewItem* item);
115
116private:
117 class ReportItem : public TDEListViewItem {
118 public:
119 ReportItem(TDEListView *p, TQString name, TQString _url)
120 : TDEListViewItem(p, name),
121 url(_url)
122 {}
123 TQString url;
124 };
125 void initReportList();
126
127private:
128 View *m_mainview;
129 TDEListView *m_reportList;
130 KugarReportViewer *m_reportview;
131 int m_defaultFontSize;
132
133 TQDomDocument templateDoc;
134
135 ReportTagsPrivate *m_reportTags;
136};
137
138} //KPlato namespace
139
140#endif
This class represents any node in the project, a node can be a project or a subproject or any task.
Definition kptnode.h:57