1a97f3d60230f344b86cf2d41876d6afb091b939
[novacoin.git] / src / qt / addressbookpage.h
1 #ifndef ADDRESSBOOKPAGE_H
2 #define ADDRESSBOOKPAGE_H
3
4 #include <QDialog>
5
6 namespace Ui {
7     class AddressBookPage;
8 }
9 class AddressTableModel;
10
11 QT_BEGIN_NAMESPACE
12 class QTableView;
13 class QItemSelection;
14 class QSortFilterProxyModel;
15 QT_END_NAMESPACE
16
17 /** Widget that shows a list of sending or receiving addresses.
18   */
19 class AddressBookPage : public QDialog
20 {
21     Q_OBJECT
22
23 public:
24     enum Tabs {
25         SendingTab = 0,
26         ReceivingTab = 1
27     };
28
29     enum Mode {
30         ForSending, /**< Open address book to pick address for sending */
31         ForEditing  /**< Open address book for editing */
32     };
33
34     explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
35     ~AddressBookPage();
36
37     void setModel(AddressTableModel *model);
38     const QString &getReturnValue() const { return returnValue; }
39
40 public slots:
41     void done(int retval);
42     void exportClicked();
43
44 private:
45     Ui::AddressBookPage *ui;
46     AddressTableModel *model;
47     Mode mode;
48     Tabs tab;
49     QString returnValue;
50     QSortFilterProxyModel *proxyModel;
51
52 private slots:
53     void on_deleteButton_clicked();
54     void on_newAddressButton_clicked();
55     void on_copyToClipboard_clicked();
56     void selectionChanged();
57 };
58
59 #endif // ADDRESSBOOKDIALOG_H