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/kinvestmentlistitem.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/kinvestmentlistitem.h')
-rw-r--r-- | kmymoney2/views/kinvestmentlistitem.h | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/kmymoney2/views/kinvestmentlistitem.h b/kmymoney2/views/kinvestmentlistitem.h new file mode 100644 index 0000000..d0ad62b --- /dev/null +++ b/kmymoney2/views/kinvestmentlistitem.h @@ -0,0 +1,95 @@ +/*************************************************************************** + kinvestmentlistitem.h - description + ------------------- + begin : Wed Feb 6 2002 + copyright : (C) 2000-2002 by Michael Edwardes + email : [email protected] + Javier Campos Morales <[email protected]> + Felix Rodriguez <[email protected]> + John C <[email protected]> + Thomas Baumgart <[email protected]> + Kevin Tambascio <[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 KINVESTMENTLISTITEM_H +#define KINVESTMENTLISTITEM_H + +// ---------------------------------------------------------------------------- +// QT Includes + +// ---------------------------------------------------------------------------- +// KDE Includes + +#include <klistview.h> + +// ---------------------------------------------------------------------------- +// Project Includes + +#include <kmymoney/mymoneysecurity.h> +#include <kmymoney/mymoneyaccount.h> +#include <kmymoney/mymoneytransaction.h> +#include <kmymoney/mymoneyobserver.h> + +//indexes for the various columns on the summary view +#define COLUMN_NAME_INDEX 0 +#define COLUMN_SYMBOL_INDEX 1 +#define COLUMN_VALUE_INDEX 2 +#define COLUMN_QUANTITY_INDEX 3 +#define COLUMN_PRICE_INDEX 4 +#define COLUMN_COSTBASIS_INDEX 5 +#define COLUMN_RAWGAIN_INDEX 6 +#define COLUMN_1WEEKGAIN_INDEX 7 +#define COLUMN_4WEEKGAIN_INDEX 8 +#define COLUMN_3MONGAIN_INDEX 9 +#define COLUMN_YTDGAIN_INDEX 10 + +/** + * @author Kevin Tambascio + * @author Thomas Baumgart + */ +class KInvestmentListItem : public KListViewItem +{ +public: + KInvestmentListItem(KListView* parent, const MyMoneyAccount& security); + ~KInvestmentListItem(); + + QString securityId() const { return m_account.currencyId(); }; + const MyMoneyAccount& account(void) const { return m_account; }; + const MyMoneySecurity tradingCurrency(void) const { return m_tradingCurrency; }; + + /** + * Helper method to show the right order + */ + int compare(QListViewItem* i, int col, bool ascending) const; + + +protected: + void paintCell(QPainter * p, const QColorGroup & cg, int column, int width, int align); + +private: + // FIXME PRICE +#if 0 + const QString calculate1WeekGain(const equity_price_history& history); + const QString calculate4WeekGain(const equity_price_history& history); + const QString calculate3MonthGain(const equity_price_history& history); + const QString calculateYTDGain(const equity_price_history& history); + const QString calculateGain(const equity_price_history& history, int dayDifference, int monthDifference, bool YTD, bool& bNegative); +#endif + +private: + KListView* m_listView; + MyMoneyAccount m_account; + MyMoneySecurity m_tradingCurrency; + bool bColumn5Negative, bColumn6Negative, bColumn7Negative, bColumn8Negative, bColumn9Negative; +}; + +#endif |