25b8839cd66187fd822b905bd3323343fc2a218b
[novacoin.git] / src / qt / addressbookdialog.h
1 #ifndef ADDRESSBOOKDIALOG_H
2 #define ADDRESSBOOKDIALOG_H
3
4 #include <QDialog>
5
6 namespace Ui {
7     class AddressBookDialog;
8 }
9 class AddressTableModel;
10
11 QT_BEGIN_NAMESPACE
12 class QTableView;
13 QT_END_NAMESPACE
14
15 class AddressBookDialog : public QDialog
16 {
17     Q_OBJECT
18
19 public:
20     enum Tabs {
21         SendingTab = 0,
22         ReceivingTab = 1
23     };
24
25     enum Mode {
26         ForSending, // Pick address for sending
27         ForEditing  // Open address book for editing
28     };
29
30     explicit AddressBookDialog(Mode mode, QWidget *parent = 0);
31     ~AddressBookDialog();
32
33     void setModel(AddressTableModel *model);
34     void setTab(int tab);
35     const QString &getReturnValue() const { return returnValue; }
36 private:
37     Ui::AddressBookDialog *ui;
38     AddressTableModel *model;
39     QString returnValue;
40
41     QTableView *getCurrentTable();
42
43 private slots:
44     void on_buttonBox_accepted();
45     void on_deleteButton_clicked();
46     void on_tabWidget_currentChanged(int index);
47     void on_newAddressButton_clicked();
48     void on_editButton_clicked();
49     void on_copyToClipboard_clicked();
50 };
51
52 #endif // ADDRESSBOOKDIALOG_H