1 // Copyright (c) 2011-2013 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"
17 class SendCoinsRecipient
;
20 class SendCoinsDialog
;
27 const int defaultConfirmTarget
= 25;
29 /** Dialog for sending bitcoins */
30 class SendCoinsDialog
: public QDialog
35 explicit SendCoinsDialog(const PlatformStyle
*platformStyle
, QWidget
*parent
= 0);
38 void setClientModel(ClientModel
*clientModel
);
39 void setModel(WalletModel
*model
);
41 /** 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).
43 QWidget
*setupTabChain(QWidget
*prev
);
45 void setAddress(const QString
&address
);
46 void pasteEntry(const SendCoinsRecipient
&rv
);
47 bool handlePaymentRequest(const SendCoinsRecipient
&recipient
);
53 SendCoinsEntry
*addEntry();
54 void updateTabsAndLabels();
55 void setBalance(const CAmount
& balance
, const CAmount
& unconfirmedBalance
, const CAmount
& immatureBalance
,
56 const CAmount
& watchOnlyBalance
, const CAmount
& watchUnconfBalance
, const CAmount
& watchImmatureBalance
);
59 Ui::SendCoinsDialog
*ui
;
60 ClientModel
*clientModel
;
62 bool fNewRecipientAllowed
;
64 const PlatformStyle
*platformStyle
;
66 // Process WalletModel::SendCoinsReturn and generate a pair consisting
67 // of a message and message flags for use in Q_EMIT message().
68 // Additional parameter msgArg can be used via .arg(msgArg).
69 void processSendCoinsReturn(const WalletModel::SendCoinsReturn
&sendCoinsReturn
, const QString
&msgArg
= QString());
70 void minimizeFeeSection(bool fMinimize
);
71 void updateFeeMinimizedLabel();
74 void on_sendButton_clicked();
75 void on_buttonChooseFee_clicked();
76 void on_buttonMinimizeFee_clicked();
77 void removeEntry(SendCoinsEntry
* entry
);
78 void updateDisplayUnit();
79 void coinControlFeatureChanged(bool);
80 void coinControlButtonClicked();
81 void coinControlChangeChecked(int);
82 void coinControlChangeEdited(const QString
&);
83 void coinControlUpdateLabels();
84 void coinControlClipboardQuantity();
85 void coinControlClipboardAmount();
86 void coinControlClipboardFee();
87 void coinControlClipboardAfterFee();
88 void coinControlClipboardBytes();
89 void coinControlClipboardPriority();
90 void coinControlClipboardLowOutput();
91 void coinControlClipboardChange();
93 void updateFeeSectionControls();
94 void updateMinFeeLabel();
95 void updateSmartFeeLabel();
96 void updateGlobalFeeVariables();
99 // Fired when a message should be reported to the user
100 void message(const QString
&title
, const QString
&message
, unsigned int style
);
103 #endif // BITCOIN_QT_SENDCOINSDIALOG_H