[test] Add getblockchaininfo functional test
[bitcoinplatinum.git] / src / qt / sendcoinsdialog.h
blob70b4aa5a03ab3080bfd0924db680604971049db2
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_SENDCOINSDIALOG_H
6 #define BITCOIN_QT_SENDCOINSDIALOG_H
8 #include "walletmodel.h"
10 #include <QDialog>
11 #include <QMessageBox>
12 #include <QString>
13 #include <QTimer>
15 class ClientModel;
16 class PlatformStyle;
17 class SendCoinsEntry;
18 class SendCoinsRecipient;
20 namespace Ui {
21 class SendCoinsDialog;
24 QT_BEGIN_NAMESPACE
25 class QUrl;
26 QT_END_NAMESPACE
28 /** Dialog for sending bitcoins */
29 class SendCoinsDialog : public QDialog
31 Q_OBJECT
33 public:
34 explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = 0);
35 ~SendCoinsDialog();
37 void setClientModel(ClientModel *clientModel);
38 void setModel(WalletModel *model);
40 /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
42 QWidget *setupTabChain(QWidget *prev);
44 void setAddress(const QString &address);
45 void pasteEntry(const SendCoinsRecipient &rv);
46 bool handlePaymentRequest(const SendCoinsRecipient &recipient);
48 public Q_SLOTS:
49 void clear();
50 void reject();
51 void accept();
52 SendCoinsEntry *addEntry();
53 void updateTabsAndLabels();
54 void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
55 const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
57 private:
58 Ui::SendCoinsDialog *ui;
59 ClientModel *clientModel;
60 WalletModel *model;
61 bool fNewRecipientAllowed;
62 bool fFeeMinimized;
63 const PlatformStyle *platformStyle;
65 // Process WalletModel::SendCoinsReturn and generate a pair consisting
66 // of a message and message flags for use in Q_EMIT message().
67 // Additional parameter msgArg can be used via .arg(msgArg).
68 void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
69 void minimizeFeeSection(bool fMinimize);
70 void updateFeeMinimizedLabel();
71 // Update the passed in CCoinControl with state from the GUI
72 void updateCoinControlState(CCoinControl& ctrl);
74 private Q_SLOTS:
75 void on_sendButton_clicked();
76 void on_buttonChooseFee_clicked();
77 void on_buttonMinimizeFee_clicked();
78 void removeEntry(SendCoinsEntry* entry);
79 void updateDisplayUnit();
80 void coinControlFeatureChanged(bool);
81 void coinControlButtonClicked();
82 void coinControlChangeChecked(int);
83 void coinControlChangeEdited(const QString &);
84 void coinControlUpdateLabels();
85 void coinControlClipboardQuantity();
86 void coinControlClipboardAmount();
87 void coinControlClipboardFee();
88 void coinControlClipboardAfterFee();
89 void coinControlClipboardBytes();
90 void coinControlClipboardLowOutput();
91 void coinControlClipboardChange();
92 void setMinimumFee();
93 void updateFeeSectionControls();
94 void updateMinFeeLabel();
95 void updateSmartFeeLabel();
97 Q_SIGNALS:
98 // Fired when a message should be reported to the user
99 void message(const QString &title, const QString &message, unsigned int style);
103 #define SEND_CONFIRM_DELAY 3
105 class SendConfirmationDialog : public QMessageBox
107 Q_OBJECT
109 public:
110 SendConfirmationDialog(const QString &title, const QString &text, int secDelay = SEND_CONFIRM_DELAY, QWidget *parent = 0);
111 int exec();
113 private Q_SLOTS:
114 void countDown();
115 void updateYesButton();
117 private:
118 QAbstractButton *yesButton;
119 QTimer countDownTimer;
120 int secDelay;
123 #endif // BITCOIN_QT_SENDCOINSDIALOG_H