Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/mymoney/mymoneybudget.h
Show All 28 Lines | |||||
29 | // Project Includes | 29 | // Project Includes | ||
30 | 30 | | |||
31 | #include "mymoneyobject.h" | 31 | #include "mymoneyobject.h" | ||
32 | #include "kmm_mymoney_export.h" | 32 | #include "kmm_mymoney_export.h" | ||
33 | #include "mymoneyunittestable.h" | 33 | #include "mymoneyunittestable.h" | ||
34 | 34 | | |||
35 | class QString; | 35 | class QString; | ||
36 | class QDate; | 36 | class QDate; | ||
37 | class QDomElement; | | |||
38 | class QDomDocument; | | |||
39 | class MyMoneyMoney; | 37 | class MyMoneyMoney; | ||
40 | 38 | | |||
41 | template <typename T> class QList; | 39 | template <typename T> class QList; | ||
42 | template <class Key, class T> class QMap; | 40 | template <class Key, class T> class QMap; | ||
43 | 41 | | |||
44 | namespace eMyMoney { namespace Budget { enum class Level; } } | 42 | namespace eMyMoney { namespace Budget { enum class Level; } } | ||
45 | 43 | | |||
46 | /** | 44 | /** | ||
Show All 15 Lines | 57 | { | |||
62 | KMM_MYMONEY_UNIT_TESTABLE | 60 | KMM_MYMONEY_UNIT_TESTABLE | ||
63 | 61 | | |||
64 | public: | 62 | public: | ||
65 | MyMoneyBudget(); | 63 | MyMoneyBudget(); | ||
66 | explicit MyMoneyBudget(const QString &id); | 64 | explicit MyMoneyBudget(const QString &id); | ||
67 | 65 | | |||
68 | /** | 66 | /** | ||
69 | * This constructor creates an object based on the data found in the | 67 | * This constructor creates an object based on the data found in the | ||
70 | * QDomElement referenced by @p node. If problems arise, the @p id of | | |||
71 | * the object is cleared (see MyMoneyObject::clearId()). | | |||
72 | */ | | |||
73 | explicit MyMoneyBudget(const QDomElement& node); | | |||
74 | | ||||
75 | /** | | |||
76 | * This constructor creates an object based on the data found in the | | |||
77 | * MyMoneyBudget budget object. | 68 | * MyMoneyBudget budget object. | ||
78 | */ | 69 | */ | ||
79 | MyMoneyBudget(const QString& id, | 70 | MyMoneyBudget(const QString& id, | ||
80 | const MyMoneyBudget& other); | 71 | const MyMoneyBudget& other); | ||
81 | 72 | | |||
82 | MyMoneyBudget(const MyMoneyBudget& other); | 73 | MyMoneyBudget(const MyMoneyBudget& other); | ||
83 | MyMoneyBudget(MyMoneyBudget && other); | 74 | MyMoneyBudget(MyMoneyBudget && other); | ||
84 | MyMoneyBudget & operator=(MyMoneyBudget other); | 75 | MyMoneyBudget & operator=(MyMoneyBudget other); | ||
▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Line(s) | |||||
186 | void setAccount(const AccountGroup& account, const QString &id); | 177 | void setAccount(const AccountGroup& account, const QString &id); | ||
187 | 178 | | |||
188 | bool contains(const QString &id) const; | 179 | bool contains(const QString &id) const; | ||
189 | QList<AccountGroup> getaccounts() const; | 180 | QList<AccountGroup> getaccounts() const; | ||
190 | 181 | | |||
191 | QMap<QString, MyMoneyBudget::AccountGroup> accountsMap() const; | 182 | QMap<QString, MyMoneyBudget::AccountGroup> accountsMap() const; | ||
192 | 183 | | |||
193 | /** | 184 | /** | ||
194 | * This method writes this Budget to the DOM element @p e, | | |||
195 | * within the DOM document @p doc. | | |||
196 | * | | |||
197 | * @param e The element which should be populated with info from this Budget | | |||
198 | * @param doc The document which we can use to create new sub-elements | | |||
199 | * if needed | | |||
200 | */ | | |||
201 | void write(QDomElement& e, QDomDocument *doc) const; | | |||
202 | | ||||
203 | /** | | |||
204 | * This method reads a Budget from the DOM element @p e, and | | |||
205 | * populates this Budget with the results. | | |||
206 | * | | |||
207 | * @param e The element from which the Budget should be read | | |||
208 | * | | |||
209 | * @return bool True if a Budget was successfully loaded from the | | |||
210 | * element @p e. If false is returned, the contents of this Budget | | |||
211 | * object are undefined. | | |||
212 | */ | | |||
213 | bool read(const QDomElement& e); | | |||
214 | | ||||
215 | /** | | |||
216 | * This method creates a QDomElement for the @p document | | |||
217 | * under the parent node @p parent. (This version overwrites the | | |||
218 | * MMObject base class.) | | |||
219 | * | | |||
220 | * @param document reference to QDomDocument | | |||
221 | * @param parent reference to QDomElement parent node | | |||
222 | */ | | |||
223 | void writeXML(QDomDocument& document, QDomElement& parent) const override; | | |||
224 | | ||||
225 | /** | | |||
226 | * This method checks if a reference to the given object exists. It returns, | 185 | * This method checks if a reference to the given object exists. It returns, | ||
227 | * a @p true if the object is referencing the one requested by the | 186 | * a @p true if the object is referencing the one requested by the | ||
228 | * parameter @p id and the balance() returned is zero. | 187 | * parameter @p id and the balance() returned is zero. | ||
229 | * If it does not, this method returns @p false. | 188 | * If it does not, this method returns @p false. | ||
230 | * | 189 | * | ||
231 | * @param id id of the object to be checked for references | 190 | * @param id id of the object to be checked for references | ||
232 | * @retval true This object references object with id @p id. | 191 | * @retval true This object references object with id @p id. | ||
233 | * @retval false This object does not reference the object with id @p id. | 192 | * @retval false This object does not reference the object with id @p id. | ||
▲ Show 20 Lines • Show All 67 Lines • Show Last 20 Lines |