Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneyreport.h
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 64 | { | |||
---|---|---|---|---|---|
66 | 66 | | |||
67 | KMM_MYMONEY_UNIT_TESTABLE | 67 | KMM_MYMONEY_UNIT_TESTABLE | ||
68 | 68 | | |||
69 | //protected: | 69 | //protected: | ||
70 | // MyMoneyReport(MyMoneyReportPrivate &dd); | 70 | // MyMoneyReport(MyMoneyReportPrivate &dd); | ||
71 | 71 | | |||
72 | public: | 72 | public: | ||
73 | // When adding a new row type, be sure to add a corresponding entry in kTypeArray | 73 | // When adding a new row type, be sure to add a corresponding entry in kTypeArray | ||
74 | 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}; | 74 | class Row { | ||
75 | enum EReportType { eNoReport = 0, ePivotTable, eQueryTable, eInfoTable }; | 75 | public: | ||
76 | enum EColumnType { eNoColumns = 0, eDays = 1, eMonths = 1, eBiMonths = 2, eQuarters = 3, eWeeks = 7, eYears = 12 }; | 76 | 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}; | ||
77 | 77 | /** | |||
78 | // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards | 78 | * Return row type as string. | ||
79 | // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp | 79 | * | ||
80 | 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 }; | 80 | * @param type type to get string for | ||
81 | * @return row type converted to string | ||||
82 | */ | ||||
83 | static QString toString(Type type); | ||||
84 | static const QStringList kText; | ||||
85 | }; | ||||
86 | | ||||
87 | | ||||
88 | class Report { | ||||
89 | public: | ||||
90 | enum Type { NoReport = 0, PivotTable, QueryTable, InfoTable }; | ||||
91 | /** | ||||
92 | * Return report type as string. | ||||
93 | * | ||||
94 | * @param type report type to get string for | ||||
95 | * @return report type converted to string | ||||
96 | */ | ||||
97 | static QString toString(Type type); | ||||
98 | static const Type kTypeArray[]; | ||||
99 | }; | ||||
100 | | ||||
101 | class Column { | ||||
102 | public: | ||||
103 | enum Type { NoColumns = 0, Days = 1, Months = 1, BiMonths = 2, Quarters = 3, Weeks = 7, Years = 12 }; | ||||
104 | static const QStringList kText; | ||||
105 | }; | ||||
106 | | ||||
107 | // if you add bits to this bitmask, start with the value currently assigned to end and update its value afterwards | ||||
108 | // also don't forget to add column names to QueryColumns::kText in mymoneyreport.cpp | ||||
109 | class QueryColumns { | ||||
110 | public: | ||||
111 | enum Type { None = 0x0, Begin = 0x1, Number = 0x1, Payee = 0x2, Category = 0x4, Tag = 0x8, Memo = 0x10, Account = 0x20, Reconciled = 0x40, Action = 0x80, Shares = 0x100, Price = 0x200, Performance = 0x400, Loan = 0x800, Balance = 0x1000, Capitalgain = 0x2000, End = 0x4000 }; | ||||
112 | static const QStringList kText; | ||||
113 | }; | ||||
81 | 114 | | |||
82 | enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; | 115 | enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; | ||
83 | enum EInvestmentSum { eSumPeriod = 0, eSumOwnedAndSold, eSumOwned, eSumSold, eSumBought}; | 116 | enum EInvestmentSum { eSumPeriod = 0, eSumOwnedAndSold, eSumOwned, eSumSold, eSumBought}; | ||
84 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | 117 | enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; | ||
85 | 118 | | |||
86 | enum dataOptionE { automatic = 0, userDefined, dataOptionCount }; | 119 | enum dataOptionE { automatic = 0, userDefined, dataOptionCount }; | ||
87 | 120 | | |||
88 | static const QStringList kRowTypeText; | | |||
89 | static const QStringList kColumnTypeText; | | |||
90 | static const QStringList kQueryColumnsText; | | |||
91 | static const QStringList kDetailLevelText; | 121 | static const QStringList kDetailLevelText; | ||
92 | static const QStringList kChartTypeText; | 122 | static const QStringList kChartTypeText; | ||
93 | static const EReportType kTypeArray[]; | | |||
94 | 123 | | |||
95 | public: | 124 | public: | ||
96 | MyMoneyReport(); | 125 | MyMoneyReport(); | ||
97 | explicit MyMoneyReport(ERowType rt, | 126 | explicit MyMoneyReport(Row::Type rt, | ||
98 | unsigned ct, | 127 | unsigned ct, | ||
99 | eMyMoney::TransactionFilter::Date dl, | 128 | eMyMoney::TransactionFilter::Date dl, | ||
100 | EDetailLevel ss, | 129 | EDetailLevel ss, | ||
101 | const QString& name, | 130 | const QString& name, | ||
102 | const QString& comment); | 131 | const QString& comment); | ||
103 | /** | 132 | /** | ||
104 | * This constructor creates an object based on the data found in the | 133 | * This constructor creates an object based on the data found in the | ||
105 | * QDomElement referenced by @p node. If problems arise, the @p id of | 134 | * QDomElement referenced by @p node. If problems arise, the @p id of | ||
106 | * the object is cleared (see MyMoneyObject::clearId()). | 135 | * the object is cleared (see MyMoneyObject::clearId()). | ||
107 | */ | 136 | */ | ||
108 | explicit MyMoneyReport(const QDomElement& node); | 137 | explicit MyMoneyReport(const QDomElement& node); | ||
109 | 138 | | |||
110 | MyMoneyReport(const QString& id, | 139 | MyMoneyReport(const QString& id, | ||
111 | const MyMoneyReport& other); | 140 | const MyMoneyReport& other); | ||
112 | 141 | | |||
113 | MyMoneyReport(const MyMoneyReport & other); | 142 | MyMoneyReport(const MyMoneyReport & other); | ||
114 | MyMoneyReport(MyMoneyReport && other); | 143 | MyMoneyReport(MyMoneyReport && other); | ||
115 | MyMoneyReport & operator=(MyMoneyReport other); | 144 | MyMoneyReport & operator=(MyMoneyReport other); | ||
116 | friend void swap(MyMoneyReport& first, MyMoneyReport& second); | 145 | friend void swap(MyMoneyReport& first, MyMoneyReport& second); | ||
117 | 146 | | |||
118 | ~MyMoneyReport(); | 147 | ~MyMoneyReport(); | ||
119 | 148 | | |||
120 | EReportType reportType() const; | 149 | Report::Type reportType() const; | ||
121 | 150 | | |||
122 | QString name() const; | 151 | QString name() const; | ||
123 | void setName(const QString& s); | 152 | void setName(const QString& s); | ||
124 | 153 | | |||
125 | bool isShowingRowTotals() const; | 154 | bool isShowingRowTotals() const; | ||
126 | void setShowingRowTotals(bool f); | 155 | void setShowingRowTotals(bool f); | ||
127 | 156 | | |||
128 | bool isShowingColumnTotals() const; | 157 | bool isShowingColumnTotals() const; | ||
129 | void setShowingColumnTotals(bool f); | 158 | void setShowingColumnTotals(bool f); | ||
130 | 159 | | |||
131 | ERowType rowType() const; | 160 | Row::Type rowType() const; | ||
132 | void setRowType(ERowType rt); | 161 | void setRowType(Row::Type rt); | ||
133 | bool isRunningSum() const; | 162 | bool isRunningSum() const; | ||
134 | 163 | | |||
135 | EColumnType columnType() const; | 164 | Column::Type columnType() const; | ||
136 | void setColumnType(EColumnType ct); | 165 | void setColumnType(Column::Type ct); | ||
137 | 166 | | |||
138 | bool isConvertCurrency() const; | 167 | bool isConvertCurrency() const; | ||
139 | void setConvertCurrency(bool f); | 168 | void setConvertCurrency(bool f); | ||
140 | uint columnPitch() const; | 169 | uint columnPitch() const; | ||
141 | 170 | | |||
142 | QString comment() const; | 171 | QString comment() const; | ||
143 | void setComment(const QString& comment); | 172 | void setComment(const QString& comment); | ||
144 | 173 | | |||
145 | EQueryColumns queryColumns() const; | 174 | QueryColumns::Type queryColumns() const; | ||
146 | void setQueryColumns(EQueryColumns qc); | 175 | void setQueryColumns(QueryColumns::Type qc); | ||
147 | 176 | | |||
148 | QString group() const; | 177 | QString group() const; | ||
149 | void setGroup(const QString& group); | 178 | void setGroup(const QString& group); | ||
150 | 179 | | |||
151 | bool isFavorite() const; | 180 | bool isFavorite() const; | ||
152 | void setFavorite(bool f); | 181 | void setFavorite(bool f); | ||
153 | 182 | | |||
154 | bool isTax() const; | 183 | bool isTax() const; | ||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Line(s) | |||||
447 | static int m_lineWidth; | 476 | static int m_lineWidth; | ||
448 | 477 | | |||
449 | /** | 478 | /** | ||
450 | * Return row type as string. | 479 | * Return row type as string. | ||
451 | * | 480 | * | ||
452 | * @param type type to get string for | 481 | * @param type type to get string for | ||
453 | * @return row type converted to string | 482 | * @return row type converted to string | ||
454 | */ | 483 | */ | ||
455 | static QString toString(ERowType type); | 484 | static QString toString(Row::Type type); | ||
456 | 485 | | |||
457 | /** | 486 | /** | ||
458 | * Return report type as string. | 487 | * Return report type as string. | ||
459 | * | 488 | * | ||
460 | * @param type report type to get string for | 489 | * @param type report type to get string for | ||
461 | * @return report type converted to string | 490 | * @return report type converted to string | ||
462 | */ | 491 | */ | ||
463 | static QString toString(EReportType type); | 492 | static QString toString(Report::Type type); | ||
464 | }; | 493 | }; | ||
465 | 494 | | |||
466 | inline void swap(MyMoneyReport& first, MyMoneyReport& second) // krazy:exclude=inline | 495 | inline void swap(MyMoneyReport& first, MyMoneyReport& second) // krazy:exclude=inline | ||
467 | { | 496 | { | ||
468 | using std::swap; | 497 | using std::swap; | ||
469 | swap(first.MyMoneyObject::d_ptr, second.MyMoneyObject::d_ptr); | 498 | swap(first.MyMoneyObject::d_ptr, second.MyMoneyObject::d_ptr); | ||
470 | swap(first.MyMoneyTransactionFilter::d_ptr, second.MyMoneyTransactionFilter::d_ptr); | 499 | swap(first.MyMoneyTransactionFilter::d_ptr, second.MyMoneyTransactionFilter::d_ptr); | ||
471 | } | 500 | } | ||
Show All 18 Lines |