File: TableColumnInfo.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 (99 lines) | stat: -rw-r--r-- 2,698 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
/*
 * TableColumnInfo.h - TaskJuggler
 *
 * Copyright (c) 2001, 2002, 2003, 2004 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: TableColumnInfo.h 1259 2006-01-31 12:04:00Z cs $
 */

#ifndef _TableColumnInfo_h_
#define _TableColumnInfo_h_

#include <qmap.h>

class QString;
class ExpressionTree;

/**
 * @short A column of a report.
 * @author Chris Schlaeger <cs@kde.org>
 */
class TableColumnInfo
{
public:
    TableColumnInfo(uint sc, const QString& n) : name(n)
    {
        hideCellText = hideCellURL = 0;
        sum = memory = 0;
        maxScenarios = sc;
        subColumns = 0;
        clearSum();
        clearMemory();
    }
    ~TableColumnInfo();

    const QString& getName() const { return name; }

    void setTitle(const QString& t) { title = t; }
    const QString& getTitle() const { return title; }

    void setTitleURL(const QString& t) { titleURL = t; }
    const QString& getTitleURL() const { return titleURL; }

    void setSubTitle(const QString& t) { subTitle = t; }
    const QString& getSubTitle() const { return subTitle; }

    void setSubTitleURL(const QString& t) { subTitleURL = t; }
    const QString& getSubTitleURL() const { return subTitleURL; }

    void setCellText(const QString& t) { cellText = t; }
    const QString& getCellText() const { return cellText; }

    void setCellURL(const QString& t) { cellURL = t; }
    const QString& getCellURL() const { return cellURL; }

    void setHideCellText(ExpressionTree* et) { hideCellText = et; }
    ExpressionTree* getHideCellText() const { return hideCellText; }

    void setHideCellURL(ExpressionTree* et) { hideCellURL = et; }
    ExpressionTree* getHideCellURL() const { return hideCellURL; }

    void clearSum();
    void clearMemory();
    void addToSum(uint sc, const QString& key, double val);
    double getSum(uint sc, const QString& key) const { return sum[sc][key]; }
    QMap<QString, double>* getSum() { return sum; }
    void addSumToMemory(bool subtract);
    void negateMemory();
    void recallMemory();

    void increaseSubColumns() { ++subColumns; }
    uint getSubColumns() const { return subColumns; }

protected:
    QString name;
    uint maxScenarios;
    QString title;
    QString titleURL;
    QString subTitle;
    QString subTitleURL;
    QString cellText;
    QString cellURL;
    ExpressionTree* hideCellText;
    ExpressionTree* hideCellURL;

    QMap<QString, double>* sum;
    QMap<QString, double>* memory;

    uint subColumns;

private:
    TableColumnInfo() { }
} ;

#endif