Replaces numbered place marker %2 with %1.
[bitcoinplatinum.git] / src / qt / addressbookpage.h
blob54a43478d1114656488a35de39dba70e06d255f3
1 // Copyright (c) 2011-2017 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 PlatformStyle;
13 namespace Ui {
14 class AddressBookPage;
17 QT_BEGIN_NAMESPACE
18 class QItemSelection;
19 class QMenu;
20 class QModelIndex;
21 class QSortFilterProxyModel;
22 QT_END_NAMESPACE
24 /** Widget that shows a list of sending or receiving addresses.
26 class AddressBookPage : public QDialog
28 Q_OBJECT
30 public:
31 enum Tabs {
32 SendingTab = 0,
33 ReceivingTab = 1
36 enum Mode {
37 ForSelection, /**< Open address book to pick address */
38 ForEditing /**< Open address book for editing */
41 explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
42 ~AddressBookPage();
44 void setModel(AddressTableModel *model);
45 const QString &getReturnValue() const { return returnValue; }
47 public Q_SLOTS:
48 void done(int retval);
50 private:
51 Ui::AddressBookPage *ui;
52 AddressTableModel *model;
53 Mode mode;
54 Tabs tab;
55 QString returnValue;
56 QSortFilterProxyModel *proxyModel;
57 QMenu *contextMenu;
58 QAction *deleteAction; // to be able to explicitly disable it
59 QString newAddressToSelect;
61 private Q_SLOTS:
62 /** Delete currently selected address entry */
63 void on_deleteAddress_clicked();
64 /** Create a new address for receiving coins and / or add a new address book entry */
65 void on_newAddress_clicked();
66 /** Copy address of currently selected address entry to clipboard */
67 void on_copyAddress_clicked();
68 /** Copy label of currently selected address entry to clipboard (no button) */
69 void onCopyLabelAction();
70 /** Edit currently selected address entry (no button) */
71 void onEditAction();
72 /** Export button clicked */
73 void on_exportButton_clicked();
75 /** Set button states based on selected tab and selection */
76 void selectionChanged();
77 /** Spawn contextual menu (right mouse menu) for address book entry */
78 void contextualMenu(const QPoint &point);
79 /** New entry/entries were added to address table */
80 void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
82 Q_SIGNALS:
83 void sendCoins(QString addr);
86 #endif // BITCOIN_QT_ADDRESSBOOKPAGE_H