1 /***************************************************************************
2                              kloanpaymentpage.h
3                              -------------------
4     begin                : Tue Sep 25 2007
5     copyright            : (C) 2007 Thomas Baumgart
6     email                : Thomas Baumgart <ipwizard@users.sourceforge.net>
7  ***************************************************************************/
8 
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU General Public License as published by  *
13  *   the Free Software Foundation; either version 2 of the License, or     *
14  *   (at your option) any later version.                                   *
15  *                                                                         *
16  ***************************************************************************/
17 
18 #ifndef KLOANPAYMENTPAGE_H
19 #define KLOANPAYMENTPAGE_H
20 
21 // ----------------------------------------------------------------------------
22 // QT Includes
23 
24 #include <QWidget>
25 
26 // ----------------------------------------------------------------------------
27 // KDE Includes
28 
29 // ----------------------------------------------------------------------------
30 // Project Includes
31 
32 #include "wizardpage.h"
33 
34 class MyMoneyMoney;
35 class MyMoneySplit;
36 
37 namespace NewAccountWizard
38 {
39   class Wizard;
40 
41   class LoanPaymentPagePrivate;
42   class LoanPaymentPage : public QWidget, public WizardPage<Wizard>
43   {
44     Q_OBJECT
45     Q_DISABLE_COPY(LoanPaymentPage)
46 
47   public:
48     explicit LoanPaymentPage(Wizard* parent);
49     ~LoanPaymentPage() override;
50 
51     KMyMoneyWizardPage* nextPage() const override;
52 
53     void enterPage() override;
54 
55     /**
56    * This method returns the sum of the additional fees
57    */
58     MyMoneyMoney additionalFees() const;
59 
60     /**
61    * This method returns the base payment, that's principal and interest
62    */
63     MyMoneyMoney basePayment() const;
64 
65     /**
66    * This method returns the splits that make up the additional fees in @p list.
67    * @note The splits may contain assigned ids which the caller must remove before
68    * adding the splits to a MyMoneyTransaction object.
69    */
70     void additionalFeesSplits(QList<MyMoneySplit>& list);
71 
72   protected Q_SLOTS:
73     void slotAdditionalFees();
74 
75   protected:
76     void updateAmounts();
77 
78   private:
79     Q_DECLARE_PRIVATE_D(WizardPage<Wizard>::d_ptr, LoanPaymentPage)
80     friend class Wizard;
81     friend class AccountSummaryPage;
82   };
83 } // namespace
84 
85 #endif
86