File: CSVReportElement.h

package info (click to toggle)
taskjuggler 2.3.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,764 kB
  • ctags: 3,700
  • sloc: cpp: 36,852; sh: 12,761; xml: 5,541; perl: 5,207; makefile: 269; python: 258; lisp: 67
file content (166 lines) | stat: -rw-r--r-- 6,782 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
 * CSVReportElement.h - TaskJuggler
 *
 * Copyright (c) 2001, 2002, 2003, 2004, 2005 by Chris Schlaeger <cs@kde.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * $Id: CSVReportElement.h 1259 2006-01-31 12:04:00Z cs $
 */

#ifndef _CSVReportElement_h_
#define _CSVReportElement_h_

#include "ReportElement.h"
#include "CSVPrimitives.h"

class QColor;
class QString;

class Project;
class Report;
class ExpressionTree;
class TableLineInfo;
class TableCellInfo;
class Interval;

/**
 * @short Models the basic component of an CSV report.
 * @author Chris Schlaeger <cs@kde.org>
 */
class CSVReportElement : public ReportElement, public CSVPrimitives
{
public:
    CSVReportElement(Report* r, const QString& df, int dl);
    virtual ~CSVReportElement() { }

    virtual bool generate() = 0;

    virtual void genHeadDefault(TableCellInfo* tcf);
    virtual void genHeadCurrency(TableCellInfo* tcf);
    virtual void genHeadDaily1(TableCellInfo* tcf);
    virtual void genHeadDaily2(TableCellInfo* tcf);
    virtual void genHeadWeekly1(TableCellInfo* tcf);
    virtual void genHeadWeekly2(TableCellInfo* tcf);
    virtual void genHeadMonthly1(TableCellInfo* tcf);
    virtual void genHeadMonthly2(TableCellInfo* tcf);
    virtual void genHeadQuarterly1(TableCellInfo* tcf);
    virtual void genHeadQuarterly2(TableCellInfo* tcf);
    virtual void genHeadYear(TableCellInfo* tcf);

    virtual void genCellEmpty(TableCellInfo*);
    virtual void genCellSequenceNo(TableCellInfo* tli);
    virtual void genCellNo(TableCellInfo* tli);
    virtual void genCellHierarchNo(TableCellInfo* tli);
    virtual void genCellIndex(TableCellInfo* tli);
    virtual void genCellHierarchIndex(TableCellInfo* tli);
    virtual void genCellId(TableCellInfo* tli);
    virtual void genCellName(TableCellInfo* tli);
    virtual void genCellStart(TableCellInfo* tli);
    virtual void genCellEnd(TableCellInfo* tli);
    virtual void genCellMinStart(TableCellInfo* tli);
    virtual void genCellMaxStart(TableCellInfo* tli);
    virtual void genCellMinEnd(TableCellInfo* tli);
    virtual void genCellMaxEnd(TableCellInfo* tli);
    virtual void genCellStartBuffer(TableCellInfo* tli);
    virtual void genCellEndBuffer(TableCellInfo* tli);
    virtual void genCellStartBufferEnd(TableCellInfo* tli);
    virtual void genCellEndBufferStart(TableCellInfo* tli);
    virtual void genCellDuration(TableCellInfo* tli);
    virtual void genCellEffort(TableCellInfo* tli);
    virtual void genCellFreeLoad(TableCellInfo* tli);
    virtual void genCellUtilization(TableCellInfo* tli);
    virtual void genCellCriticalness(TableCellInfo* tli);
    virtual void genCellPathCriticalness(TableCellInfo* tli);
    virtual void genCellProjectId(TableCellInfo* tli);
    virtual void genCellProjectIDs(TableCellInfo* tli);
    virtual void genCellResources(TableCellInfo* tli);
    virtual void genCellResponsible(TableCellInfo* tli);
    virtual void genCellText(TableCellInfo* tli);
    virtual void genCellStatusNote(TableCellInfo* tli);
    virtual void genCellCost(TableCellInfo* tli);
    virtual void genCellRevenue(TableCellInfo* tli);
    virtual void genCellProfit(TableCellInfo* tli);
    virtual void genCellPriority(TableCellInfo* tli);
    virtual void genCellFlags(TableCellInfo* tli);
    virtual void genCellCompleted(TableCellInfo* tli);
    virtual void genCellStatus(TableCellInfo* tli);
    virtual void genCellReference(TableCellInfo* tli);
    virtual void genCellScenario(TableCellInfo* tli);
    virtual void genCellDepends(TableCellInfo* tli);
    virtual void genCellFollows(TableCellInfo* tli);
    virtual void genCellDailyTask(TableCellInfo* tli);
    virtual void genCellDailyResource(TableCellInfo* tli);
    virtual void genCellDailyAccount(TableCellInfo* tli);
    virtual void genCellWeeklyTask(TableCellInfo* tli);
    virtual void genCellWeeklyResource(TableCellInfo* tli);
    virtual void genCellWeeklyAccount(TableCellInfo* tli);
    virtual void genCellMonthlyTask(TableCellInfo* tli);
    virtual void genCellMonthlyResource(TableCellInfo* tli);
    virtual void genCellMonthlyAccount(TableCellInfo* tli);
    virtual void genCellQuarterlyTask(TableCellInfo* tli);
    virtual void genCellQuarterlyResource(TableCellInfo* tli);
    virtual void genCellQuarterlyAccount(TableCellInfo* tli);
    virtual void genCellYearlyTask(TableCellInfo* tli);
    virtual void genCellYearlyResource(TableCellInfo* tli);
    virtual void genCellYearlyAccount(TableCellInfo* tli);
    virtual void genCellResponsibilities(TableCellInfo* tli);
    virtual void genCellSchedule(TableCellInfo* tli);
    virtual void genCellMinEffort(TableCellInfo* tli);
    virtual void genCellMaxEffort(TableCellInfo* tli);
    virtual void genCellEfficiency(TableCellInfo* tli);
    virtual void genCellRate(TableCellInfo* tli);
    virtual void genCellKotrusId(TableCellInfo* tli);
    virtual void genCellTotal(TableCellInfo* tli);

    virtual void genCellSummary(TableCellInfo* tli);

    void setFieldSeparator(const QString fs) { fieldSeparator = fs; }

protected:
    CSVReportElement() { }

    void generateTableHeader();

    void generateHeader();
    void generateFooter();

    void generateLine(TableLineInfo* tli, int funcSel);

    void genCell(const QString& text, TableCellInfo* tli, bool multi,
                 bool filter = TRUE);

    void generateTitle(TableCellInfo* tci, const QString& str);

    void generateSubTitle(TableCellInfo* tci, const QString& str);

    void generateRightIndented(TableCellInfo* tci, const QString& str);

    QColor selectTaskBgColor(TableCellInfo* tci, double load,
                             const Interval& period, bool daily);
    QColor selectResourceBgColor(TableCellInfo* tci, double load,
                                 const Interval& period, bool daily);

    void reportTaskLoad(double load, TableCellInfo* tci,
                        const Interval& period);
    void reportResourceLoad(double load, TableCellInfo* tci,
                            const Interval& period);

    void reportCurrency(double value, TableCellInfo* tci, time_t iv_start);

    void genCellTaskFunc(TableCellInfo* tci,
                         time_t (*beginOfT)(time_t),
                         time_t (*sameTimeNextT)(time_t));
    void genCellResourceFunc(TableCellInfo* tci,
                             time_t (*beginOfT)(time_t),
                             time_t (*sameTimeNextT)(time_t));
    void genCellAccountFunc(TableCellInfo* tci,
                            time_t (*beginOfT)(time_t),
                            time_t (*sameTimeNextT)(time_t));

    QString fieldSeparator;
} ;

#endif