bitcoin/src/qt/addressbookpage.h

89 lines
2.4 KiB
C
Raw Permalink Normal View History

2015-12-13 08:58:29 -08:00
// Copyright (c) 2011-2015 The Bitcoin Core developers
2014-12-12 20:09:33 -08:00
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-11-03 07:16:40 -08:00
#ifndef BITCOIN_QT_ADDRESSBOOKPAGE_H
#define BITCOIN_QT_ADDRESSBOOKPAGE_H
2011-05-08 13:23:31 -07:00
#include <QDialog>
class AddressTableModel;
class OptionsModel;
class PlatformStyle;
2011-05-12 05:44:52 -07:00
namespace Ui {
2011-07-07 08:33:15 -07:00
class AddressBookPage;
2011-05-12 05:44:52 -07:00
}
2011-05-13 13:00:27 -07:00
QT_BEGIN_NAMESPACE
class QItemSelection;
class QMenu;
class QModelIndex;
class QSortFilterProxyModel;
class QTableView;
2011-05-13 13:00:27 -07:00
QT_END_NAMESPACE
2011-11-13 04:19:52 -08:00
/** Widget that shows a list of sending or receiving addresses.
*/
2011-07-07 08:33:15 -07:00
class AddressBookPage : public QDialog
2011-05-08 13:23:31 -07:00
{
Q_OBJECT
2011-05-12 05:44:52 -07:00
2011-05-08 13:23:31 -07:00
public:
enum Tabs {
2011-05-12 05:44:52 -07:00
SendingTab = 0,
ReceivingTab = 1
};
enum Mode {
2013-10-16 06:14:26 -07:00
ForSelection, /**< Open address book to pick address */
2011-11-13 04:19:52 -08:00
ForEditing /**< Open address book for editing */
};
explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
2011-07-07 08:33:15 -07:00
~AddressBookPage();
2011-05-08 13:23:31 -07:00
void setModel(AddressTableModel *model);
2011-05-13 13:00:27 -07:00
const QString &getReturnValue() const { return returnValue; }
2011-07-07 08:33:15 -07:00
public Q_SLOTS:
2011-07-07 08:33:15 -07:00
void done(int retval);
2011-05-12 05:44:52 -07:00
private:
2011-07-07 08:33:15 -07:00
Ui::AddressBookPage *ui;
AddressTableModel *model;
Mode mode;
2011-07-07 08:33:15 -07:00
Tabs tab;
2011-05-13 13:00:27 -07:00
QString returnValue;
QSortFilterProxyModel *proxyModel;
QMenu *contextMenu;
QAction *deleteAction; // to be able to explicitly disable it
QString newAddressToSelect;
2011-05-13 13:00:27 -07:00
private Q_SLOTS:
/** Delete currently selected address entry */
void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */
void on_newAddress_clicked();
/** Copy address of currently selected address entry to clipboard */
void on_copyAddress_clicked();
/** Copy label of currently selected address entry to clipboard (no button) */
void onCopyLabelAction();
/** Edit currently selected address entry (no button) */
void onEditAction();
/** Export button clicked */
void on_exportButton_clicked();
/** Set button states based on selected tab and selection */
void selectionChanged();
/** Spawn contextual menu (right mouse menu) for address book entry */
void contextualMenu(const QPoint &point);
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
Q_SIGNALS:
void sendCoins(QString addr);
2011-05-08 13:23:31 -07:00
};
2014-11-03 07:16:40 -08:00
#endif // BITCOIN_QT_ADDRESSBOOKPAGE_H