Update CMakeLists.txt - play with openssl
[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 QDoubleSpinBox;
8 class QValueComboBox;
9 QT_END_NAMESPACE
10
11 /** Widget for entering bitcoin amounts.
12   */
13 class BitcoinAmountField: public QWidget
14 {
15     Q_OBJECT
16     Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true)
17 public:
18     explicit BitcoinAmountField(QWidget *parent = 0);
19
20     qint64 value(bool *valid=0) const;
21     void setValue(qint64 value);
22
23     /** Mark current value as invalid in UI. */
24     void setValid(bool valid);
25     /** Perform input validation, mark field as invalid if entered value is not valid. */
26     bool validate();
27
28     /** Change unit used to display amount. */
29     void setDisplayUnit(int unit);
30
31     /** Make field empty and ready for new input. */
32     void clear();
33
34     /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907),
35         in these cases we have to set it up manually.
36     */
37     QWidget *setupTabChain(QWidget *prev);
38
39 signals:
40     void textChanged();
41
42 protected:
43     /** Intercept focus-in event and ',' key presses */
44     bool eventFilter(QObject *object, QEvent *event);
45
46 private:
47     QDoubleSpinBox *amount;
48     QValueComboBox *unit;
49     int currentUnit;
50
51     void setText(const QString &text);
52     QString text() const;
53
54 private slots:
55     void unitChanged(int idx);
56
57 };
58
59
60 #endif // BITCOINFIELD_H