update to 0.4 preview
[novacoin.git] / src / qt / sendcoinsentry.h
1 #ifndef SENDCOINSENTRY_H
2 #define SENDCOINSENTRY_H
3
4 #include <QFrame>
5
6 namespace Ui {
7     class SendCoinsEntry;
8 }
9 class WalletModel;
10 class SendCoinsRecipient;
11
12 /** A single entry in the dialog for sending bitcoins. */
13 class SendCoinsEntry : public QFrame
14 {
15     Q_OBJECT
16
17 public:
18     explicit SendCoinsEntry(QWidget *parent = 0);
19     ~SendCoinsEntry();
20
21     void setModel(WalletModel *model);
22     bool validate();
23     SendCoinsRecipient getValue();
24
25     /** Return whether the entry is still empty and unedited */
26     bool isClear();
27
28     void setValue(const SendCoinsRecipient &value);
29
30     /** 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).
31      */
32     QWidget *setupTabChain(QWidget *prev);
33
34     void setFocus();
35
36 public slots:
37     void setRemoveEnabled(bool enabled);
38     void clear();
39
40 signals:
41     void removeEntry(SendCoinsEntry *entry);
42
43 private slots:
44     void on_deleteButton_clicked();
45     void on_payTo_textChanged(const QString &address);
46     void on_addressBookButton_clicked();
47     void on_pasteButton_clicked();
48     void updateDisplayUnit();
49
50 private:
51     Ui::SendCoinsEntry *ui;
52     WalletModel *model;
53 };
54
55 #endif // SENDCOINSENTRY_H