Files
thehub/hub-qt/sendcoinsentry.h
T

88 lines
2.3 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_SENDCOINSENTRY_H
#define FLOWEE_QT_SENDCOINSENTRY_H
2011-07-16 19:01:05 +02:00
2013-04-13 00:13:08 -05:00
#include "walletmodel.h"
#include <QStackedWidget>
2013-04-13 00:13:08 -05:00
class WalletModel;
2015-07-28 15:20:14 +02:00
class PlatformStyle;
2011-07-16 19:01:05 +02:00
namespace Ui {
class SendCoinsEntry;
}
/**
* A single entry in the dialog for sending bitcoins.
* Stacked widget, with different UIs for payment requests
* with a strong payee identity.
*/
class SendCoinsEntry : public QStackedWidget
2011-07-16 19:01:05 +02:00
{
Q_OBJECT
public:
2015-07-28 15:20:14 +02:00
explicit SendCoinsEntry(const PlatformStyle *platformStyle, QWidget *parent = 0);
2011-07-16 19:01:05 +02:00
~SendCoinsEntry();
void setModel(WalletModel *model);
bool validate();
SendCoinsRecipient getValue();
2011-08-07 16:04:48 +02:00
2011-11-13 13:19:52 +01:00
/** Return whether the entry is still empty and unedited */
2011-08-07 16:04:48 +02:00
bool isClear();
void setValue(const SendCoinsRecipient &value);
void setAddress(const QString &address);
2011-08-07 16:04:48 +02:00
2013-09-13 16:49:35 +02:00
/** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases
* (issue https://bugreports.qt-project.org/browse/QTBUG-10907).
2011-11-13 13:19:52 +01:00
*/
2011-07-16 19:01:05 +02:00
QWidget *setupTabChain(QWidget *prev);
void setFocus();
2015-07-14 13:59:05 +02:00
public Q_SLOTS:
2011-07-16 19:01:05 +02:00
void clear();
2015-07-14 13:59:05 +02:00
Q_SIGNALS:
2011-07-16 19:01:05 +02:00
void removeEntry(SendCoinsEntry *entry);
2013-08-12 17:03:03 +02:00
void payAmountChanged();
2014-07-23 14:34:36 +02:00
void subtractFeeFromAmountChanged();
2011-07-16 19:01:05 +02:00
2015-07-14 13:59:05 +02:00
private Q_SLOTS:
void deleteClicked();
2011-07-16 19:01:05 +02:00
void on_payTo_textChanged(const QString &address);
void on_addressBookButton_clicked();
void on_pasteButton_clicked();
void updateDisplayUnit();
2011-07-16 19:01:05 +02:00
private:
SendCoinsRecipient recipient;
2011-07-16 19:01:05 +02:00
Ui::SendCoinsEntry *ui;
WalletModel *model;
2015-07-28 15:20:14 +02:00
const PlatformStyle *platformStyle;
2013-10-16 17:11:39 +02:00
bool updateLabel(const QString &address);
2011-07-16 19:01:05 +02:00
};
2018-01-16 10:47:52 +00:00
#endif