Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyreport.h
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 57 | public: | |||
---|---|---|---|---|---|
62 | 62 | | |||
63 | // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards | 63 | // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards | ||
64 | // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp | 64 | // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp | ||
65 | enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCtag = 0x8, eQCmemo = 0x10, eQCaccount = 0x20, eQCreconciled = 0x40, eQCaction = 0x80, eQCshares = 0x100, eQCprice = 0x200, eQCperformance = 0x400, eQCloan = 0x800, eQCbalance = 0x1000, eQCcapitalgain = 0x2000, eQCend = 0x4000 }; | 65 | enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCtag = 0x8, eQCmemo = 0x10, eQCaccount = 0x20, eQCreconciled = 0x40, eQCaction = 0x80, eQCshares = 0x100, eQCprice = 0x200, eQCperformance = 0x400, eQCloan = 0x800, eQCbalance = 0x1000, eQCcapitalgain = 0x2000, eQCend = 0x4000 }; | ||
66 | 66 | | |||
67 | enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; | 67 | enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; | ||
68 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | 68 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | ||
69 | 69 | | |||
70 | enum dataOptionE { automatic = 0, userDefined, dataOptionCount }; | ||||
71 | | ||||
70 | static const QStringList kRowTypeText; | 72 | static const QStringList kRowTypeText; | ||
71 | static const QStringList kColumnTypeText; | 73 | static const QStringList kColumnTypeText; | ||
72 | static const QStringList kQueryColumnsText; | 74 | static const QStringList kQueryColumnsText; | ||
73 | static const QStringList kDetailLevelText; | 75 | static const QStringList kDetailLevelText; | ||
74 | static const QStringList kChartTypeText; | 76 | static const QStringList kChartTypeText; | ||
75 | static const EReportType kTypeArray[]; | 77 | static const EReportType kTypeArray[]; | ||
76 | 78 | | |||
77 | public: | 79 | public: | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 140 | EDetailLevel detailLevel() const { | |||
139 | return m_detailLevel; | 141 | return m_detailLevel; | ||
140 | } | 142 | } | ||
141 | EChartType chartType() const { | 143 | EChartType chartType() const { | ||
142 | return m_chartType; | 144 | return m_chartType; | ||
143 | } | 145 | } | ||
144 | bool isChartDataLabels() const { | 146 | bool isChartDataLabels() const { | ||
145 | return m_chartDataLabels; | 147 | return m_chartDataLabels; | ||
146 | } | 148 | } | ||
147 | bool isChartGridLines() const { | 149 | bool isChartCHGridLines() const { | ||
148 | return m_chartGridLines; | 150 | return m_chartCHGridLines; | ||
151 | } | ||||
152 | bool isChartSVGridLines() const { | ||||
153 | return m_chartSVGridLines; | ||||
149 | } | 154 | } | ||
150 | bool isChartByDefault() const { | 155 | bool isChartByDefault() const { | ||
151 | return m_chartByDefault; | 156 | return m_chartByDefault; | ||
152 | } | 157 | } | ||
153 | uint chartLineWidth() const { | 158 | uint chartLineWidth() const { | ||
154 | return m_chartLineWidth; | 159 | return m_chartLineWidth; | ||
155 | } | 160 | } | ||
161 | bool isLogYAxis() const { | ||||
162 | return m_logYaxis; | ||||
163 | } | ||||
164 | const QString& dataRangeStart() const { | ||||
165 | return m_dataRangeStart; | ||||
166 | } | ||||
167 | const QString& dataRangeEnd() const { | ||||
168 | return m_dataRangeEnd; | ||||
169 | } | ||||
170 | const QString& dataMajorTick() const { | ||||
171 | return m_dataMajorTick; | ||||
172 | } | ||||
173 | const QString& dataMinorTick() const { | ||||
174 | return m_dataMinorTick; | ||||
175 | } | ||||
156 | bool isIncludingSchedules() const { | 176 | bool isIncludingSchedules() const { | ||
157 | return m_includeSchedules; | 177 | return m_includeSchedules; | ||
158 | } | 178 | } | ||
159 | bool isColumnsAreDays() const { | 179 | bool isColumnsAreDays() const { | ||
160 | return m_columnsAreDays; | 180 | return m_columnsAreDays; | ||
161 | } | 181 | } | ||
162 | bool isIncludingTransfers() const { | 182 | bool isIncludingTransfers() const { | ||
163 | return m_includeTransfers; | 183 | return m_includeTransfers; | ||
Show All 20 Lines | 203 | int movingAverageDays() const { | |||
184 | return m_movingAverageDays; | 204 | return m_movingAverageDays; | ||
185 | } | 205 | } | ||
186 | bool isIncludingPrice() const { | 206 | bool isIncludingPrice() const { | ||
187 | return m_includePrice; | 207 | return m_includePrice; | ||
188 | } | 208 | } | ||
189 | bool isIncludingAveragePrice() const { | 209 | bool isIncludingAveragePrice() const { | ||
190 | return m_includeAveragePrice; | 210 | return m_includeAveragePrice; | ||
191 | } | 211 | } | ||
192 | bool isUserDefined() const { | 212 | bool isDateUserDefined() const { | ||
193 | return m_dateLock == userDefined; | 213 | return m_dateLock == MyMoneyTransactionFilter::userDefined; | ||
214 | } | ||||
215 | bool isDataUserDefined() const { | ||||
216 | return m_dataLock == MyMoneyReport::userDefined; | ||||
194 | } | 217 | } | ||
195 | bool isMixedTime() const { | 218 | bool isMixedTime() const { | ||
196 | return m_mixedTime; | 219 | return m_mixedTime; | ||
197 | } | 220 | } | ||
198 | int currentDateColumn() const { | 221 | int currentDateColumn() const { | ||
199 | return m_currentDateColumn; | 222 | return m_currentDateColumn; | ||
200 | } | 223 | } | ||
201 | /** | 224 | /** | ||
Show All 39 Lines | 263 | void setDetailLevel(EDetailLevel _detail) { | |||
241 | m_detailLevel = _detail; | 264 | m_detailLevel = _detail; | ||
242 | } | 265 | } | ||
243 | void setChartType(EChartType _type) { | 266 | void setChartType(EChartType _type) { | ||
244 | m_chartType = _type; | 267 | m_chartType = _type; | ||
245 | } | 268 | } | ||
246 | void setChartDataLabels(bool _f) { | 269 | void setChartDataLabels(bool _f) { | ||
247 | m_chartDataLabels = _f; | 270 | m_chartDataLabels = _f; | ||
248 | } | 271 | } | ||
249 | void setChartGridLines(bool _f) { | 272 | void setChartCHGridLines(bool _f) { | ||
250 | m_chartGridLines = _f; | 273 | m_chartCHGridLines = _f; | ||
274 | } | ||||
275 | void setChartSVGridLines(bool _f) { | ||||
276 | m_chartSVGridLines = _f; | ||||
251 | } | 277 | } | ||
252 | void setChartByDefault(bool _f) { | 278 | void setChartByDefault(bool _f) { | ||
253 | m_chartByDefault = _f; | 279 | m_chartByDefault = _f; | ||
254 | } | 280 | } | ||
255 | void setChartLineWidth(uint _f) { | 281 | void setChartLineWidth(uint _f) { | ||
256 | m_chartLineWidth = _f; | 282 | m_chartLineWidth = _f; | ||
257 | } | 283 | } | ||
284 | void setLogYAxis(bool _f) { | ||||
285 | m_logYaxis = _f; | ||||
286 | } | ||||
287 | void setDataRangeStart(const QString& _f) { | ||||
288 | m_dataRangeStart = _f; | ||||
289 | } | ||||
290 | void setDataRangeEnd(const QString& _f) { | ||||
291 | m_dataRangeEnd = _f; | ||||
292 | } | ||||
293 | void setDataMajorTick(const QString& _f) { | ||||
294 | m_dataMajorTick = _f; | ||||
295 | } | ||||
296 | void setDataMinorTick(const QString& _f) { | ||||
297 | m_dataMinorTick = _f; | ||||
298 | } | ||||
258 | void setIncludingSchedules(bool _f) { | 299 | void setIncludingSchedules(bool _f) { | ||
259 | m_includeSchedules = _f; | 300 | m_includeSchedules = _f; | ||
260 | } | 301 | } | ||
261 | void setColumnsAreDays(bool _f) { | 302 | void setColumnsAreDays(bool _f) { | ||
262 | m_columnsAreDays = _f; | 303 | m_columnsAreDays = _f; | ||
263 | } | 304 | } | ||
264 | void setIncludingTransfers(bool _f) { | 305 | void setIncludingTransfers(bool _f) { | ||
265 | m_includeTransfers = _f; | 306 | m_includeTransfers = _f; | ||
▲ Show 20 Lines • Show All 74 Lines • ▼ Show 20 Line(s) | 375 | /** | |||
340 | * calling updateDateFilter. | 381 | * calling updateDateFilter. | ||
341 | * | 382 | * | ||
342 | * @param _u The date range constant (MyMoneyTransactionFilter::dateRangeE) | 383 | * @param _u The date range constant (MyMoneyTransactionFilter::dateRangeE) | ||
343 | * which this report should be locked to. | 384 | * which this report should be locked to. | ||
344 | */ | 385 | */ | ||
345 | 386 | | |||
346 | void setDateFilter(dateOptionE _u) { | 387 | void setDateFilter(dateOptionE _u) { | ||
347 | m_dateLock = _u; | 388 | m_dateLock = _u; | ||
348 | if (_u != userDefined) | 389 | if (_u != MyMoneyTransactionFilter::userDefined) | ||
349 | MyMoneyTransactionFilter::setDateFilter(_u); | 390 | MyMoneyTransactionFilter::setDateFilter(_u); | ||
350 | } | 391 | } | ||
351 | 392 | | |||
393 | void setDataFilter(dataOptionE _u) { | ||||
394 | m_dataLock = _u; | ||||
395 | } | ||||
396 | | ||||
352 | /** | 397 | /** | ||
353 | * Set the underlying date filter using the start and end dates provided. | 398 | * Set the underlying date filter using the start and end dates provided. | ||
354 | * Note that this does not LOCK to any range like setDateFilter(unsigned) | 399 | * Note that this does not LOCK to any range like setDateFilter(unsigned) | ||
355 | * above. It is just a reimplementation of the MyMoneyTransactionFilter | 400 | * above. It is just a reimplementation of the MyMoneyTransactionFilter | ||
356 | * version. | 401 | * version. | ||
357 | * | 402 | * | ||
358 | * @param _db The inclusive begin date of the date range | 403 | * @param _db The inclusive begin date of the date range | ||
359 | * @param _de The inclusive end date of the date range | 404 | * @param _de The inclusive end date of the date range | ||
Show All 10 Lines | 411 | /** | |||
370 | * the date filters properly match the plain-language 'date lock'. | 415 | * the date filters properly match the plain-language 'date lock'. | ||
371 | * | 416 | * | ||
372 | * For example, if the report is date-locked to "Current Month", and the | 417 | * For example, if the report is date-locked to "Current Month", and the | ||
373 | * last time you loaded or ran the report was in August, but it's now | 418 | * last time you loaded or ran the report was in August, but it's now | ||
374 | * September, this function will update the date range to be September, | 419 | * September, this function will update the date range to be September, | ||
375 | * as is proper. | 420 | * as is proper. | ||
376 | */ | 421 | */ | ||
377 | void updateDateFilter() { | 422 | void updateDateFilter() { | ||
378 | if (m_dateLock != userDefined) MyMoneyTransactionFilter::setDateFilter(m_dateLock); | 423 | if (m_dateLock != MyMoneyTransactionFilter::userDefined) MyMoneyTransactionFilter::setDateFilter(m_dateLock); | ||
424 | } | ||||
425 | | ||||
426 | MyMoneyReport::dataOptionE dataFilter() { | ||||
427 | return m_dataLock; | ||||
379 | } | 428 | } | ||
380 | 429 | | |||
381 | /** | 430 | /** | ||
382 | * Retrieves a VALID beginning & ending date for this report. | 431 | * Retrieves a VALID beginning & ending date for this report. | ||
383 | * | 432 | * | ||
384 | * The underlying date filter can return en empty QDate() for either the | 433 | * The underlying date filter can return en empty QDate() for either the | ||
385 | * begin or end date or both. This is typically unacceptable for reports, | 434 | * begin or end date or both. This is typically unacceptable for reports, | ||
386 | * which need the REAL begin and end date. | 435 | * which need the REAL begin and end date. | ||
▲ Show 20 Lines • Show All 198 Lines • ▼ Show 20 Line(s) | 542 | private: | |||
585 | enum EChartType m_chartType; | 634 | enum EChartType m_chartType; | ||
586 | /** | 635 | /** | ||
587 | * Whether the value of individual data points should be drawn on the chart | 636 | * Whether the value of individual data points should be drawn on the chart | ||
588 | */ | 637 | */ | ||
589 | bool m_chartDataLabels; | 638 | bool m_chartDataLabels; | ||
590 | /** | 639 | /** | ||
591 | * Whether grid lines should be drawn on the chart | 640 | * Whether grid lines should be drawn on the chart | ||
592 | */ | 641 | */ | ||
593 | bool m_chartGridLines; | 642 | bool m_chartCHGridLines; | ||
643 | bool m_chartSVGridLines; | ||||
594 | /** | 644 | /** | ||
595 | * Whether this report should be shown as a chart by default (otherwise it | 645 | * Whether this report should be shown as a chart by default (otherwise it | ||
596 | * should be shown as a textual report) | 646 | * should be shown as a textual report) | ||
597 | */ | 647 | */ | ||
598 | bool m_chartByDefault; | 648 | bool m_chartByDefault; | ||
599 | /** | 649 | /** | ||
600 | * Width of the chart lines | 650 | * Width of the chart lines | ||
601 | */ | 651 | */ | ||
602 | uint m_chartLineWidth; | 652 | uint m_chartLineWidth; | ||
653 | | ||||
654 | /** | ||||
655 | * Whether Y axis is logarithmic or linear | ||||
656 | */ | ||||
657 | bool m_logYaxis; | ||||
658 | | ||||
659 | /** | ||||
660 | * Y data range | ||||
661 | */ | ||||
662 | QString m_dataRangeStart; | ||||
663 | QString m_dataRangeEnd; | ||||
664 | | ||||
665 | /** | ||||
666 | * Y data range division | ||||
667 | */ | ||||
668 | QString m_dataMajorTick; | ||||
669 | QString m_dataMinorTick; | ||||
670 | | ||||
671 | /** | ||||
672 | * Whether data range should be calculated automatically or is user defined | ||||
673 | */ | ||||
674 | dataOptionE m_dataLock; | ||||
675 | | ||||
603 | /** | 676 | /** | ||
604 | * Whether to include scheduled transactions | 677 | * Whether to include scheduled transactions | ||
605 | */ | 678 | */ | ||
606 | bool m_includeSchedules; | 679 | bool m_includeSchedules; | ||
607 | /** | 680 | /** | ||
608 | * Whether to include transfers. Only applies to Income/Expense reports | 681 | * Whether to include transfers. Only applies to Income/Expense reports | ||
609 | */ | 682 | */ | ||
610 | bool m_includeTransfers; | 683 | bool m_includeTransfers; | ||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |