MyMoneyBudget Class Reference

#include <mymoneybudget.h>

Inheritance diagram for MyMoneyBudget:

Collaboration diagram for MyMoneyBudget:

Collaboration graph

List of all members.

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 AccountGroupaccount (const QString _id) const
bool contains (const QString _id) const
QValueList< AccountGroupgetaccounts (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, AccountGroupm_accounts


class  AccountGroup
class  PeriodGroup

Detailed Description

This class defines a Budget within the MyMoneyEngine. The Budget class contains all the configuration parameters needed to run a Budget, plus XML serialization.

As noted above, this class only provides a Budget DEFINITION. The generation and presentation of the Budget itself are left to higher level classes.

Darren Gould <>

Constructor & Destructor Documentation

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.

Member Function Documentation

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]

This method retrieves the id of the object

ID of object

Reimplemented from MyMoneyObject.

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
bool True if a Budget was successfully loaded from the element 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
Return values:
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.

Member Data Documentation

QString MyMoneyBudget::m_name [private]

The user-assigned name of the Budget

QDate MyMoneyBudget::m_start [private]

The user-assigned year of the Budget

Map the budgeted accounts

Each account Id is stored against the AccountGroup information

The documentation for this class was generated from the following file:

Generated on Wed Jan 26 13:09:11 2011 for KMyMoney by  doxygen 1.5.6