add sendmany support
[novacoin.git] / src / qt / bitcoinamountfield.h
1 #ifndef BITCOINFIELD_H
2 #define BITCOINFIELD_H
3
4 #include <QWidget>
5
6 QT_BEGIN_NAMESPACE
7 class QValidatedLineEdit;
8 QT_END_NAMESPACE
9
10 // Coin amount entry widget with separate parts for whole
11 // coins and decimals.
12 class BitcoinAmountField: public QWidget
13 {
14     Q_OBJECT
15     Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged USER true);
16 public:
17     explicit BitcoinAmountField(QWidget *parent = 0);
18
19     void setText(const QString &text);
20     QString text() const;
21     bool validate();
22     // Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907)
23     // Hence we have to set it up manually
24     QWidget *setupTabChain(QWidget *prev);
25
26 signals:
27     void textChanged();
28
29 protected:
30     // Intercept '.' and ',' keys, if pressed focus a specified widget
31     bool eventFilter(QObject *object, QEvent *event);
32
33 private:
34     QValidatedLineEdit *amount;
35     QValidatedLineEdit *decimals;
36 };
37
38
39 #endif // BITCOINFIELD_H