1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef ADDRESSBOOKPAGE_H
6 #define ADDRESSBOOKPAGE_H
10 class AddressTableModel;
14 class AddressBookPage;
21 class QSortFilterProxyModel;
25 /** Widget that shows a list of sending or receiving addresses.
27 class AddressBookPage : public QDialog
38 ForSelection, /**< Open address book to pick address */
39 ForEditing /**< Open address book for editing */
42 explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
45 void setModel(AddressTableModel *model);
46 const QString &getReturnValue() const { return returnValue; }
49 void done(int retval);
52 Ui::AddressBookPage *ui;
53 AddressTableModel *model;
57 QSortFilterProxyModel *proxyModel;
59 QAction *deleteAction; // to be able to explicitly disable it
60 QString newAddressToSelect;
63 /** Delete currently selected address entry */
64 void on_deleteAddress_clicked();
65 /** Create a new address for receiving coins and / or add a new address book entry */
66 void on_newAddress_clicked();
67 /** Copy address of currently selected address entry to clipboard */
68 void on_copyAddress_clicked();
69 /** Copy label of currently selected address entry to clipboard (no button) */
70 void onCopyLabelAction();
71 /** Edit currently selected address entry (no button) */
73 /** Export button clicked */
74 void on_exportButton_clicked();
76 /** Set button states based on selected tab and selection */
77 void selectionChanged();
78 /** Spawn contextual menu (right mouse menu) for address book entry */
79 void contextualMenu(const QPoint &point);
80 /** New entry/entries were added to address table */
81 void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
84 void sendCoins(QString addr);
87 #endif // ADDRESSBOOKPAGE_H