OSDN Git Service

Merge branch 'post-2.4.2'
[tjqt4port/tj2qt4.git] / taskjuggler / XMLReport.h
1 /*
2  * XMLReport.h - TaskJuggler
3  *
4  * Copyright (c) 2002 by Chris Schlaeger <cs@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of version 2 of the GNU General Public License as
8  * published by the Free Software Foundation.
9  *
10  * $Id$
11  */
12 #ifndef _XMLReport_h_
13 #define _XMLReport_h_
14
15 #include <Report.h>
16
17 class Project;
18 class QDomDocument;
19 class QDomElement;
20 class CustomAttributeDefinition;
21 class Scenario;
22 class Shift;
23 class Account;
24 class Interval;
25 class TaskDependency;
26
27 class XMLReport : public Report
28 {
29 public:
30     XMLReport(Project* p, const QString& f, const QString& df, int dl);
31     virtual ~XMLReport();
32
33     virtual const char* getType() const { return "XMLReport"; }
34
35     bool generate();
36
37     bool addAccountAttribute(const QString& aa);
38     QStringList getAccountAttributes() const { return accountAttributes; }
39
40     bool addTaskAttribute(const QString& ta);
41     QStringList getTaskAttributes() const { return taskAttributes; }
42
43 private:
44     bool generateProjectProperty(QDomElement* n);
45     bool generateCustomAttributeDeclaration(QDomElement* parentEl,
46              const QString& propertyName,
47              QDictIterator<CustomAttributeDefinition> it);
48     bool generateScenario(QDomElement* parentEl, Scenario* scenario);
49
50     bool generateGlobalVacationList(QDomElement* parentNode);
51     bool generateShiftList(QDomElement* parentNode);
52     bool generateShift(QDomElement* parentEl, const Shift*);
53     bool generateWorkingHours(QDomElement* el,
54                               const QPtrList<Interval>* const* wh);
55     bool generateResourceList(QDomElement* parentNode, ResourceList& frl,
56                               TaskList& ftl);
57     bool generateResource(QDomElement* parentEl, ResourceList& frl,
58                           TaskList& ftl, const Resource* r);
59     bool generateAccountList(QDomElement* parentNode, AccountList& fal,
60                              TaskList& ftl);
61     bool generateAccount(QDomElement* parentEl, AccountList& fal,
62                          TaskList& ftl, const Account* a);
63     bool generateTaskList(QDomElement* parentNode, TaskList& ftl,
64                           ResourceList& frl);
65     bool generateTask(QDomElement* parentEl, TaskList& ftl, const Task* task);
66     bool generateDepList(QDomElement* el, TaskList& filteredTaskList,
67                          const Task* task,
68                          QPtrListIterator<TaskDependency> dl, bool prev);
69     bool generateCustomAttributeValue(QDomElement* parentEl,
70                                       const QString& id,
71                                       const CoreAttributes* property);
72     bool generateAllocate(QDomElement* el, const Task* t);
73
74     bool generateBookingList(QDomElement* parentEl, TaskList& ftl,
75                              ResourceList& frl);
76     void genTextAttr(QDomElement* el, const QString& name, const QString& text);
77     void genDoubleAttr(QDomElement* el, const QString& name, double val);
78     void genLongAttr(QDomElement* el, const QString& name, long val);
79
80     void genTextElement(QDomElement* parentEl, const QString& name,
81                         const QString& text);
82     void genDateElement(QDomElement* el, const QString& name, time_t val);
83     void genTimeElement(QDomElement* el, const QString& name, time_t val);
84
85     QDomDocument* doc;
86
87     QStringList accountAttributes;
88     QStringList taskAttributes;
89 };
90
91 #endif
92