Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/wizards/newaccountwizard/knewaccountwizard.h
Context not available. | |||||
4 | begin : Tue Sep 25 2007 | 4 | begin : Tue Sep 25 2007 | ||
---|---|---|---|---|---|
5 | copyright : (C) 2007 Thomas Baumgart | 5 | copyright : (C) 2007 Thomas Baumgart | ||
6 | email : Thomas Baumgart <ipwizard@users.sourceforge.net> | 6 | email : Thomas Baumgart <ipwizard@users.sourceforge.net> | ||
7 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||||
7 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
8 | 9 | | |||
9 | /*************************************************************************** | 10 | /*************************************************************************** | ||
Context not available. | |||||
25 | // Project Includes | 26 | // Project Includes | ||
26 | 27 | | |||
27 | #include "kmymoneywizard.h" | 28 | #include "kmymoneywizard.h" | ||
28 | #include "mymoneyaccountloan.h" | | |||
29 | #include "mymoneymoney.h" | | |||
30 | #include "mymoneyschedule.h" | | |||
31 | 29 | | |||
30 | class MyMoneyMoney; | ||||
32 | class MyMoneyPrice; | 31 | class MyMoneyPrice; | ||
33 | class MyMoneySecurity; | | |||
34 | class MyMoneyInstitution; | 32 | class MyMoneyInstitution; | ||
35 | class MyMoneyTransaction; | 33 | class MyMoneyTransaction; | ||
34 | class MyMoneySchedule; | ||||
35 | class MyMoneyAccount; | ||||
36 | 36 | | |||
37 | /** | 37 | /** | ||
38 | * @author Thomas Baumgart | 38 | * @author Thomas Baumgart | ||
39 | */ | 39 | */ | ||
40 | namespace NewAccountWizard | 40 | namespace NewAccountWizard | ||
41 | { | 41 | { | ||
42 | enum steps { | ||||
43 | StepInstitution = 1, | ||||
44 | StepAccount, | ||||
45 | StepBroker, | ||||
46 | StepDetails, | ||||
47 | StepPayments, | ||||
48 | StepFees, | ||||
49 | StepSchedule, | ||||
50 | StepPayout, | ||||
51 | StepParentAccount, | ||||
52 | StepFinish | ||||
53 | }; | ||||
42 | 54 | | |||
43 | class AccountTypePage; | 55 | /** | ||
44 | class InstitutionPage; | | |||
45 | class BrokeragePage; | | |||
46 | class CreditCardSchedulePage; | | |||
47 | class GeneralLoanInfoPage; | | |||
48 | class LoanDetailsPage; | | |||
49 | class LoanPaymentPage; | | |||
50 | class LoanSchedulePage; | | |||
51 | class LoanPayoutPage; | | |||
52 | class HierarchyPage; | | |||
53 | class AccountSummaryPage; | | |||
54 | | ||||
55 | /** | | |||
56 | * @author Thomas Baumgart | 56 | * @author Thomas Baumgart | ||
57 | * | 57 | * | ||
58 | * This class implements the new account wizard which is used to gather | 58 | * This class implements the new account wizard which is used to gather | ||
59 | * the required information from the user to create a new account | 59 | * the required information from the user to create a new account | ||
60 | */ | 60 | */ | ||
61 | class Wizard : public KMyMoneyWizard | 61 | class WizardPrivate; | ||
62 | { | 62 | class Wizard : public KMyMoneyWizard | ||
63 | friend class AccountTypePage; | 63 | { | ||
64 | friend class InstitutionPage; | 64 | friend class AccountTypePage; | ||
65 | friend class BrokeragePage; | 65 | friend class InstitutionPage; | ||
66 | friend class CreditCardSchedulePage; | 66 | friend class BrokeragePage; | ||
67 | friend class GeneralLoanInfoPage; | 67 | friend class CreditCardSchedulePage; | ||
68 | friend class LoanDetailsPage; | 68 | friend class GeneralLoanInfoPage; | ||
69 | friend class LoanPaymentPage; | 69 | friend class LoanDetailsPage; | ||
70 | friend class LoanSchedulePage; | 70 | friend class LoanPaymentPage; | ||
71 | friend class LoanPayoutPage; | 71 | friend class LoanSchedulePage; | ||
72 | friend class HierarchyPage; | 72 | friend class LoanPayoutPage; | ||
73 | friend class AccountSummaryPage; | 73 | friend class HierarchyPage; | ||
74 | 74 | friend class AccountSummaryPage; | |||
75 | Q_OBJECT | 75 | | ||
76 | public: | 76 | Q_OBJECT | ||
77 | explicit Wizard(QWidget* parent = 0, bool modal = false, Qt::WindowFlags flags = 0); | 77 | Q_DISABLE_COPY(Wizard) | ||
78 | 78 | | |||
79 | /** | 79 | public: | ||
80 | explicit Wizard(QWidget *parent = nullptr, bool modal = false, Qt::WindowFlags flags = 0); | ||||
81 | ~Wizard() override; | ||||
82 | | ||||
83 | /** | ||||
80 | * Returns the information about the account as entered by | 84 | * Returns the information about the account as entered by | ||
81 | * the user. | 85 | * the user. | ||
82 | */ | 86 | */ | ||
83 | const MyMoneyAccount& account(); | 87 | const MyMoneyAccount& account(); | ||
84 | 88 | | |||
85 | /** | 89 | /** | ||
86 | * Method to load the generated account information back into the widget | 90 | * Method to load the generated account information back into the widget | ||
87 | */ | 91 | */ | ||
88 | void setAccount(const MyMoneyAccount& acc); | 92 | void setAccount(const MyMoneyAccount& acc); | ||
89 | 93 | | |||
90 | /** | 94 | /** | ||
91 | * Returns the information about the parent account as entered by | 95 | * Returns the information about the parent account as entered by | ||
92 | * the user. | 96 | * the user. | ||
93 | * @note For now it's either fixed as Asset or Liability. We will provide | 97 | * @note For now it's either fixed as Asset or Liability. We will provide | ||
94 | * user selected parent accounts later. | 98 | * user selected parent accounts later. | ||
95 | */ | 99 | */ | ||
96 | const MyMoneyAccount& parentAccount(); | 100 | const MyMoneyAccount& parentAccount(); | ||
97 | 101 | | |||
98 | /** | 102 | /** | ||
99 | * Returns information about the schedule. If the returned value | 103 | * Returns information about the schedule. If the returned value | ||
100 | * equals MyMoneySchedule() then the user did not select to create | 104 | * equals MyMoneySchedule() then the user did not select to create | ||
101 | * a schedule. | 105 | * a schedule. | ||
102 | */ | 106 | */ | ||
103 | const MyMoneySchedule& schedule(); | 107 | const MyMoneySchedule& schedule(); | ||
104 | 108 | | |||
105 | /** | 109 | /** | ||
106 | * This method returns the value of the opening balance | 110 | * This method returns the value of the opening balance | ||
107 | * entered by the user | 111 | * entered by the user | ||
108 | */ | 112 | */ | ||
109 | MyMoneyMoney openingBalance() const; | 113 | MyMoneyMoney openingBalance() const; | ||
110 | 114 | | |||
111 | /** | 115 | /** | ||
112 | * This method returns the interest rate as factor, ie an | 116 | * This method returns the interest rate as factor, ie an | ||
113 | * interest rate of 6.5% will be returned as 0.065 | 117 | * interest rate of 6.5% will be returned as 0.065 | ||
114 | */ | 118 | */ | ||
115 | MyMoneyMoney interestRate() const; | 119 | MyMoneyMoney interestRate() const; | ||
116 | 120 | | |||
117 | /** | 121 | /** | ||
118 | * This method returns the payout transaction for loans. | 122 | * This method returns the payout transaction for loans. | ||
119 | * If the account to be created is not a loan or no | 123 | * If the account to be created is not a loan or no | ||
120 | * payout transaction should be generated, this method | 124 | * payout transaction should be generated, this method | ||
121 | * returns an emtpy transaction. | 125 | * returns an emtpy transaction. | ||
122 | */ | 126 | */ | ||
123 | MyMoneyTransaction payoutTransaction(); | 127 | MyMoneyTransaction payoutTransaction(); | ||
124 | 128 | | |||
125 | /** | 129 | /** | ||
126 | * This method returns a MyMoneyAccount() object filled | 130 | * This method returns a MyMoneyAccount() object filled | ||
127 | * with the data to create a brokerage account. If the | 131 | * with the data to create a brokerage account. If the | ||
128 | * user selected not to create a brokerage account or | 132 | * user selected not to create a brokerage account or | ||
Context not available. | |||||
132 | * @note Make sure to call the account() method before you call this method. | 136 | * @note Make sure to call the account() method before you call this method. | ||
133 | * Otherwise the returned object might contain unexpected results. | 137 | * Otherwise the returned object might contain unexpected results. | ||
134 | */ | 138 | */ | ||
135 | MyMoneyAccount brokerageAccount() const; | 139 | MyMoneyAccount brokerageAccount() const; | ||
136 | 140 | | |||
137 | /** | 141 | /** | ||
138 | * This method returns the conversion rate | 142 | * This method returns the conversion rate | ||
139 | */ | 143 | */ | ||
140 | MyMoneyPrice conversionRate() const; | 144 | MyMoneyPrice conversionRate() const; | ||
141 | | ||||
142 | protected: | | |||
143 | /** | | |||
144 | * This method returns the currently selected currency for the account | | |||
145 | */ | | |||
146 | const MyMoneySecurity& currency() const; | | |||
147 | 145 | | |||
148 | /** | 146 | signals: | ||
149 | * This method returns the precision in digits for the selected currency. | 147 | void createInstitution(MyMoneyInstitution& institution); | ||
150 | * @sa currency() | 148 | void createAccount(MyMoneyAccount& account); | ||
151 | */ | 149 | void createCategory(MyMoneyAccount&, const MyMoneyAccount&); | ||
152 | int precision() const; | | |||
153 | 150 | | |||
154 | /** | 151 | protected: | ||
152 | /** | ||||
155 | * This method returns information about the selection of the user | 153 | * This method returns information about the selection of the user | ||
156 | * if the loan is for borrowing or lending money. | 154 | * if the loan is for borrowing or lending money. | ||
157 | * | 155 | * | ||
158 | * @retval true loan is for money borrowed | 156 | * @retval true loan is for money borrowed | ||
159 | * @retval false loan is for money lent | 157 | * @retval false loan is for money lent | ||
160 | */ | 158 | */ | ||
161 | bool moneyBorrowed() const; | 159 | bool moneyBorrowed() const; | ||
162 | 160 | | |||
163 | signals: | 161 | private: | ||
164 | void createInstitution(MyMoneyInstitution& institution); | 162 | Q_DECLARE_PRIVATE(Wizard) | ||
165 | void createAccount(MyMoneyAccount& account); | 163 | }; | ||
166 | void createCategory(MyMoneyAccount&, const MyMoneyAccount&); | | |||
167 | | ||||
168 | private: | | |||
169 | InstitutionPage* m_institutionPage; | | |||
170 | AccountTypePage* m_accountTypePage; | | |||
171 | BrokeragePage* m_brokeragepage; | | |||
172 | CreditCardSchedulePage* m_schedulePage; | | |||
173 | GeneralLoanInfoPage* m_generalLoanInfoPage; | | |||
174 | LoanDetailsPage* m_loanDetailsPage; | | |||
175 | LoanPaymentPage* m_loanPaymentPage; | | |||
176 | LoanSchedulePage* m_loanSchedulePage; | | |||
177 | LoanPayoutPage* m_loanPayoutPage; | | |||
178 | HierarchyPage* m_hierarchyPage; | | |||
179 | AccountSummaryPage* m_accountSummaryPage; | | |||
180 | | ||||
181 | MyMoneyAccountLoan m_account; | | |||
182 | MyMoneySchedule m_schedule; | | |||
183 | }; | | |||
184 | 164 | | |||
185 | } // namespace | 165 | } // namespace | ||
186 | 166 | | |||
Context not available. |