]> Git Repo - VerusCoin.git/blob - src/qt/addressbookpage.h
Cleanup code using forward declarations.
[VerusCoin.git] / src / qt / addressbookpage.h
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.
4
5 #ifndef ADDRESSBOOKPAGE_H
6 #define ADDRESSBOOKPAGE_H
7
8 #include <QDialog>
9
10 class AddressTableModel;
11 class OptionsModel;
12
13 namespace Ui {
14     class AddressBookPage;
15 }
16
17 QT_BEGIN_NAMESPACE
18 class QItemSelection;
19 class QMenu;
20 class QModelIndex;
21 class QSortFilterProxyModel;
22 class QTableView;
23 QT_END_NAMESPACE
24
25 /** Widget that shows a list of sending or receiving addresses.
26   */
27 class AddressBookPage : public QDialog
28 {
29     Q_OBJECT
30
31 public:
32     enum Tabs {
33         SendingTab = 0,
34         ReceivingTab = 1
35     };
36
37     enum Mode {
38         ForSelection, /**< Open address book to pick address */
39         ForEditing  /**< Open address book for editing */
40     };
41
42     explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0);
43     ~AddressBookPage();
44
45     void setModel(AddressTableModel *model);
46     const QString &getReturnValue() const { return returnValue; }
47
48 public slots:
49     void done(int retval);
50
51 private:
52     Ui::AddressBookPage *ui;
53     AddressTableModel *model;
54     Mode mode;
55     Tabs tab;
56     QString returnValue;
57     QSortFilterProxyModel *proxyModel;
58     QMenu *contextMenu;
59     QAction *deleteAction; // to be able to explicitly disable it
60     QString newAddressToSelect;
61
62 private slots:
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) */
72     void onEditAction();
73     /** Export button clicked */
74     void on_exportButton_clicked();
75
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*/);
82
83 signals:
84     void sendCoins(QString addr);
85 };
86
87 #endif // ADDRESSBOOKPAGE_H
This page took 0.028505 seconds and 4 git commands to generate.