Update CMakeLists.txt - play with openssl
[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 class OptionsModel;
11
12 QT_BEGIN_NAMESPACE
13 class QTableView;
14 class QItemSelection;
15 class QSortFilterProxyModel;
16 class QMenu;
17 class QModelIndex;
18 QT_END_NAMESPACE
19
20 /** Widget that shows a list of sending or receiving addresses.
21   */
22 class AddressBookPage : public QDialog
23 {
24     Q_OBJECT
25
26 public:
27     enum Tabs {
28         SendingTab = 0,
29         ReceivingTab = 1
30     };
31
32     enum Mode {
33         ForSending, /**< Open address book to pick address for sending */
34         ForEditing  /**< Open address book for editing */
35     };
36
37     explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
38     ~AddressBookPage();
39
40     void setModel(AddressTableModel *model);
41     void setOptionsModel(OptionsModel *optionsModel);
42     const QString &getReturnValue() const { return returnValue; }
43
44 public slots:
45     void done(int retval);
46     void exportClicked();
47
48 private:
49     Ui::AddressBookPage *ui;
50     AddressTableModel *model;
51     OptionsModel *optionsModel;
52     Mode mode;
53     Tabs tab;
54     QString returnValue;
55     QSortFilterProxyModel *proxyModel;
56     QMenu *contextMenu;
57     QAction *deleteAction;
58     QString newAddressToSelect;
59
60 private slots:
61     void on_deleteButton_clicked();
62     void on_newAddressButton_clicked();
63     /** Copy address of currently selected address entry to clipboard */
64     void on_copyToClipboard_clicked();
65     void on_signMessage_clicked();
66     void on_verifyMessage_clicked();
67     void selectionChanged();
68     void on_showQRCode_clicked();
69     /** Spawn contextual menu (right mouse menu) for address book entry */
70     void contextualMenu(const QPoint &point);
71
72     /** Copy label of currently selected address entry to clipboard */
73     void onCopyLabelAction();
74     /** Edit currently selected address entry */
75     void onEditAction();
76
77     /** New entry/entries were added to address table */
78     void selectNewAddress(const QModelIndex &parent, int begin, int end);
79
80 signals:
81     void signMessage(QString addr);
82     void verifyMessage(QString addr);
83 };
84
85 #endif // ADDRESSBOOKDIALOG_H