OSDN Git Service

- Added support for hidecelltext and hidecellurl.
[tjqt4port/tj2qt4.git] / taskjuggler / TableColumnInfo.h
1 /*
2  * TableColumnInfo.h - TaskJuggler
3  *
4  * Copyright (c) 2001, 2002, 2003 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 _TableColumnInfo_h_
14 #define _TableColumnInfo_h_
15
16 #include <qmap.h>
17
18 class QString;
19 class ExpressionTree;
20
21 /**
22  * @short A column of a report.
23  * @author Chris Schlaeger <cs@suse.de>
24  */
25 class TableColumnInfo
26 {
27 public:
28     TableColumnInfo(uint sc, const QString& n) : name(n)
29     {
30         hideCellText = hideCellURL = 0;
31         sum = memory = 0;
32         maxScenarios = sc;
33         clearSum();
34         clearMemory();
35     }
36     ~TableColumnInfo()
37     {
38         delete [] sum;
39         delete [] memory;
40     }
41
42     const QString& getName() const { return name; }
43
44     void setTitle(const QString& t) { title = t; }
45     const QString& getTitle() const { return title; }
46
47     void setTitleURL(const QString& t) { titleURL = t; }
48     const QString& getTitleURL() const { return titleURL; }
49
50     void setSubTitle(const QString& t) { subTitle = t; }
51     const QString& getSubTitle() const { return subTitle; }
52
53     void setSubTitleURL(const QString& t) { subTitleURL = t; }
54     const QString& getSubTitleURL() const { return subTitleURL; }
55
56     void setCellText(const QString& t) { cellText = t; }
57     const QString& getCellText() const { return cellText; }
58
59     void setCellURL(const QString& t) { cellURL = t; }
60     const QString& getCellURL() const { return cellURL; }
61
62     void setHideCellText(ExpressionTree* et) { hideCellText = et; }
63     ExpressionTree* getHideCellText() const { return hideCellText; }
64
65     void setHideCellURL(ExpressionTree* et) { hideCellURL = et; }
66     ExpressionTree* getHideCellURL() const { return hideCellURL; }
67
68     void clearSum();
69     void clearMemory();
70     void addToSum(uint sc, const QString& key, double val);
71     double getSum(uint sc, const QString& key) const { return sum[sc][key]; }
72     QMap<QString, double>* getSum() { return sum; }
73     void addSumToMemory(bool subtract);
74     void negateMemory();
75     void recallMemory();
76     
77 protected:
78     QString name;
79     uint maxScenarios;
80     QString title;
81     QString titleURL;
82     QString subTitle;
83     QString subTitleURL;
84     QString cellText;
85     QString cellURL;
86     ExpressionTree* hideCellText;
87     ExpressionTree* hideCellURL;
88
89     QMap<QString, double>* sum;
90     QMap<QString, double>* memory;
91
92 private:
93     TableColumnInfo() { }
94 } ;
95
96 #endif
97