Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyreport.h
Show First 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | 36 | /** | |||
---|---|---|---|---|---|
51 | * | 51 | * | ||
52 | * @author Ace Jones <acejones@users.sourceforge.net> | 52 | * @author Ace Jones <acejones@users.sourceforge.net> | ||
53 | */ | 53 | */ | ||
54 | 54 | | |||
55 | class KMM_MYMONEY_EXPORT MyMoneyReport: public MyMoneyObject, public MyMoneyTransactionFilter | 55 | class KMM_MYMONEY_EXPORT MyMoneyReport: public MyMoneyObject, public MyMoneyTransactionFilter | ||
56 | { | 56 | { | ||
57 | public: | 57 | public: | ||
58 | // When adding a new row type, be sure to add a corresponding entry in kTypeArray | 58 | // When adding a new row type, be sure to add a corresponding entry in kTypeArray | ||
59 | enum ERowType { eNoRows = 0, eAssetLiability, eExpenseIncome, eCategory, eTopCategory, eAccount, eTag, ePayee, eMonth, eWeek, eTopAccount, eAccountByTopAccount, eEquityType, eAccountType, eInstitution, eBudget, eBudgetActual, eSchedule, eAccountInfo, eAccountLoanInfo, eAccountReconcile, eCashFlow}; | 59 | class Row { | ||
60 | public: | ||||
61 | enum Type { NoRows = 0, AssetLiability, ExpenseIncome, Category, TopCategory, Account, Tag, Payee, Month, Week, TopAccount, AccountByTopAccount, EquityType, AccountType, Institution, Budget, BudgetActual, Schedule, AccountInfo, AccountLoanInfo, AccountReconcile, CashFlow}; | ||||
62 | static QString toString(Type type); | ||||
63 | }; | ||||
64 | | ||||
60 | class Report { | 65 | class Report { | ||
61 | public: | 66 | public: | ||
62 | enum Type { NoReport = 0, PivotTable, QueryTable, InfoTable }; | 67 | enum Type { NoReport = 0, PivotTable, QueryTable, InfoTable }; | ||
63 | static QString toString(Type type); | 68 | static QString toString(Type type); | ||
64 | static const Type kTypeArray[]; | 69 | static const Type kTypeArray[]; | ||
65 | }; | 70 | }; | ||
66 | 71 | | |||
67 | class Column { | 72 | class Column { | ||
Show All 14 Lines | |||||
82 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | 87 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | ||
83 | 88 | | |||
84 | static const QStringList kRowTypeText; | 89 | static const QStringList kRowTypeText; | ||
85 | static const QStringList kDetailLevelText; | 90 | static const QStringList kDetailLevelText; | ||
86 | static const QStringList kChartTypeText; | 91 | static const QStringList kChartTypeText; | ||
87 | 92 | | |||
88 | public: | 93 | public: | ||
89 | MyMoneyReport(); | 94 | MyMoneyReport(); | ||
90 | MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment); | 95 | MyMoneyReport(Row::Type _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment); | ||
91 | MyMoneyReport(const QString& id, const MyMoneyReport& right); | 96 | MyMoneyReport(const QString& id, const MyMoneyReport& right); | ||
92 | 97 | | |||
93 | /** | 98 | /** | ||
94 | * This constructor creates an object based on the data found in the | 99 | * This constructor creates an object based on the data found in the | ||
95 | * QDomElement referenced by @p node. If problems arise, the @p id of | 100 | * QDomElement referenced by @p node. If problems arise, the @p id of | ||
96 | * the object is cleared (see MyMoneyObject::clearId()). | 101 | * the object is cleared (see MyMoneyObject::clearId()). | ||
97 | */ | 102 | */ | ||
98 | MyMoneyReport(const QDomElement& node); | 103 | MyMoneyReport(const QDomElement& node); | ||
99 | 104 | | |||
100 | // Simple get operations | 105 | // Simple get operations | ||
101 | const QString& name() const { | 106 | const QString& name() const { | ||
102 | return m_name; | 107 | return m_name; | ||
103 | } | 108 | } | ||
104 | bool isShowingRowTotals() const { | 109 | bool isShowingRowTotals() const { | ||
105 | return (m_showRowTotals); | 110 | return (m_showRowTotals); | ||
106 | } | 111 | } | ||
107 | Report::Type reportType() const { | 112 | Report::Type reportType() const { | ||
108 | return m_reportType; | 113 | return m_reportType; | ||
109 | } | 114 | } | ||
110 | ERowType rowType() const { | 115 | Row::Type rowType() const { | ||
111 | return m_rowType; | 116 | return m_rowType; | ||
112 | } | 117 | } | ||
113 | Column::Type columnType() const { | 118 | Column::Type columnType() const { | ||
114 | return m_columnType; | 119 | return m_columnType; | ||
115 | } | 120 | } | ||
116 | bool isRunningSum() const { | 121 | bool isRunningSum() const { | ||
117 | return (m_rowType == eAssetLiability); | 122 | return (m_rowType == Row::AssetLiability); | ||
118 | } | 123 | } | ||
119 | bool isConvertCurrency() const { | 124 | bool isConvertCurrency() const { | ||
120 | return m_convertCurrency; | 125 | return m_convertCurrency; | ||
121 | } | 126 | } | ||
122 | unsigned columnPitch() const { | 127 | unsigned columnPitch() const { | ||
123 | return static_cast<unsigned>(m_columnType); | 128 | return static_cast<unsigned>(m_columnType); | ||
124 | } | 129 | } | ||
125 | bool isShowingColumnTotals() const { | 130 | bool isShowingColumnTotals() const { | ||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Line(s) | |||||
218 | 223 | | |||
219 | // Simple set operations | 224 | // Simple set operations | ||
220 | void setName(const QString& _s) { | 225 | void setName(const QString& _s) { | ||
221 | m_name = _s; | 226 | m_name = _s; | ||
222 | } | 227 | } | ||
223 | void setConvertCurrency(bool _f) { | 228 | void setConvertCurrency(bool _f) { | ||
224 | m_convertCurrency = _f; | 229 | m_convertCurrency = _f; | ||
225 | } | 230 | } | ||
226 | void setRowType(ERowType _rt); | 231 | void setRowType(Row::Type _rt); | ||
227 | void setColumnType(Column::Type _ct) { | 232 | void setColumnType(Column::Type _ct) { | ||
228 | m_columnType = _ct; | 233 | m_columnType = _ct; | ||
229 | } | 234 | } | ||
230 | void setComment(const QString& _comment) { | 235 | void setComment(const QString& _comment) { | ||
231 | m_comment = _comment; | 236 | m_comment = _comment; | ||
232 | } | 237 | } | ||
233 | void setGroup(const QString& _group) { | 238 | void setGroup(const QString& _group) { | ||
234 | m_group = _group; | 239 | m_group = _group; | ||
▲ Show 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | |||||
502 | static void setLineWidth(int width); | 507 | static void setLineWidth(int width); | ||
503 | 508 | | |||
504 | /** | 509 | /** | ||
505 | * Return row type as string. | 510 | * Return row type as string. | ||
506 | * | 511 | * | ||
507 | * @param type type to get string for | 512 | * @param type type to get string for | ||
508 | * @return row type converted to string | 513 | * @return row type converted to string | ||
509 | */ | 514 | */ | ||
510 | static QString toString(ERowType type); | 515 | static QString toString(Row::Type type); | ||
511 | 516 | | |||
512 | /** | 517 | /** | ||
513 | * Return report type as string. | 518 | * Return report type as string. | ||
514 | * | 519 | * | ||
515 | * @param type report type to get string for | 520 | * @param type report type to get string for | ||
516 | * @return report type converted to string | 521 | * @return report type converted to string | ||
517 | */ | 522 | */ | ||
518 | static QString toString(MyMoneyReport::Report::Type type); | 523 | static QString toString(MyMoneyReport::Report::Type type); | ||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | 525 | private: | |||
562 | bool m_loans; | 567 | bool m_loans; | ||
563 | /** | 568 | /** | ||
564 | * What sort of algorithm should be used to run the report | 569 | * What sort of algorithm should be used to run the report | ||
565 | */ | 570 | */ | ||
566 | Report::Type m_reportType; | 571 | Report::Type m_reportType; | ||
567 | /** | 572 | /** | ||
568 | * What sort of values should show up on the ROWS of this report | 573 | * What sort of values should show up on the ROWS of this report | ||
569 | */ | 574 | */ | ||
570 | enum ERowType m_rowType; | 575 | Row::Type m_rowType; | ||
571 | /** | 576 | /** | ||
572 | * What sort of values should show up on the COLUMNS of this report, | 577 | * What sort of values should show up on the COLUMNS of this report, | ||
573 | * in the case of a 'PivotTable' report. Really this is used more as a | 578 | * in the case of a 'PivotTable' report. Really this is used more as a | ||
574 | * QUANTITY of months or days. Whether it's months or days is determined | 579 | * QUANTITY of months or days. Whether it's months or days is determined | ||
575 | * by m_columnsAreDays. | 580 | * by m_columnsAreDays. | ||
576 | */ | 581 | */ | ||
577 | Column::Type m_columnType; | 582 | Column::Type m_columnType; | ||
578 | /** | 583 | /** | ||
▲ Show 20 Lines • Show All 146 Lines • Show Last 20 Lines |