File indexing completed on 2024-06-09 05:03:29

0001 /*
0002     SPDX-FileCopyrightText: 2007 Thomas Baumgart <ipwizard@users.sourceforge.net>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KLOANDETAILSPAGE_H
0007 #define KLOANDETAILSPAGE_H
0008 
0009 // ----------------------------------------------------------------------------
0010 // QT Includes
0011 
0012 #include <QWidget>
0013 
0014 // ----------------------------------------------------------------------------
0015 // KDE Includes
0016 
0017 // ----------------------------------------------------------------------------
0018 // Project Includes
0019 
0020 #include "wizardpage.h"
0021 
0022 namespace NewAccountWizard
0023 {
0024 class Wizard;
0025 
0026 class LoanDetailsPagePrivate;
0027 class LoanDetailsPage : public QWidget, public WizardPage<Wizard>
0028 {
0029     Q_OBJECT
0030     Q_DISABLE_COPY(LoanDetailsPage)
0031 
0032 public:
0033     explicit LoanDetailsPage(Wizard* parent);
0034     ~LoanDetailsPage() override;
0035 
0036     void enterPage() override;
0037     KMyMoneyWizardPage* nextPage() const override;
0038     virtual bool isComplete() const override;
0039 
0040     QWidget* initialFocusWidget() const override;
0041 
0042     /**
0043     * This method returns the number of payments depending on
0044     * the settings of m_termAmount and m_termUnit widgets
0045     */
0046     int term() const;
0047 
0048 private:
0049     /**
0050     * This method is used to update the term widgets
0051     * according to the length of the given @a term.
0052     * The term is also converted into a string and returned.
0053     */
0054     QString updateTermWidgets(const double term);
0055 
0056 private Q_SLOTS:
0057     void slotValuesChanged();
0058     void slotCalculate();
0059 
0060 private:
0061     Q_DECLARE_PRIVATE_D(WizardPage<Wizard>::d_ptr, LoanDetailsPage)
0062     friend class Wizard;
0063     friend class AccountSummaryPage;
0064     friend class LoanPaymentPage;
0065 };
0066 } // namespace
0067 
0068 #endif