Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyreport_p.h
Show All 34 Lines | |||||
35 | // ---------------------------------------------------------------------------- | 35 | // ---------------------------------------------------------------------------- | ||
36 | // Project Includes | 36 | // Project Includes | ||
37 | 37 | | |||
38 | #include "mymoneyobject_p.h" | 38 | #include "mymoneyobject_p.h" | ||
39 | #include "mymoneyenums.h" | 39 | #include "mymoneyenums.h" | ||
40 | 40 | | |||
41 | using namespace eMyMoney; | 41 | using namespace eMyMoney; | ||
42 | 42 | | |||
43 | namespace Report | 43 | namespace Reporting | ||
44 | { | 44 | { | ||
45 | enum class Element { Payee, | 45 | enum class Element { Payee, | ||
46 | Tag, | 46 | Tag, | ||
47 | Account, | 47 | Account, | ||
48 | Text, | 48 | Text, | ||
49 | Type, | 49 | Type, | ||
50 | State, | 50 | State, | ||
51 | Number, | 51 | Number, | ||
Show All 27 Lines | 59 | enum class Attribute { ID, Group, Type, Name, Comment, ConvertCurrency, Favorite, | |||
79 | }; | 79 | }; | ||
80 | uint qHash(const Attribute key, uint seed) { return ::qHash(static_cast<uint>(key), seed); } | 80 | uint qHash(const Attribute key, uint seed) { return ::qHash(static_cast<uint>(key), seed); } | ||
81 | } | 81 | } | ||
82 | 82 | | |||
83 | class MyMoneyReportPrivate : public MyMoneyObjectPrivate | 83 | class MyMoneyReportPrivate : public MyMoneyObjectPrivate | ||
84 | { | 84 | { | ||
85 | public: | 85 | public: | ||
86 | 86 | | |||
87 | static QString getElName(const Report::Element el) | 87 | static QString getElName(const Reporting::Element el) | ||
88 | { | 88 | { | ||
89 | static const QHash<Report::Element, QString> elNames { | 89 | static const QHash<Reporting::Element, QString> elNames { | ||
90 | {Report::Element::Payee, QStringLiteral("PAYEE")}, | 90 | {Reporting::Element::Payee, QStringLiteral("PAYEE")}, | ||
91 | {Report::Element::Tag, QStringLiteral("TAG")}, | 91 | {Reporting::Element::Tag, QStringLiteral("TAG")}, | ||
92 | {Report::Element::Account, QStringLiteral("ACCOUNT")}, | 92 | {Reporting::Element::Account, QStringLiteral("ACCOUNT")}, | ||
93 | {Report::Element::Text, QStringLiteral("TEXT")}, | 93 | {Reporting::Element::Text, QStringLiteral("TEXT")}, | ||
94 | {Report::Element::Type, QStringLiteral("TYPE")}, | 94 | {Reporting::Element::Type, QStringLiteral("TYPE")}, | ||
95 | {Report::Element::State, QStringLiteral("STATE")}, | 95 | {Reporting::Element::State, QStringLiteral("STATE")}, | ||
96 | {Report::Element::Number, QStringLiteral("NUMBER")}, | 96 | {Reporting::Element::Number, QStringLiteral("NUMBER")}, | ||
97 | {Report::Element::Amount, QStringLiteral("AMOUNT")}, | 97 | {Reporting::Element::Amount, QStringLiteral("AMOUNT")}, | ||
98 | {Report::Element::Dates, QStringLiteral("DATES")}, | 98 | {Reporting::Element::Dates, QStringLiteral("DATES")}, | ||
99 | {Report::Element::Category, QStringLiteral("CATEGORY")}, | 99 | {Reporting::Element::Category, QStringLiteral("CATEGORY")}, | ||
100 | {Report::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} | 100 | {Reporting::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} | ||
101 | }; | 101 | }; | ||
102 | return elNames[el]; | 102 | return elNames[el]; | ||
103 | } | 103 | } | ||
104 | 104 | | |||
105 | static QString getAttrName(const Report::Attribute attr) | 105 | static QString getAttrName(const Reporting::Attribute attr) | ||
106 | { | 106 | { | ||
107 | static const QHash<Report::Attribute, QString> attrNames { | 107 | static const QHash<Reporting::Attribute, QString> attrNames { | ||
108 | {Report::Attribute::ID, QStringLiteral("id")}, | 108 | {Reporting::Attribute::ID, QStringLiteral("id")}, | ||
109 | {Report::Attribute::Group, QStringLiteral("group")}, | 109 | {Reporting::Attribute::Group, QStringLiteral("group")}, | ||
110 | {Report::Attribute::Type, QStringLiteral("type")}, | 110 | {Reporting::Attribute::Type, QStringLiteral("type")}, | ||
111 | {Report::Attribute::Name, QStringLiteral("name")}, | 111 | {Reporting::Attribute::Name, QStringLiteral("name")}, | ||
112 | {Report::Attribute::Comment, QStringLiteral("comment")}, | 112 | {Reporting::Attribute::Comment, QStringLiteral("comment")}, | ||
113 | {Report::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, | 113 | {Reporting::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, | ||
114 | {Report::Attribute::Favorite, QStringLiteral("favorite")}, | 114 | {Reporting::Attribute::Favorite, QStringLiteral("favorite")}, | ||
115 | {Report::Attribute::SkipZero, QStringLiteral("skipZero")}, | 115 | {Reporting::Attribute::SkipZero, QStringLiteral("skipZero")}, | ||
116 | {Report::Attribute::DateLock, QStringLiteral("datelock")}, | 116 | {Reporting::Attribute::DateLock, QStringLiteral("datelock")}, | ||
117 | {Report::Attribute::DataLock, QStringLiteral("datalock")}, | 117 | {Reporting::Attribute::DataLock, QStringLiteral("datalock")}, | ||
118 | {Report::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, | 118 | {Reporting::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, | ||
119 | {Report::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, | 119 | {Reporting::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, | ||
120 | {Report::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, | 120 | {Reporting::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, | ||
121 | {Report::Attribute::IncludesPrice, QStringLiteral("includesprice")}, | 121 | {Reporting::Attribute::IncludesPrice, QStringLiteral("includesprice")}, | ||
122 | {Report::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, | 122 | {Reporting::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, | ||
123 | {Report::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, | 123 | {Reporting::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, | ||
124 | {Report::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, | 124 | {Reporting::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, | ||
125 | {Report::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, | 125 | {Reporting::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, | ||
126 | {Report::Attribute::IncludesUnused, QStringLiteral("includeunused")}, | 126 | {Reporting::Attribute::IncludesUnused, QStringLiteral("includeunused")}, | ||
127 | {Report::Attribute::MixedTime, QStringLiteral("mixedtime")}, | 127 | {Reporting::Attribute::MixedTime, QStringLiteral("mixedtime")}, | ||
128 | {Report::Attribute::Investments, QStringLiteral("investments")}, | 128 | {Reporting::Attribute::Investments, QStringLiteral("investments")}, | ||
129 | {Report::Attribute::Budget, QStringLiteral("budget")}, | 129 | {Reporting::Attribute::Budget, QStringLiteral("budget")}, | ||
130 | {Report::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, | 130 | {Reporting::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, | ||
131 | {Report::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, | 131 | {Reporting::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, | ||
132 | {Report::Attribute::Detail, QStringLiteral("detail")}, | 132 | {Reporting::Attribute::Detail, QStringLiteral("detail")}, | ||
133 | {Report::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, | 133 | {Reporting::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, | ||
134 | {Report::Attribute::ChartType, QStringLiteral("charttype")}, | 134 | {Reporting::Attribute::ChartType, QStringLiteral("charttype")}, | ||
135 | {Report::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, | 135 | {Reporting::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, | ||
136 | {Report::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, | 136 | {Reporting::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, | ||
137 | {Report::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, | 137 | {Reporting::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, | ||
138 | {Report::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, | 138 | {Reporting::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, | ||
139 | {Report::Attribute::LogYAxis, QStringLiteral("logYaxis")}, | 139 | {Reporting::Attribute::LogYAxis, QStringLiteral("logYaxis")}, | ||
140 | {Report::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, | 140 | {Reporting::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, | ||
141 | {Report::Attribute::ColumnType, QStringLiteral("columntype")}, | 141 | {Reporting::Attribute::ColumnType, QStringLiteral("columntype")}, | ||
142 | {Report::Attribute::RowType, QStringLiteral("rowtype")}, | 142 | {Reporting::Attribute::RowType, QStringLiteral("rowtype")}, | ||
143 | {Report::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, | 143 | {Reporting::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, | ||
144 | {Report::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, | 144 | {Reporting::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, | ||
145 | {Report::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, | 145 | {Reporting::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, | ||
146 | {Report::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, | 146 | {Reporting::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, | ||
147 | {Report::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, | 147 | {Reporting::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, | ||
148 | {Report::Attribute::QueryColumns, QStringLiteral("querycolumns")}, | 148 | {Reporting::Attribute::QueryColumns, QStringLiteral("querycolumns")}, | ||
149 | {Report::Attribute::Tax, QStringLiteral("tax")}, | 149 | {Reporting::Attribute::Tax, QStringLiteral("tax")}, | ||
150 | {Report::Attribute::Loans, QStringLiteral("loans")}, | 150 | {Reporting::Attribute::Loans, QStringLiteral("loans")}, | ||
151 | {Report::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, | 151 | {Reporting::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, | ||
152 | {Report::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, | 152 | {Reporting::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, | ||
153 | {Report::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, | 153 | {Reporting::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, | ||
154 | {Report::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, | 154 | {Reporting::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, | ||
155 | {Report::Attribute::TermsSeparator, QStringLiteral("tseparator")}, | 155 | {Reporting::Attribute::TermsSeparator, QStringLiteral("tseparator")}, | ||
156 | {Report::Attribute::Pattern, QStringLiteral("pattern")}, | 156 | {Reporting::Attribute::Pattern, QStringLiteral("pattern")}, | ||
157 | {Report::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, | 157 | {Reporting::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, | ||
158 | {Report::Attribute::RegEx, QStringLiteral("regex")}, | 158 | {Reporting::Attribute::RegEx, QStringLiteral("regex")}, | ||
159 | {Report::Attribute::InvertText, QStringLiteral("inverttext")}, | 159 | {Reporting::Attribute::InvertText, QStringLiteral("inverttext")}, | ||
160 | {Report::Attribute::State, QStringLiteral("state")}, | 160 | {Reporting::Attribute::State, QStringLiteral("state")}, | ||
161 | {Report::Attribute::From, QStringLiteral("from")}, | 161 | {Reporting::Attribute::From, QStringLiteral("from")}, | ||
162 | {Report::Attribute::To, QStringLiteral("to")} | 162 | {Reporting::Attribute::To, QStringLiteral("to")} | ||
163 | }; | 163 | }; | ||
164 | return attrNames[attr]; | 164 | return attrNames[attr]; | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | /** | 167 | /** | ||
168 | * The user-assigned name of the report | 168 | * The user-assigned name of the report | ||
169 | */ | 169 | */ | ||
170 | QString m_name; | 170 | QString m_name; | ||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 211 | /** | |||
212 | * Whether this report should only include loan accounts | 212 | * Whether this report should only include loan accounts | ||
213 | * Applies only to querytable reports. Mutually exclusive with | 213 | * Applies only to querytable reports. Mutually exclusive with | ||
214 | * m_investments. | 214 | * m_investments. | ||
215 | */ | 215 | */ | ||
216 | bool m_loans; | 216 | bool m_loans; | ||
217 | /** | 217 | /** | ||
218 | * What sort of algorithm should be used to run the report | 218 | * What sort of algorithm should be used to run the report | ||
219 | */ | 219 | */ | ||
220 | MyMoneyReport::EReportType m_reportType; | 220 | MyMoneyReport::Report::Type m_reportType; | ||
221 | /** | 221 | /** | ||
222 | * What sort of values should show up on the ROWS of this report | 222 | * What sort of values should show up on the ROWS of this report | ||
223 | */ | 223 | */ | ||
224 | MyMoneyReport::ERowType m_rowType; | 224 | MyMoneyReport::Row::Type m_rowType; | ||
225 | /** | 225 | /** | ||
226 | * What sort of values should show up on the COLUMNS of this report, | 226 | * What sort of values should show up on the COLUMNS of this report, | ||
227 | * in the case of a 'PivotTable' report. Really this is used more as a | 227 | * in the case of a 'PivotTable' report. Really this is used more as a | ||
228 | * QUANTITY of months or days. Whether it's months or days is determined | 228 | * QUANTITY of months or days. Whether it's months or days is determined | ||
229 | * by m_columnsAreDays. | 229 | * by m_columnsAreDays. | ||
230 | */ | 230 | */ | ||
231 | MyMoneyReport::EColumnType m_columnType; | 231 | MyMoneyReport::Column::Type m_columnType; | ||
232 | /** | 232 | /** | ||
233 | * Whether the base unit of columns of this report is days. Only applies to | 233 | * Whether the base unit of columns of this report is days. Only applies to | ||
234 | * 'PivotTable' reports. If false, then columns are months or multiples thereof. | 234 | * 'PivotTable' reports. If false, then columns are months or multiples thereof. | ||
235 | */ | 235 | */ | ||
236 | bool m_columnsAreDays; | 236 | bool m_columnsAreDays; | ||
237 | /** | 237 | /** | ||
238 | * What sort of values should show up on the COLUMNS of this report, | 238 | * What sort of values should show up on the COLUMNS of this report, | ||
239 | * in the case of a 'QueryTable' report | 239 | * in the case of a 'QueryTable' report | ||
240 | */ | 240 | */ | ||
241 | MyMoneyReport::EQueryColumns m_queryColumns; | 241 | MyMoneyReport::QueryColumns::Type m_queryColumns; | ||
242 | 242 | | |||
243 | /** | 243 | /** | ||
244 | * The plain-language description of what the date range should be locked | 244 | * The plain-language description of what the date range should be locked | ||
245 | * to. 'userDefined' means NO locking, in any other case, the report | 245 | * to. 'userDefined' means NO locking, in any other case, the report | ||
246 | * will be adjusted to match the date lock. So if the date lock is | 246 | * will be adjusted to match the date lock. So if the date lock is | ||
247 | * 'currentMonth', the start and end dates of the underlying filter will | 247 | * 'currentMonth', the start and end dates of the underlying filter will | ||
248 | * be updated to whatever the current month is. This updating happens | 248 | * be updated to whatever the current month is. This updating happens | ||
249 | * automatically when the report is loaded, and should also be done | 249 | * automatically when the report is loaded, and should also be done | ||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |