Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/views/reports/core/pivotgrid.h
Show All 28 Lines | |||||
29 | // KDE Includes | 29 | // KDE Includes | ||
30 | 30 | | |||
31 | // ---------------------------------------------------------------------------- | 31 | // ---------------------------------------------------------------------------- | ||
32 | // Project Includes | 32 | // Project Includes | ||
33 | 33 | | |||
34 | #include "reportaccount.h" | 34 | #include "reportaccount.h" | ||
35 | #include "mymoneymoney.h" | 35 | #include "mymoneymoney.h" | ||
36 | 36 | | |||
37 | class QDomDocument; | ||||
38 | class QDomElement; | ||||
39 | | ||||
37 | namespace reports | 40 | namespace reports | ||
38 | { | 41 | { | ||
39 | 42 | | |||
40 | enum ERowType {eActual, eBudget, eBudgetDiff, eForecast, eAverage, ePrice }; | 43 | enum ERowType {eActual, eBudget, eBudgetDiff, eForecast, eAverage, ePrice }; | ||
41 | 44 | | |||
42 | /** | 45 | /** | ||
43 | * The fundamental data construct of this class is a 'grid'. It is organized as follows: | 46 | * The fundamental data construct of this class is a 'grid'. It is organized as follows: | ||
44 | * | 47 | * | ||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
89 | class PivotGridRow: public QList<PivotCell> | 92 | class PivotGridRow: public QList<PivotCell> | ||
90 | { | 93 | { | ||
91 | public: | 94 | public: | ||
92 | 95 | | |||
93 | explicit PivotGridRow(unsigned _numcolumns = 0) { | 96 | explicit PivotGridRow(unsigned _numcolumns = 0) { | ||
94 | for (uint i = 0; i < _numcolumns; i++) | 97 | for (uint i = 0; i < _numcolumns; i++) | ||
95 | append(PivotCell()); | 98 | append(PivotCell()); | ||
96 | } | 99 | } | ||
100 | bool saveToXml(QDomDocument &doc, QDomElement &parent); | ||||
97 | MyMoneyMoney m_total; | 101 | MyMoneyMoney m_total; | ||
98 | }; | 102 | }; | ||
99 | 103 | | |||
100 | class PivotGridRowSet: public QMap<ERowType, PivotGridRow> | 104 | class PivotGridRowSet: public QMap<ERowType, PivotGridRow> | ||
101 | { | 105 | { | ||
102 | public: | 106 | public: | ||
103 | explicit PivotGridRowSet(unsigned _numcolumns = 0); | 107 | explicit PivotGridRowSet(unsigned _numcolumns = 0); | ||
108 | bool saveToXml(QDomDocument &doc, QDomElement &el); | ||||
104 | }; | 109 | }; | ||
105 | 110 | | |||
106 | class PivotInnerGroup: public QMap<ReportAccount, PivotGridRowSet> | 111 | class PivotInnerGroup: public QMap<ReportAccount, PivotGridRowSet> | ||
107 | { | 112 | { | ||
108 | public: | 113 | public: | ||
109 | explicit PivotInnerGroup(unsigned _numcolumns = 0): m_total(_numcolumns) {} | 114 | explicit PivotInnerGroup(unsigned _numcolumns = 0): m_total(_numcolumns) {} | ||
115 | bool saveToXml(QDomDocument &doc, QDomElement &parent); | ||||
110 | 116 | | |||
111 | PivotGridRowSet m_total; | 117 | PivotGridRowSet m_total; | ||
112 | }; | 118 | }; | ||
113 | 119 | | |||
114 | class PivotOuterGroup: public QMap<QString, PivotInnerGroup> | 120 | class PivotOuterGroup: public QMap<QString, PivotInnerGroup> | ||
115 | { | 121 | { | ||
116 | public: | 122 | public: | ||
117 | explicit PivotOuterGroup(unsigned _numcolumns = 0, unsigned _sort = m_kDefaultSortOrder, bool _inverted = false): m_total(_numcolumns), m_inverted(_inverted), m_sortOrder(_sort) {} | 123 | explicit PivotOuterGroup(unsigned _numcolumns = 0, unsigned _sort = m_kDefaultSortOrder, bool _inverted = false): m_total(_numcolumns), m_inverted(_inverted), m_sortOrder(_sort) {} | ||
Show All 24 Lines | |||||
142 | static const unsigned m_kDefaultSortOrder; | 148 | static const unsigned m_kDefaultSortOrder; | ||
143 | }; | 149 | }; | ||
144 | class PivotGrid: public QMap<QString, PivotOuterGroup> | 150 | class PivotGrid: public QMap<QString, PivotOuterGroup> | ||
145 | { | 151 | { | ||
146 | public: | 152 | public: | ||
147 | PivotGridRowSet rowSet(QString id); | 153 | PivotGridRowSet rowSet(QString id); | ||
148 | 154 | | |||
149 | PivotGridRowSet m_total; | 155 | PivotGridRowSet m_total; | ||
156 | bool saveToXml(QDomDocument &doc, QDomElement &parent); | ||||
157 | bool loadFromXml(QDomDocument &doc, QDomElement &parent); | ||||
150 | }; | 158 | }; | ||
151 | 159 | | |||
152 | } | 160 | } | ||
153 | 161 | | |||
154 | #endif | 162 | #endif | ||
155 | // PIVOTGRID_H | 163 | // PIVOTGRID_H |