Bitcoin Core  22.99.0
P2P Digital Currency
walletview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2020 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_WALLETVIEW_H
6 #define BITCOIN_QT_WALLETVIEW_H
7 
8 #include <amount.h>
9 
10 #include <QStackedWidget>
11 
12 class ClientModel;
13 class OverviewPage;
14 class PlatformStyle;
15 class ReceiveCoinsDialog;
16 class SendCoinsDialog;
17 class SendCoinsRecipient;
18 class TransactionView;
19 class WalletModel;
20 class AddressBookPage;
21 
22 QT_BEGIN_NAMESPACE
23 class QModelIndex;
24 class QProgressDialog;
25 QT_END_NAMESPACE
26 
27 /*
28  WalletView class. This class represents the view to a single wallet.
29  It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.
30  It communicates with both the client and the wallet models to give the user an up-to-date view of the
31  current core state.
32 */
33 class WalletView : public QStackedWidget
34 {
35  Q_OBJECT
36 
37 public:
38  explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);
39  ~WalletView();
40 
51 
52  bool handlePaymentRequest(const SendCoinsRecipient& recipient);
53 
54  void showOutOfSyncWarning(bool fShow);
55 
56 private:
59 
61  QWidget *transactionsPage;
66 
68 
69  QProgressDialog* progressDialog{nullptr};
71 
72 public Q_SLOTS:
74  void gotoOverviewPage();
76  void gotoHistoryPage();
78  void gotoReceiveCoinsPage();
80  void gotoSendCoinsPage(QString addr = "");
81 
83  void gotoSignMessageTab(QString addr = "");
85  void gotoVerifyMessageTab(QString addr = "");
87  void gotoLoadPSBT(bool from_clipboard = false);
88 
93  void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
95  void encryptWallet();
97  void backupWallet();
99  void changePassphrase();
101  void unlockWallet();
102 
104  void usedSendingAddresses();
106  void usedReceivingAddresses();
107 
109  void updateEncryptionStatus();
110 
112  void showProgress(const QString &title, int nProgress);
113 
114 Q_SIGNALS:
115  void setPrivacy(bool privacy);
116  void transactionClicked();
117  void coinsSent();
119  void message(const QString &title, const QString &message, unsigned int style);
123  void hdEnabledStatusChanged();
125  void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName);
128 };
129 
130 #endif // BITCOIN_QT_WALLETVIEW_H
WalletView::sendCoinsPage
SendCoinsDialog * sendCoinsPage
Definition: walletview.h:63
TransactionView
Widget showing the transaction list for a wallet, including a filter row.
Definition: transactionview.h:32
WalletView::platformStyle
const PlatformStyle * platformStyle
Definition: walletview.h:70
ReceiveCoinsDialog
Dialog for requesting payment of bitcoins.
Definition: receivecoinsdialog.h:30
WalletView::transactionView
TransactionView * transactionView
Definition: walletview.h:67
WalletView
Definition: walletview.h:33
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:51
WalletView::showOutOfSyncWarning
void showOutOfSyncWarning(bool fShow)
Definition: walletview.cpp:251
WalletView::usedSendingAddressesPage
AddressBookPage * usedSendingAddressesPage
Definition: walletview.h:64
WalletView::gotoReceiveCoinsPage
void gotoReceiveCoinsPage()
Switch to receive coins page.
Definition: walletview.cpp:171
WalletView::overviewPage
OverviewPage * overviewPage
Definition: walletview.h:60
OverviewPage
Overview ("home") page widget.
Definition: overviewpage.h:28
WalletView::showProgress
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: walletview.cpp:328
WalletView::clientModel
ClientModel * clientModel
Definition: walletview.h:57
WalletView::setPrivacy
void setPrivacy(bool privacy)
WalletView::handlePaymentRequest
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletview.cpp:246
WalletView::gotoSendCoinsPage
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletview.cpp:176
WalletView::gotoSignMessageTab
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletview.cpp:184
WalletView::encryptWallet
void encryptWallet()
Encrypt the wallet.
Definition: walletview.cpp:261
WalletView::incomingTransaction
void incomingTransaction(const QString &date, int unit, const CAmount &amount, const QString &type, const QString &address, const QString &label, const QString &walletName)
Notify that a new transaction appeared.
WalletView::processNewTransaction
void processNewTransaction(const QModelIndex &parent, int start, int)
Show incoming transaction notification for new transactions.
Definition: walletview.cpp:141
WalletView::hdEnabledStatusChanged
void hdEnabledStatusChanged()
HD-Enabled status of wallet changed (only possible during startup)
SendCoinsRecipient
Definition: sendcoinsrecipient.h:19
WalletView::getWalletModel
WalletModel * getWalletModel()
Definition: walletview.h:45
WalletView::setClientModel
void setClientModel(ClientModel *clientModel)
Set the client model.
Definition: walletview.cpp:97
WalletView::usedReceivingAddressesPage
AddressBookPage * usedReceivingAddressesPage
Definition: walletview.h:65
WalletView::updateEncryptionStatus
void updateEncryptionStatus()
Re-emit encryption status signal.
Definition: walletview.cpp:256
WalletView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
CAmount
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
AddressBookPage
Widget that shows a list of sending or receiving addresses.
Definition: addressbookpage.h:26
SendCoinsDialog
Dialog for sending bitcoins.
Definition: sendcoinsdialog.h:31
WalletView::transactionsPage
QWidget * transactionsPage
Definition: walletview.h:61
WalletView::encryptionStatusChanged
void encryptionStatusChanged()
Encryption status of wallet changed.
WalletView::gotoVerifyMessageTab
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletview.cpp:196
WalletView::WalletView
WalletView(const PlatformStyle *platformStyle, QWidget *parent)
Definition: walletview.cpp:37
ClientModel
Model for Bitcoin network client.
Definition: clientmodel.h:47
WalletView::outOfSyncWarningClicked
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
WalletView::~WalletView
~WalletView()
Definition: walletview.cpp:93
WalletView::coinsSent
void coinsSent()
WalletView::gotoOverviewPage
void gotoOverviewPage()
Switch to overview (home) page.
Definition: walletview.cpp:161
WalletView::setWalletModel
void setWalletModel(WalletModel *walletModel)
Set the wallet model.
Definition: walletview.cpp:106
WalletView::changePassphrase
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletview.cpp:292
WalletView::unlockWallet
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
Definition: walletview.cpp:299
WalletView::gotoLoadPSBT
void gotoLoadPSBT(bool from_clipboard=false)
Load Partially Signed Bitcoin Transaction.
Definition: walletview.cpp:208
WalletView::walletModel
WalletModel * walletModel
Definition: walletview.h:58
WalletView::backupWallet
void backupWallet()
Backup the wallet.
Definition: walletview.cpp:272
WalletView::receiveCoinsPage
ReceiveCoinsDialog * receiveCoinsPage
Definition: walletview.h:62
WalletView::usedSendingAddresses
void usedSendingAddresses()
Show used sending addresses.
Definition: walletview.cpp:312
WalletView::usedReceivingAddresses
void usedReceivingAddresses()
Show used receiving addresses.
Definition: walletview.cpp:320
PlatformStyle
Definition: platformstyle.h:13
WalletView::transactionClicked
void transactionClicked()
amount.h
WalletView::gotoHistoryPage
void gotoHistoryPage()
Switch to history (transactions) page.
Definition: walletview.cpp:166
WalletView::progressDialog
QProgressDialog * progressDialog
Definition: walletview.h:69