OSDN Git Service

fix compile problem
[tjqt4port/tj2qt4.git] / taskjuggler / ReportElementBase.h
1 /*
2  * ReportElement.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003, 2004 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: ReportElement.h 1335 2006-09-24 13:49:05Z cs $
11  */
12
13 #ifndef _ReportElementBase_h_
14 #define _ReportElementBase_h_
15
16 #include "Report.h"
17 #include "MacroTable.h"
18 //Added by qt3to4:
19 #include <Q3ValueList>
20
21 class TableLineInfo;
22
23 /**
24  * @short A class that forms the base for elements of a report.
25  * @author Chris Schlaeger <cs@kde.org>
26  */
27 class ReportElementBase {
28 public:
29     ReportElementBase(Report* r, const QString& df = "", int dl = 0);
30     virtual ~ReportElementBase() { }
31
32     QString scaledDuration(double t, const RealFormat& realFormat,
33                            bool showUnit = false, bool longUnit = false) const;
34     QString scaledLoad(double t, const RealFormat& realFormat,
35                        bool showUnit = false, bool longUnit = false) const;
36
37     bool setLoadUnit(const QString& u);
38
39     const RealFormat& getNumberFormat() const { return numberFormat; }
40
41     void setMacros(TableLineInfo* tli);
42
43     void setPropertyMacros(TableLineInfo* tli,
44                            const Q3DictIterator<CustomAttributeDefinition>& d);
45
46     const QString expandReportVariable(const QString& t) const;
47
48 protected:
49     QString scaledValue(double t, const RealFormat& realFormat,
50                         bool showUnit, bool longUnit,
51                         const Q3ValueList<double>& factors) const;
52
53     Report* report;
54
55     LoadUnit loadUnit;
56
57     RealFormat numberFormat;
58     RealFormat currencyFormat;
59
60     MacroTable mt;
61
62     /* We store the location of the report definition in case we need it
63      * for error reporting. */
64     QString defFileName;
65     int defFileLine;
66
67
68 };
69
70 #endif
71