#include <mymoneybudget.h>


Public Member Functions | |
| MyMoneyBudget (void) | |
| ~MyMoneyBudget () | |
| MyMoneyBudget (const QString &_name) | |
| MyMoneyBudget (const QDomElement &node) | |
| MyMoneyBudget (const QString &id, const MyMoneyBudget &budget) | |
| bool | operator== (const MyMoneyBudget &) const |
| const QString & | name (void) const |
| const QDate & | budgetStart (void) const |
| QString | id (void) const |
| const AccountGroup & | account (const QString _id) const |
| bool | contains (const QString _id) const |
| QValueList< AccountGroup > | getaccounts (void) const |
| void | setName (const QString &_name) |
| void | setBudgetStart (const QDate &_start) |
| void | setAccount (const AccountGroup &_account, const QString _id) |
| void | write (QDomElement &e, QDomDocument *doc) const |
| bool | read (const QDomElement &e) |
| virtual void | writeXML (QDomDocument &document, QDomElement &parent) const |
| virtual bool | hasReferenceTo (const QString &id) const |
| void | removeReference (const QString &id) |
Private Attributes | |
| QString | m_name |
| QDate | m_start |
| QMap< QString, AccountGroup > | m_accounts |
Classes | |
| class | AccountGroup |
| class | PeriodGroup |
As noted above, this class only provides a Budget DEFINITION. The generation and presentation of the Budget itself are left to higher level classes.
| MyMoneyBudget::MyMoneyBudget | ( | void | ) |
| MyMoneyBudget::~MyMoneyBudget | ( | ) |
| MyMoneyBudget::MyMoneyBudget | ( | const QString & | _name | ) |
| MyMoneyBudget::MyMoneyBudget | ( | const QDomElement & | node | ) |
This constructor creates an object based on the data found in the QDomElement referenced by node. If problems arise, the id of the object is cleared (see MyMoneyObject::clearId()).
| MyMoneyBudget::MyMoneyBudget | ( | const QString & | id, | |
| const MyMoneyBudget & | budget | |||
| ) |
This constructor creates an object based on the data found in the MyMoneyBudget budget object.
| bool MyMoneyBudget::operator== | ( | const MyMoneyBudget & | ) | const |
This operator tests for equality of two MyMoneyBudget objects
| const QString& MyMoneyBudget::name | ( | void | ) | const [inline] |
| const QDate& MyMoneyBudget::budgetStart | ( | void | ) | const [inline] |
| QString MyMoneyBudget::id | ( | void | ) | const [inline] |
| const AccountGroup& MyMoneyBudget::account | ( | const QString | _id | ) | const |
| bool MyMoneyBudget::contains | ( | const QString | _id | ) | const [inline] |
| QValueList<AccountGroup> MyMoneyBudget::getaccounts | ( | void | ) | const [inline] |
| void MyMoneyBudget::setName | ( | const QString & | _name | ) | [inline] |
| void MyMoneyBudget::setBudgetStart | ( | const QDate & | _start | ) |
| void MyMoneyBudget::setAccount | ( | const AccountGroup & | _account, | |
| const QString | _id | |||
| ) |
| void MyMoneyBudget::write | ( | QDomElement & | e, | |
| QDomDocument * | doc | |||
| ) | const |
This method writes this Budget to the DOM element e, within the DOM document doc.
| e | The element which should be populated with info from this Budget | |
| doc | The document which we can use to create new sub-elements if needed |
| bool MyMoneyBudget::read | ( | const QDomElement & | e | ) |
This method reads a Budget from the DOM element e, and populates this Budget with the results.
| e | The element from which the Budget should be read |
e. If false is returned, the contents of this Budget object are undefined. | virtual void MyMoneyBudget::writeXML | ( | QDomDocument & | document, | |
| QDomElement & | parent | |||
| ) | const [virtual] |
This method creates a QDomElement for the document under the parent node parent. (This version overwrites the MMObject base class.)
| document | reference to QDomDocument | |
| parent | reference to QDomElement parent node |
Implements MyMoneyObject.
| virtual bool MyMoneyBudget::hasReferenceTo | ( | const QString & | id | ) | const [virtual] |
This method checks if a reference to the given object exists. It returns, a true if the object is referencing the one requested by the parameter id and the balance() returned is zero. If it does not, this method returns false.
| id | id of the object to be checked for references |
| true | This object references object with id id. | |
| false | This object does not reference the object with id id. |
Implements MyMoneyObject.
| void MyMoneyBudget::removeReference | ( | const QString & | id | ) |
This member removes all references to object identified by id. Used to remove objects which are about to be removed from the engine.
QString MyMoneyBudget::m_name [private] |
The user-assigned name of the Budget
QDate MyMoneyBudget::m_start [private] |
The user-assigned year of the Budget
QMap<QString, AccountGroup> MyMoneyBudget::m_accounts [private] |
Map the budgeted accounts
Each account Id is stored against the AccountGroup information
1.5.6