Files
thehub/hub-qt/addressbookpage.h
T

103 lines
3.0 KiB
C++
Raw Permalink Normal View History

2017-11-09 19:34:51 +01:00
/*
* This file is part of the Flowee project
* Copyright (C) 2011-2015 The Bitcoin Core developers
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2013-11-04 16:20:43 +01:00
2018-01-16 10:47:52 +00:00
#ifndef FLOWEE_QT_ADDRESSBOOKPAGE_H
#define FLOWEE_QT_ADDRESSBOOKPAGE_H
2011-05-08 22:23:31 +02:00
#include <QDialog>
2013-04-13 00:13:08 -05:00
class AddressTableModel;
class OptionsModel;
2015-07-28 15:20:14 +02:00
class PlatformStyle;
2013-04-13 00:13:08 -05:00
2011-05-12 14:44:52 +02:00
namespace Ui {
2011-07-07 17:33:15 +02:00
class AddressBookPage;
2011-05-12 14:44:52 +02:00
}
2011-05-13 22:00:27 +02:00
QT_BEGIN_NAMESPACE
class QItemSelection;
class QMenu;
2012-05-06 22:41:35 +02:00
class QModelIndex;
2013-04-13 00:13:08 -05:00
class QSortFilterProxyModel;
class QTableView;
2011-05-13 22:00:27 +02:00
QT_END_NAMESPACE
2011-11-13 13:19:52 +01:00
/** Widget that shows a list of sending or receiving addresses.
*/
2011-07-07 17:33:15 +02:00
class AddressBookPage : public QDialog
2011-05-08 22:23:31 +02:00
{
Q_OBJECT
2011-05-12 14:44:52 +02:00
2011-05-08 22:23:31 +02:00
public:
enum Tabs {
2011-05-12 14:44:52 +02:00
SendingTab = 0,
ReceivingTab = 1
};
enum Mode {
2013-10-16 15:14:26 +02:00
ForSelection, /**< Open address book to pick address */
2011-11-13 13:19:52 +01:00
ForEditing /**< Open address book for editing */
};
2015-07-28 15:20:14 +02:00
explicit AddressBookPage(const PlatformStyle *platformStyle, Mode mode, Tabs tab, QWidget *parent);
2011-07-07 17:33:15 +02:00
~AddressBookPage();
2011-05-08 22:23:31 +02:00
void setModel(AddressTableModel *model);
2011-05-13 22:00:27 +02:00
const QString &getReturnValue() const { return returnValue; }
2011-07-07 17:33:15 +02:00
2015-07-14 13:59:05 +02:00
public Q_SLOTS:
2011-07-07 17:33:15 +02:00
void done(int retval);
2011-05-12 14:44:52 +02:00
private:
2011-07-07 17:33:15 +02:00
Ui::AddressBookPage *ui;
AddressTableModel *model;
Mode mode;
2011-07-07 17:33:15 +02:00
Tabs tab;
2011-05-13 22:00:27 +02:00
QString returnValue;
QSortFilterProxyModel *proxyModel;
QMenu *contextMenu;
QAction *deleteAction; // to be able to explicitly disable it
2012-05-06 22:41:35 +02:00
QString newAddressToSelect;
2011-05-13 22:00:27 +02:00
2015-07-14 13:59:05 +02:00
private Q_SLOTS:
/** Delete currently selected address entry */
2013-04-02 12:08:13 +02:00
void on_deleteAddress_clicked();
/** Create a new address for receiving coins and / or add a new address book entry */
2013-04-02 12:08:13 +02:00
void on_newAddress_clicked();
/** Copy address of currently selected address entry to clipboard */
2013-04-02 12:08:13 +02:00
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();
2013-04-12 12:24:41 +02:00
/** Export button clicked */
void on_exportButton_clicked();
2012-05-06 22:41:35 +02:00
/** 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);
2012-05-06 22:41:35 +02:00
/** New entry/entries were added to address table */
void selectNewAddress(const QModelIndex &parent, int begin, int /*end*/);
2015-07-14 13:59:05 +02:00
Q_SIGNALS:
void sendCoins(QString addr);
2011-05-08 22:23:31 +02:00
};
2018-01-16 10:47:52 +00:00
#endif