Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/dialogs/kcurrencycalculator.h
Context not available. | |||||
9 | John C <thetacoturtle@users.sourceforge.net> | 9 | John C <thetacoturtle@users.sourceforge.net> | ||
---|---|---|---|---|---|
10 | Thomas Baumgart <ipwizard@users.sourceforge.net> | 10 | Thomas Baumgart <ipwizard@users.sourceforge.net> | ||
11 | Kevin Tambascio <ktambascio@users.sourceforge.net> | 11 | Kevin Tambascio <ktambascio@users.sourceforge.net> | ||
12 | (C) 2017 by Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||||
12 | ***************************************************************************/ | 13 | ***************************************************************************/ | ||
13 | 14 | | |||
14 | /*************************************************************************** | 15 | /*************************************************************************** | ||
Context not available. | |||||
34 | // ---------------------------------------------------------------------------- | 35 | // ---------------------------------------------------------------------------- | ||
35 | // Project Includes | 36 | // Project Includes | ||
36 | 37 | | |||
37 | #include "ui_kcurrencycalculatordecl.h" | 38 | class QDate; | ||
38 | #include "mymoneymoney.h" | | |||
39 | #include "mymoneysecurity.h" | | |||
40 | 39 | | |||
40 | class MyMoneyMoney; | ||||
41 | class MyMoneySplit; | 41 | class MyMoneySplit; | ||
42 | class MyMoneyTransaction; | 42 | class MyMoneyTransaction; | ||
43 | class QDialogButtonBox; | 43 | class MyMoneySecurity; | ||
44 | | ||||
45 | namespace Ui { class KCurrencyCalculator; } | ||||
46 | | ||||
47 | typedef qint64 signed64; | ||||
44 | 48 | | |||
45 | /** | 49 | /** | ||
46 | * @author Thomas Baumgart | 50 | * @author Thomas Baumgart | ||
47 | */ | 51 | */ | ||
48 | class KCurrencyCalculatorDecl : public QDialog, public Ui::KCurrencyCalculatorDecl | | |||
49 | { | | |||
50 | public: | | |||
51 | KCurrencyCalculatorDecl(QWidget *parent) : QDialog(parent) { | | |||
52 | setupUi(this); | | |||
53 | } | | |||
54 | }; | | |||
55 | 52 | | |||
56 | class KCurrencyCalculator : public KCurrencyCalculatorDecl | 53 | class KCurrencyCalculatorPrivate; | ||
54 | class KCurrencyCalculator : public QDialog | ||||
57 | { | 55 | { | ||
58 | Q_OBJECT | 56 | Q_OBJECT | ||
57 | Q_DISABLE_COPY(KCurrencyCalculator) | ||||
59 | 58 | | |||
60 | public: | 59 | public: | ||
61 | /** | 60 | /** | ||
Context not available. | |||||
69 | * | 68 | * | ||
70 | * @note @p value must not be 0! | 69 | * @note @p value must not be 0! | ||
71 | */ | 70 | */ | ||
72 | KCurrencyCalculator(const MyMoneySecurity& from, const MyMoneySecurity& to, const MyMoneyMoney& value, const MyMoneyMoney& shares, const QDate& date, const signed64 resultFraction = 100, QWidget *parent = 0); | 71 | explicit KCurrencyCalculator(const MyMoneySecurity& from, | ||
72 | const MyMoneySecurity& to, | ||||
73 | const MyMoneyMoney& value, | ||||
74 | const MyMoneyMoney& shares, | ||||
75 | const QDate& date, | ||||
76 | const signed64 resultFraction = 100, | ||||
77 | QWidget *parent = nullptr); | ||||
73 | ~KCurrencyCalculator(); | 78 | ~KCurrencyCalculator(); | ||
74 | 79 | | |||
75 | /** | 80 | /** | ||
Context not available. | |||||
87 | 92 | | |||
88 | void setupPriceEditor(); | 93 | void setupPriceEditor(); | ||
89 | 94 | | |||
90 | static bool setupSplitPrice(MyMoneyMoney& shares, const MyMoneyTransaction& t, const MyMoneySplit& s, const QMap<QString, MyMoneyMoney>& priceInfo, QWidget* parentWidget); | 95 | static bool setupSplitPrice(MyMoneyMoney& shares, | ||
91 | 96 | const MyMoneyTransaction& t, | |||
92 | protected: | 97 | const MyMoneySplit& s, | ||
93 | void updateExample(const MyMoneyMoney& price); | 98 | const QMap<QString, | ||
99 | MyMoneyMoney>& priceInfo, | ||||
100 | QWidget* parentWidget); | ||||
94 | 101 | | |||
95 | protected slots: | 102 | protected slots: | ||
96 | void slotSetToAmount(); | 103 | void slotSetToAmount(); | ||
97 | void slotSetExchangeRate(); | 104 | void slotSetExchangeRate(); | ||
98 | void slotUpdateResult(const QString& txt); | 105 | void slotUpdateResult(const QString& txt); | ||
99 | void slotUpdateRate(const QString& txt); | 106 | void slotUpdateRate(const QString& txt); | ||
100 | virtual void accept(); | 107 | void accept() override; | ||
101 | 108 | | |||
102 | private: | 109 | private: | ||
103 | MyMoneySecurity m_fromCurrency; | 110 | KCurrencyCalculatorPrivate * const d_ptr; | ||
104 | MyMoneySecurity m_toCurrency; | 111 | Q_DECLARE_PRIVATE(KCurrencyCalculator) | ||
105 | MyMoneyMoney m_result; | | |||
106 | MyMoneyMoney m_value; | | |||
107 | signed64 m_resultFraction; | | |||
108 | QDialogButtonBox *m_buttonBox; | | |||
109 | }; | 112 | }; | ||
110 | 113 | | |||
111 | #endif | 114 | #endif | ||
Context not available. |