2 * ReportElement.h - TaskJuggler
4 * Copyright (c) 2001, 2002, 2003, 2004 by Chris Schlaeger <cs@kde.org>
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.
10 * $Id: ReportElement.h 1335 2006-09-24 13:49:05Z cs $
13 #ifndef _ReportElementBase_h_
14 #define _ReportElementBase_h_
17 #include "MacroTable.h"
19 #include <Q3ValueList>
24 * @short A class that forms the base for elements of a report.
25 * @author Chris Schlaeger <cs@kde.org>
27 class ReportElementBase {
29 ReportElementBase(Report* r, const QString& df = "", int dl = 0);
30 virtual ~ReportElementBase() { }
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;
37 bool setLoadUnit(const QString& u);
39 const RealFormat& getNumberFormat() const { return numberFormat; }
41 void setMacros(TableLineInfo* tli);
43 void setPropertyMacros(TableLineInfo* tli,
44 const Q3DictIterator<CustomAttributeDefinition>& d);
46 const QString expandReportVariable(const QString& t) const;
49 QString scaledValue(double t, const RealFormat& realFormat,
50 bool showUnit, bool longUnit,
51 const Q3ValueList<double>& factors) const;
57 RealFormat numberFormat;
58 RealFormat currencyFormat;
62 /* We store the location of the report definition in case we need it
63 * for error reporting. */