OSDN Git Service

Merge branch 'post-2.4.2'
[tjqt4port/tj2qt4.git] / taskjuggler / ExportReport.h
1 /*
2  * ExportReport.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 _ExportReport_h_
13 #define _ExportReport_h_
14
15 #include <Report.h>
16 #include <TaskDependency.h>
17
18 class Project;
19 class CustomAttributeDefinition;
20 class Scenario;
21 class Shift;
22
23 class ExportReport : public Report
24 {
25 public:
26     ExportReport(Project* p, const QString& f, const QString& df, int dl);
27     virtual ~ExportReport() { }
28
29     virtual const char* getType() const { return "ExportReport"; }
30
31     bool generate();
32
33     bool addTaskAttribute(const QString& ta);
34     QStringList getTaskAttributes() const { return taskAttributes; }
35
36     void setMasterFile(bool mf) { masterFile = mf; }
37
38     void resetContentFlags();
39     void setListShifts(bool ls) { listShifts = ls; }
40     void setListResources(bool lr) { listResources = lr; }
41     void setListTasks(bool lt) { listTasks = lt; }
42     void setListBookings(bool lb) { listBookings = lb; }
43
44 private:
45     bool generateProjectProperty();
46     bool generateCustomAttributeDeclaration(const QString& propertyName,
47              QDictIterator<CustomAttributeDefinition> it);
48     bool generateScenario(const Scenario* scenario, int indent);
49     bool generateShiftList();
50     bool generateShift(const Shift*, int indent);
51     void generateResourceVacations(const Resource* resource, int indent);
52     void generateVacations();
53     bool generateWorkingHours(const QPtrList<Interval>* const* wh,
54                               const QPtrList<Interval>* const* ref,
55                               int indent);
56     bool generateProjectIds(const TaskList& tasks);
57     bool generateResourceList(ResourceList& frl, TaskList& ftl);
58     bool generateResource(ResourceList& frl, const Resource* r, int ident);
59     bool generateTaskList(TaskList& ftl, ResourceList& frl);
60     bool generateTask(TaskList& ftl, const Task* task, int indent);
61     bool generateTaskAttributeList(TaskList& ftl);
62     bool generateTaskSupplement(TaskList& ftl, const Task* task, int indent);
63     bool generateDepList(TaskList& filteredTaskList, const Task* task,
64                          QPtrListIterator<TaskDependency> depIt, bool prev,
65                          int indent);
66     bool generateResourceAttributesList(TaskList& ftl, ResourceList& frl);
67     bool generateCustomAttributeValue(const QString& id,
68                                       const CoreAttributes* property,
69                                       int indent);
70
71     QStringList taskAttributes;
72
73     // True if the file should be a standalone project (*.tjp file).
74     bool masterFile;
75
76     bool listShifts;
77     bool listTasks;
78     bool listResources;
79     bool listBookings;
80 };
81
82 #endif
83