LCOV - code coverage report
Current view: top level - src/qt - sendcoinsdialog.h (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 0 2 0.0 %
Date: 2020-09-26 01:30:44 Functions: 0 4 0.0 %

          Line data    Source code
       1             : // Copyright (c) 2011-2019 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.
       4             : 
       5             : #ifndef BITCOIN_QT_SENDCOINSDIALOG_H
       6             : #define BITCOIN_QT_SENDCOINSDIALOG_H
       7             : 
       8             : #include <qt/walletmodel.h>
       9             : 
      10             : #include <QDialog>
      11             : #include <QMessageBox>
      12             : #include <QString>
      13             : #include <QTimer>
      14             : 
      15             : class CCoinControl;
      16             : class ClientModel;
      17             : class PlatformStyle;
      18             : class SendCoinsEntry;
      19             : class SendCoinsRecipient;
      20             : 
      21             : namespace Ui {
      22             :     class SendCoinsDialog;
      23             : }
      24             : 
      25             : QT_BEGIN_NAMESPACE
      26             : class QUrl;
      27             : QT_END_NAMESPACE
      28             : 
      29             : /** Dialog for sending bitcoins */
      30             : class SendCoinsDialog : public QDialog
      31             : {
      32           0 :     Q_OBJECT
      33             : 
      34             : public:
      35             :     explicit SendCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
      36             :     ~SendCoinsDialog();
      37             : 
      38             :     void setClientModel(ClientModel *clientModel);
      39             :     void setModel(WalletModel *model);
      40             : 
      41             :     /** 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).
      42             :      */
      43             :     QWidget *setupTabChain(QWidget *prev);
      44             : 
      45             :     void setAddress(const QString &address);
      46             :     void pasteEntry(const SendCoinsRecipient &rv);
      47             :     bool handlePaymentRequest(const SendCoinsRecipient &recipient);
      48             : 
      49             : public Q_SLOTS:
      50             :     void clear();
      51             :     void reject() override;
      52             :     void accept() override;
      53             :     SendCoinsEntry *addEntry();
      54             :     void updateTabsAndLabels();
      55             :     void setBalance(const interfaces::WalletBalances& balances);
      56             : 
      57             : Q_SIGNALS:
      58             :     void coinsSent(const uint256& txid);
      59             : 
      60             : private:
      61             :     Ui::SendCoinsDialog *ui;
      62             :     ClientModel *clientModel;
      63             :     WalletModel *model;
      64             :     std::unique_ptr<CCoinControl> m_coin_control;
      65             :     std::unique_ptr<WalletModelTransaction> m_current_transaction;
      66             :     bool fNewRecipientAllowed;
      67             :     bool fFeeMinimized;
      68             :     const PlatformStyle *platformStyle;
      69             : 
      70             :     // Process WalletModel::SendCoinsReturn and generate a pair consisting
      71             :     // of a message and message flags for use in Q_EMIT message().
      72             :     // Additional parameter msgArg can be used via .arg(msgArg).
      73             :     void processSendCoinsReturn(const WalletModel::SendCoinsReturn &sendCoinsReturn, const QString &msgArg = QString());
      74             :     void minimizeFeeSection(bool fMinimize);
      75             :     // Format confirmation message
      76             :     bool PrepareSendText(QString& question_string, QString& informative_text, QString& detailed_text);
      77             :     void updateFeeMinimizedLabel();
      78             :     // Update the passed in CCoinControl with state from the GUI
      79             :     void updateCoinControlState(CCoinControl& ctrl);
      80             : 
      81             : private Q_SLOTS:
      82             :     void on_sendButton_clicked();
      83             :     void on_buttonChooseFee_clicked();
      84             :     void on_buttonMinimizeFee_clicked();
      85             :     void removeEntry(SendCoinsEntry* entry);
      86             :     void useAvailableBalance(SendCoinsEntry* entry);
      87             :     void updateDisplayUnit();
      88             :     void coinControlFeatureChanged(bool);
      89             :     void coinControlButtonClicked();
      90             :     void coinControlChangeChecked(int);
      91             :     void coinControlChangeEdited(const QString &);
      92             :     void coinControlUpdateLabels();
      93             :     void coinControlClipboardQuantity();
      94             :     void coinControlClipboardAmount();
      95             :     void coinControlClipboardFee();
      96             :     void coinControlClipboardAfterFee();
      97             :     void coinControlClipboardBytes();
      98             :     void coinControlClipboardLowOutput();
      99             :     void coinControlClipboardChange();
     100             :     void updateFeeSectionControls();
     101             :     void updateSmartFeeLabel();
     102             : 
     103             : Q_SIGNALS:
     104             :     // Fired when a message should be reported to the user
     105             :     void message(const QString &title, const QString &message, unsigned int style);
     106             : };
     107             : 
     108             : 
     109             : #define SEND_CONFIRM_DELAY   3
     110             : 
     111           0 : class SendConfirmationDialog : public QMessageBox
     112             : {
     113             :     Q_OBJECT
     114             : 
     115             : public:
     116             :     SendConfirmationDialog(const QString& title, const QString& text, const QString& informative_text = "", const QString& detailed_text = "", int secDelay = SEND_CONFIRM_DELAY, const QString& confirmText = "Send", QWidget* parent = nullptr);
     117             :     int exec() override;
     118             : 
     119             : private Q_SLOTS:
     120             :     void countDown();
     121             :     void updateYesButton();
     122             : 
     123             : private:
     124             :     QAbstractButton *yesButton;
     125             :     QTimer countDownTimer;
     126             :     int secDelay;
     127             :     QString confirmButtonText;
     128             : };
     129             : 
     130             : #endif // BITCOIN_QT_SENDCOINSDIALOG_H

Generated by: LCOV version 1.15