diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-04 22:38:03 +0000 |
commit | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch) | |
tree | 99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/views/kinstitutionsview.h | |
download | kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.tar.gz kmymoney-dadc34655c3ab961b0b0b94a10eaaba710f0b5e8.zip |
Added kmymoney
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239792 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/views/kinstitutionsview.h')
-rw-r--r-- | kmymoney2/views/kinstitutionsview.h | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/kmymoney2/views/kinstitutionsview.h b/kmymoney2/views/kinstitutionsview.h new file mode 100644 index 0000000..3a35713 --- /dev/null +++ b/kmymoney2/views/kinstitutionsview.h @@ -0,0 +1,128 @@ +/*************************************************************************** + kinstitutionssview.h + ------------------- + copyright : (C) 2005 by Thomas Baumgart + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KINSTITUTIONSVIEW_H +#define KINSTITUTIONSVIEW_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +// ---------------------------------------------------------------------------- +// Project Includes + +#include <kmymoney/mymoneyinstitution.h> +#include <kmymoney/kmymoneyaccounttree.h> +#include <kmymoney/mymoneyutils.h> + +#include "../views/kinstitutionsviewdecl.h" + +/** + * @author Thomas Baumgart + */ + +/** + * This class implements the institutions hierarchical 'view'. + */ +class KInstitutionsView : public KInstitutionsViewDecl +{ + Q_OBJECT +private: + +public: + KInstitutionsView(QWidget *parent=0, const char *name=0); + virtual ~KInstitutionsView(); + +public slots: + void slotLoadAccounts(void); + + /** + * Override the base class behaviour to include all updates that + * happened in the meantime. + */ + void show(void); + + /** + * Override the base class behaviour to restore the layout. Do not + * do this in show() because show() itself may change the layout + * in undesired ways. + */ + void polish(void); + + void slotReconcileAccount(const MyMoneyAccount& acc, const QDate& reconciliationDate, const MyMoneyMoney& endingBalance); + +protected: + void loadAccounts(void); + + // load accounts that are kept at a specific institution + void loadSubAccounts(KMyMoneyAccountTreeItem* parent, const QString& institutionId); + + // load stock accounts under the investment account (parent) + void loadSubAccounts(KMyMoneyAccountTreeItem* parent); + +protected slots: + void slotUpdateNetWorth(void); + +private: + /** + * This method returns an icon according to the account type + * passed in the argument @p type. + * + * @param type account type as defined in MyMoneyAccount::accountTypeE + */ + const QPixmap accountImage(const MyMoneyAccount::accountTypeE type) const; + +signals: + /** + * This signal serves as proxy for KMyMoneyAccountTree::selectObject() + */ + void selectObject(const MyMoneyObject&); + + /** + * This signal serves as proxy for + * KMyMoneyAccountTree::openContextMenu(const MyMoneyObject&) + */ + void openContextMenu(const MyMoneyObject& obj); + + /** + * This signal will be emitted when the left mouse button is double + * clicked (actually the KDE executed setting is used) on an account + * or institution. + */ + void openObject(const MyMoneyObject& obj); + + /** + * This signal is emitted, when the user selected to reparent the + * account @p acc to be a subordinate account of @p institution. + * + * @param acc const reference to account to be reparented + * @param institution const reference to new institution + */ + void reparent(const MyMoneyAccount& acc, const MyMoneyInstitution& institution); + +private: + MyMoneyAccount m_reconciliationAccount; + QMap<QString, MyMoneyAccount> m_accountMap; + QMap<QString, MyMoneySecurity> m_securityMap; + QMap<QString, unsigned long> m_transactionCountMap; + + /// set if a view needs to be reloaded during show() + bool m_needReload; +}; + +#endif |