[gitian] Use vm-builder_0.12.4+bzr494 on Debian
[bitcoinplatinum.git] / src / qt / addressbookpage.h
blob92e6cab9acbc9372f4c3ec7953d9bc6b454ced1c
1 // Copyright (c) 2011-2013 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_ADDRESSBOOKPAGE_H
6 #define BITCOIN_QT_ADDRESSBOOKPAGE_H
8 #include <QDialog>
10 class AddressTableModel;
11 class OptionsModel;
12 class PlatformStyle;
14 namespace Ui {
15 class AddressBookPage;
18 QT_BEGIN_NAMESPACE
19 class QItemSelection;
20 class QMenu;
21 class QModelIndex;
22 class QSortFilterProxyModel;
23 class QTableView;
24 QT_END_NAMESPACE
26 /** Widget that shows a list of sending or receiving addresses.
28 class AddressBookPage : public QDialog
30 Q_OBJECT
32 public:
33 enum Tabs {
34 SendingTab = 0,
35 ReceivingTab = 1
38 enum Mode {
39 ForSelection, /**< Open address book to pick address */
40 ForEditing /**< Open address book for editing */
43 explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
44 ~AddressBookPage();
46 void setModel(AddressTableModel *model);
47 const QString &getReturnValue() const { return returnValue; }
49 public Q_SLOTS:
50 void done(int retval);
52 private:
53 Ui::AddressBookPage *ui;
54 AddressTableModel *model;
55 Mode mode;
56 Tabs tab;
57 QString returnValue;
58 QSortFilterProxyModel *proxyModel;
59 QMenu *contextMenu;
60 QAction *deleteAction; // to be able to explicitly disable it
61 QString newAddressToSelect;
63 private Q_SLOTS:
64 /** Delete currently selected address entry */
65 void on_deleteAddress_clicked();
66 /** Create a new address for receiving coins and / or add a new address book entry */
67 void on_newAddress_clicked();
68 /** Copy address of currently selected address entry to clipboard */
69 void on_copyAddress_clicked();
70 /** Copy label of currently selected address entry to clipboard (no button) */
71 void onCopyLabelAction();
72 /** Edit currently selected address entry (no button) */
73 void onEditAction();
74 /** Export button clicked */
75 void on_exportButton_clicked();
77 /** Set button states based on selected tab and selection */
78 void selectionChanged();
79 /** Spawn contextual menu (right mouse menu) for address book entry */
80 void contextualMenu(const QPoint &point);
81 /** New entry/entries were added to address table */
82 void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
84 Q_SIGNALS:
85 void sendCoins(QString addr);
88 #endif // BITCOIN_QT_ADDRESSBOOKPAGE_H