summaryrefslogtreecommitdiffstats
path: root/kmymoney2/views/kforecastview.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-07-04 22:38:03 +0000
commitdadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (patch)
tree99e72842fe687baea16376a147619b6048d7e441 /kmymoney2/views/kforecastview.h
downloadkmymoney-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/kforecastview.h')
-rw-r--r--kmymoney2/views/kforecastview.h138
1 files changed, 138 insertions, 0 deletions
diff --git a/kmymoney2/views/kforecastview.h b/kmymoney2/views/kforecastview.h
new file mode 100644
index 0000000..8beb24a
--- /dev/null
+++ b/kmymoney2/views/kforecastview.h
@@ -0,0 +1,138 @@
+/***************************************************************************
+ kforecastview.h
+ -------------------
+ copyright : (C) 2007 by Alvaro Soliverez
+ email : asoliverez@gmail.com
+ ***************************************************************************/
+
+/***************************************************************************
+ * *
+ * 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 KFORECASTVIEW_H
+#define KFORECASTVIEW_H
+
+// ----------------------------------------------------------------------------
+// QT Includes
+
+// ----------------------------------------------------------------------------
+// KDE Includes
+
+
+// ----------------------------------------------------------------------------
+// Project Includes
+
+#include <kmymoney/mymoneyaccount.h>
+#include <kmymoney/mymoneyutils.h>
+
+#include "../views/kforecastviewdecl.h"
+#include "../widgets/kmymoneyaccounttreeforecast.h"
+#include "../reports/kreportchartview.h"
+
+using namespace reports;
+
+/**
+ * @author Alvaro Soliverez
+ */
+
+/**
+ * This class implements the forecast 'view'.
+ */
+class KForecastView : public KForecastViewDecl
+{
+ Q_OBJECT
+private:
+
+public:
+ KForecastView(QWidget *parent=0, const char *name=0);
+ virtual ~KForecastView();
+
+ void show(void);
+
+public slots:
+ void slotLoadForecast(void);
+ void slotManualForecast(void);
+
+protected:
+ typedef enum {
+ SummaryView = 0,
+ ListView,
+ AdvancedView,
+ BudgetView,
+ ChartView,
+ // insert new values above this line
+ MaxViewTabs
+ } ForecastViewTab;
+
+ QMap<QString, QString> m_nameIdx;
+
+
+ /**
+ * This method loads the forecast view.
+ */
+ void loadForecast(ForecastViewTab tab);
+
+ /**
+ * This method loads the detailed view
+ */
+ void loadListView(void);
+
+ /**
+ * This method loads the summary view
+ */
+ void loadSummaryView(void);
+
+ /**
+ * This method loads the advanced view
+ */
+ void loadAdvancedView(void);
+
+ /**
+ * This method loads the budget view
+ */
+ void loadBudgetView(void);
+
+ /**
+ * This method loads the budget view
+ */
+ void loadChartView(void);
+
+ /**
+ * This method loads the settings from user configuration
+ */
+ void loadForecastSettings(void);
+
+protected slots:
+ void slotTabChanged(QWidget*);
+
+ /**
+ * Get the list of prices for an account
+ * This is used later to create an instance of KMyMoneyAccountTreeForecastItem
+ *
+ */
+ QValueList<MyMoneyPrice> getAccountPrices(const MyMoneyAccount& acc);
+
+private:
+ void addAssetLiabilityRows(const MyMoneyForecast& forecast);
+ void addIncomeExpenseRows(const MyMoneyForecast& forecast);
+ void addTotalRow(KMyMoneyAccountTreeForecast* forecastList, const MyMoneyForecast& forecast);
+ bool includeAccount(MyMoneyForecast& forecast, const MyMoneyAccount& acc);
+ void loadAccounts(MyMoneyForecast& forecast, const MyMoneyAccount& account, KMyMoneyAccountTreeForecastItem* parentItem, int forecastType);
+
+ bool m_needReload[MaxViewTabs];
+ KMyMoneyAccountTreeForecastItem* m_totalItem;
+ KMyMoneyAccountTreeForecastItem* m_assetItem;
+ KMyMoneyAccountTreeForecastItem* m_liabilityItem;
+ KMyMoneyAccountTreeForecastItem* m_incomeItem;
+ KMyMoneyAccountTreeForecastItem* m_expenseItem;
+
+ KReportChartView* m_forecastChart;
+
+};
+
+#endif