OSDN Git Service

- Added better status reporting functions.
[tjqt4port/tj2qt4.git] / taskjuggler / ReportHtml.h
1 /*
2  * ReportHtml.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002 by Chris Schlaeger <cs@suse.de>
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
13 #ifndef _Report_Html_h_
14 #define _Report_Html_h_
15
16 #include <stdio.h>
17 #include <time.h>
18
19 #include <qstring.h>
20 #include <qstringlist.h>
21 #include <qcolor.h>
22 #include <qtextstream.h>
23 #include <qmap.h>
24
25 #include "Report.h"
26 #include "MacroTable.h"
27 #include "taskjuggler.h"
28
29 class Project;
30 class ExpressionTree;
31
32 /**
33  * @short Stores all information about an HTML report.
34  * @author Chris Schlaeger <cs@suse.de>
35  */
36 class ReportHtml : public Report
37 {
38 public:
39         ReportHtml(Project* p, const QString& f, time_t s, time_t e,
40                            const QString& df, int dl);
41         virtual ~ReportHtml() { }
42
43         enum BarLabelText { BLT_EMPTY = 0, BLT_LOAD };
44
45         void generatePlanTask(Task* t, Resource* r, uint no);
46         void generateActualTask(Task* t, Resource* r);
47
48         void generatePlanResource(Resource* r, Task* t, uint no);
49         void generateActualResource(Resource* r, Task* t);
50
51         void reportHTMLHeader();
52         void reportHTMLFooter();
53
54         bool generateTableHeader();
55
56         void generateDepends(Task* t, bool light);
57         void generateFollows(Task* t, bool light);
58         void generateResponsibilities(Resource* r, bool light);
59         void htmlDailyHeaderDays(bool highlightNow = TRUE);
60         void htmlDailyHeaderMonths();
61         void htmlWeeklyHeaderWeeks(bool highlightNow = TRUE);
62         void htmlWeeklyHeaderMonths();
63         void htmlMonthlyHeaderMonths(bool highlightNow = TRUE);
64         void htmlMonthlyHeaderYears();
65
66         void emptyPlan(bool light);
67         void emptyActual(bool light);
68
69         void textOneRow(const QString& text, bool light, const QString& align);
70         void textTwoRows(const QString& text, bool light, const QString& align);
71
72         void dailyResourcePlan(Resource* r, Task* t);
73         void dailyResourceActual(Resource* r, Task* t);
74         void dailyTaskPlan(Task* t, Resource* r);
75         void dailyTaskActual(Task* t, Resource* r);
76
77         void weeklyResourcePlan(Resource* r, Task* t);
78         void weeklyResourceActual(Resource* r, Task* t);
79         void weeklyTaskPlan(Task* t, Resource* r);
80         void weeklyTaskActual(Task* t, Resource* r);
81
82         void monthlyResourcePlan(Resource* r, Task* t);
83         void monthlyResourceActual(Resource* r, Task* t);
84         void monthlyTaskPlan(Task* t, Resource* r);
85         void monthlyTaskActual(Task* t, Resource* r);
86
87         void taskName(Task* t, Resource* r, bool big);
88         void resourceName(Resource* t, Task* t, bool big);
89
90         void planResources(Task* t, bool light);
91         void actualResources(Task* t, bool light);
92
93         void reportLoad(double load, const QString& bgcol, bool bold);
94         void reportPIDs(const QString& pids, const QString bgCol, bool bold);
95
96         void generateSchedule(int sc, Resource* r, Task* t);
97
98         void flagList(CoreAttributes* c1, CoreAttributes* c2);
99
100         void generateTaskStatus(TaskStatus status, bool light);
101
102         void setBarLabels(BarLabelText blt) { barLabels = blt; }
103
104         void registerUrl(const QString& key, const QString& url = QString::null)
105         {
106                 urls[key] = url;
107         }
108         bool setUrl(const QString& key, const QString& url);
109         const QString* getUrl(const QString& key) const;
110
111         void setRawHead(const QString& head)
112         {
113                 rawHead = head;
114         }
115
116         void setRawTail(const QString& tail)
117         {
118                 rawTail = tail;
119         }
120
121         void setRawStyleSheet(const QString& styleSheet)
122         {
123                 rawStyleSheet = styleSheet;
124         }
125         
126 protected:
127         ReportHtml() { }
128
129         QString htmlFilter(const QString& s);
130         QString generateUrl(const QString& key, const QString& txt);
131
132         MacroTable mt;
133
134         uint colDefault;
135         uint colDefaultLight;
136         uint colWeekend;
137         uint colVacation;
138         uint colAvailable;
139         uint colBooked;
140         uint colBookedLight;
141         uint colHeader;
142         uint colMilestone;
143         uint colCompleted;
144         uint colCompletedLight;
145         uint colToday;
146
147         BarLabelText barLabels;
148
149         QString rawHead;
150         QString rawTail;
151         QString rawStyleSheet;
152
153         QMap<QString, QString> urls;
154 } ;
155
156 #endif