knewaccountwizard_p.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                              knewaccountwizard_p.h
00003                              -------------------
00004     begin                : Tue Sep 25 2007
00005     copyright            : (C) 2007 Thomas Baumgart
00006     email                : Thomas Baumgart <ipwizard@users.sourceforge.net>
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef KNEWACCOUNTWIZARD_P_H
00019 #define KNEWACCOUNTWIZARD_P_H
00020 
00021 // ----------------------------------------------------------------------------
00022 // QT Includes
00023 
00024 #include <qcheckbox.h>
00025 
00026 // ----------------------------------------------------------------------------
00027 // KDE Includes
00028 
00029 #include <kcombobox.h>
00030 #include <klineedit.h>
00031 #include <klistview.h>
00032 
00033 // ----------------------------------------------------------------------------
00034 // Project Includes
00035 
00036 #include <kmymoney/kmymoneywizard.h>
00037 #include <kmymoney/kmymoneydateinput.h>
00038 #include <kmymoney/kmymoneycurrencyselector.h>
00039 #include <kmymoney/mymoneyaccount.h>
00040 #include <kmymoney/kmymoneyedit.h>
00041 #include <kmymoney/kmymoneycategory.h>
00042 #include <kmymoney/kmymoneyaccounttreebase.h>
00043 
00044 #include "kinstitutionpagedecl.h"
00045 #include "kaccounttypepagedecl.h"
00046 #include "kbrokeragepagedecl.h"
00047 #include "kschedulepagedecl.h"
00048 #include "kgeneralloaninfopagedecl.h"
00049 #include "kloandetailspagedecl.h"
00050 #include "kloanpaymentpagedecl.h"
00051 #include "kloanschedulepagedecl.h"
00052 #include "kloanpayoutpagedecl.h"
00053 #include "khierarchypagedecl.h"
00054 #include "kaccountsummarypagedecl.h"
00055 
00056 class Wizard;
00057 class MyMoneyInstitution;
00058 class KMyMoneyAccountTreeItem;
00059 
00060 namespace NewAccountWizard {
00061 
00062 class InstitutionPage : public KInstitutionPageDecl, public WizardPage<Wizard>
00063 {
00064   Q_OBJECT
00065 public:
00066   InstitutionPage(Wizard* parent, const char* name = 0);
00067   ~InstitutionPage();
00068   KMyMoneyWizardPage* nextPage(void) const;
00069 
00070   QWidget* initialFocusWidget(void) const { return m_institutionComboBox; }
00071 
00077   const MyMoneyInstitution& institution(void) const;
00078 
00079 private slots:
00080   void slotLoadWidgets(void);
00081   void slotNewInstitution(void);
00082   void slotSelectInstitution(int id);
00083 
00084 private:
00086   class Private;
00088   Private* const d;
00089 };
00090 
00091 class AccountTypePage : public KAccountTypePageDecl, public WizardPage<Wizard>
00092 {
00093   Q_OBJECT
00094 public:
00095   AccountTypePage(Wizard* parent, const char* name = 0);
00096   virtual bool isComplete(void) const;
00097   KMyMoneyWizardPage* nextPage(void) const;
00098 
00099   QWidget* initialFocusWidget(void) const { return m_accountName; }
00100 
00101   MyMoneyAccount::accountTypeE accountType(void) const;
00102   const MyMoneyAccount& parentAccount(void);
00103   bool allowsParentAccount(void) const;
00104   const MyMoneySecurity& currency(void) const;
00105 
00106   void setAccount(const MyMoneyAccount& acc);
00107 
00108 private:
00109   void hideShowPages(MyMoneyAccount::accountTypeE i) const;
00110   void priceWarning(bool);
00111 
00112 private slots:
00113   void slotLoadWidgets(void);
00114   void slotUpdateType(int i);
00115   void slotUpdateCurrency(void);
00116   void slotUpdateConversionRate(const QString&);
00117   void slotGetOnlineQuote(void);
00118   void slotPriceWarning(void);
00119 
00120 private:
00121   bool m_showPriceWarning;
00122 };
00123 
00124 class BrokeragePage : public KBrokeragePageDecl, public WizardPage<Wizard>
00125 {
00126   Q_OBJECT
00127 public:
00128   BrokeragePage(Wizard* parent, const char* name = 0);
00129   KMyMoneyWizardPage* nextPage(void) const;
00130   void enterPage(void);
00131 
00132   QWidget* initialFocusWidget(void) const { return m_createBrokerageButton; }
00133 
00134 private slots:
00135   void slotLoadWidgets(void);
00136 };
00137 
00138 class CreditCardSchedulePage : public KSchedulePageDecl, public WizardPage<Wizard>
00139 {
00140   Q_OBJECT
00141 public:
00142   CreditCardSchedulePage(Wizard* parent, const char* name = 0);
00143   KMyMoneyWizardPage* nextPage(void) const;
00144   virtual bool isComplete(void) const;
00145   void enterPage(void);
00146 
00147   QWidget* initialFocusWidget(void) const { return m_reminderCheckBox; }
00148 
00149 private slots:
00150   void slotLoadWidgets(void);
00151 };
00152 
00153 class GeneralLoanInfoPage : public KGeneralLoanInfoPageDecl, public WizardPage<Wizard>
00154 {
00155   Q_OBJECT
00156 public:
00157   GeneralLoanInfoPage(Wizard* parent, const char* name = 0);
00158   KMyMoneyWizardPage* nextPage(void) const;
00159   virtual bool isComplete(void) const;
00160   void enterPage(void);
00161   const MyMoneyAccount& parentAccount(void);
00162 
00163   QWidget* initialFocusWidget(void) const { return m_loanDirection; }
00164 
00168   bool recordAllPayments(void) const;
00169 
00170 private slots:
00171   void slotLoadWidgets(void);
00172 
00173 private:
00174   bool      m_firstTime;
00175 };
00176 
00177 class LoanDetailsPage : public KLoanDetailsPageDecl, public WizardPage<Wizard>
00178 {
00179   Q_OBJECT
00180 public:
00181   LoanDetailsPage(Wizard* parent, const char* name = 0);
00182   void enterPage(void);
00183   KMyMoneyWizardPage* nextPage(void) const;
00184   virtual bool isComplete(void) const;
00185 
00186   QWidget* initialFocusWidget(void) const { return m_paymentDue; }
00187 
00192   int term(void) const;
00193 
00194 private:
00200   QString updateTermWidgets(const long double term);
00201 
00202 private:
00203   bool                m_needCalculate;
00204 
00205 private slots:
00206   void slotValuesChanged(void);
00207   void slotCalculate(void);
00208 };
00209 
00210 class LoanPaymentPage : public KLoanPaymentPageDecl, public WizardPage<Wizard>
00211 {
00212   Q_OBJECT
00213 public:
00214   LoanPaymentPage(Wizard* parent, const char* name = 0);
00215   ~LoanPaymentPage();
00216 
00217   KMyMoneyWizardPage* nextPage(void) const;
00218 
00219   void enterPage(void);
00220 
00224   MyMoneyMoney additionalFees(void) const;
00225 
00229   MyMoneyMoney basePayment(void) const;
00230 
00236   void additionalFeesSplits(QValueList<MyMoneySplit>& list);
00237 
00238 protected slots:
00239   void slotAdditionalFees(void);
00240 
00241 protected:
00242   void updateAmounts(void);
00243 
00244 private:
00246   class Private;
00248   Private* const d;
00249 };
00250 
00251 class LoanSchedulePage : public KLoanSchedulePageDecl, public WizardPage<Wizard>
00252 {
00253   Q_OBJECT
00254 public:
00255   LoanSchedulePage(Wizard* parent, const char* name = 0);
00256   void enterPage(void);
00257 
00258   KMyMoneyWizardPage* nextPage(void) const;
00259 
00263   QDate firstPaymentDueDate(void) const;
00264 
00265   QWidget* initialFocusWidget(void) const { return m_interestCategory; }
00266 
00267 private slots:
00268   void slotLoadWidgets(void);
00269   void slotCreateCategory(const QString& name, QString& id);
00270 };
00271 
00272 
00273 class LoanPayoutPage : public KLoanPayoutPageDecl, public WizardPage<Wizard>
00274 {
00275   Q_OBJECT
00276 public:
00277   LoanPayoutPage(Wizard* parent, const char* name = 0);
00278   void enterPage(void);
00279   virtual bool isComplete(void) const;
00280 
00281   KMyMoneyWizardPage* nextPage(void) const;
00282 
00283   QWidget* initialFocusWidget(void) const { return m_noPayoutTransaction; }
00284 
00285   const QString& payoutAccountId(void) const;
00286 
00287 private slots:
00288   void slotLoadWidgets(void);
00289   void slotCreateAssetAccount(void);
00290   void slotButtonsToggled(void);
00291 };
00292 
00293 class HierarchyPage : public KHierarchyPageDecl, public WizardPage<Wizard>
00294 {
00295   Q_OBJECT
00296 public:
00297   HierarchyPage(Wizard* parent, const char* name = 0);
00298   void enterPage(void);
00299   KMyMoneyWizardPage* nextPage(void) const;
00300   QWidget* initialFocusWidget(void) const { return m_qlistviewParentAccounts; }
00301   const MyMoneyAccount& parentAccount(void);
00302 
00303 private:
00304   KMyMoneyAccountTreeItem* buildAccountTree
00305       ( KMyMoneyAccountTreeBase* parent
00306       , const MyMoneyAccount& account
00307       , bool open = false ) const;
00308   KMyMoneyAccountTreeItem* buildAccountTree
00309       ( KMyMoneyAccountTreeItem* parent
00310       , const MyMoneyAccount& account
00311       , bool open = false ) const;
00312   MyMoneyAccount m_topAccount;    // Last populated top account
00313   bool bFirstTime;
00314 };
00315 
00316 class AccountSummaryPage : public KAccountSummaryPageDecl, public WizardPage<Wizard>
00317 {
00318   Q_OBJECT
00319 public:
00320   AccountSummaryPage(Wizard* parent, const char* name = 0);
00321   void enterPage(void);
00322   QWidget* initialFocusWidget(void) const { return m_dataList; }
00323 };
00324 
00325 } // namespace
00326 
00327 #endif

Generated on Wed Jan 26 13:03:17 2011 for KMyMoney by  doxygen 1.5.6