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"
22 * @short A class that forms the base for elements of a report.
23 * @author Chris Schlaeger <cs@kde.org>
25 class ReportElementBase {
27 ReportElementBase(Report* r, const QString& df = "", int dl = 0);
28 virtual ~ReportElementBase() { }
30 QString scaledDuration(double t, const RealFormat& realFormat,
31 bool showUnit = false, bool longUnit = false) const;
32 QString scaledLoad(double t, const RealFormat& realFormat,
33 bool showUnit = false, bool longUnit = false) const;
35 bool setLoadUnit(const QString& u);
37 const RealFormat& getNumberFormat() const { return numberFormat; }
39 void setMacros(TableLineInfo* tli);
41 void setPropertyMacros(TableLineInfo* tli,
42 const QDictIterator<CustomAttributeDefinition>& d);
44 const QString expandReportVariable(const QString& t) const;
47 QString scaledValue(double t, const RealFormat& realFormat,
48 bool showUnit, bool longUnit,
49 const QValueList<double>& factors) const;
55 RealFormat numberFormat;
56 RealFormat currencyFormat;
60 /* We store the location of the report definition in case we need it
61 * for error reporting. */