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 <consensus/amount.h>
9
10#include <QStackedWidget>
11
12class ClientModel;
13class OverviewPage;
14class PlatformStyle;
16class SendCoinsDialog;
18class TransactionView;
19class WalletModel;
20class AddressBookPage;
21
22QT_BEGIN_NAMESPACE
23class QModelIndex;
24class QProgressDialog;
25QT_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*/
33class WalletView : public QStackedWidget
34{
35 Q_OBJECT
36
37public:
38 explicit WalletView(WalletModel* wallet_model, const PlatformStyle* platformStyle, QWidget* parent);
40
45 WalletModel* getWalletModel() const noexcept { return walletModel; }
46
47 bool handlePaymentRequest(const SendCoinsRecipient& recipient);
48
49 void showOutOfSyncWarning(bool fShow);
50
51private:
53
59
66
68
69 QProgressDialog* progressDialog{nullptr};
71
72public Q_SLOTS:
74 void gotoOverviewPage();
76 void gotoHistoryPage();
80 void gotoSendCoinsPage(QString addr = "");
81
83 void gotoSignMessageTab(QString addr = "");
85 void gotoVerifyMessageTab(QString addr = "");
86
91 void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
93 void encryptWallet();
95 void backupWallet();
97 void changePassphrase();
99 void unlockWallet();
100
105
107 void showProgress(const QString &title, int nProgress);
108
109Q_SIGNALS:
110 void setPrivacy(bool privacy);
111 void transactionClicked();
112 void coinsSent();
114 void message(const QString &title, const QString &message, unsigned int style);
118 void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName);
121};
122
123#endif // BITCOIN_QT_WALLETVIEW_H
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
Widget that shows a list of sending or receiving addresses.
Model for Bitcoin network client.
Definition: clientmodel.h:48
Overview ("home") page widget.
Definition: overviewpage.h:29
Dialog for requesting payment of bitcoins.
Dialog for sending bitcoins.
Widget showing the transaction list for a wallet, including a filter row.
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:52
const PlatformStyle * platformStyle
Definition: walletview.h:70
void gotoHistoryPage()
Switch to history (transactions) page.
Definition: walletview.cpp:154
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletview.cpp:184
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletview.cpp:196
WalletModel *const walletModel
The wallet model represents a bitcoin wallet, and offers access to the list of transactions,...
Definition: walletview.h:58
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletview.cpp:164
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletview.cpp:234
QProgressDialog * progressDialog
Definition: walletview.h:69
SendCoinsDialog * sendCoinsPage
Definition: walletview.h:63
OverviewPage * overviewPage
Definition: walletview.h:60
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.
void setClientModel(ClientModel *clientModel)
Set the client model.
Definition: walletview.cpp:119
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
WalletModel * getWalletModel() const noexcept
Definition: walletview.h:45
void gotoReceiveCoinsPage()
Switch to receive coins page.
Definition: walletview.cpp:159
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletview.cpp:172
QWidget * transactionsPage
Definition: walletview.h:61
void usedSendingAddresses()
Show used sending addresses.
Definition: walletview.cpp:251
ReceiveCoinsDialog * receiveCoinsPage
Definition: walletview.h:62
void encryptWallet()
Encrypt the wallet.
Definition: walletview.cpp:206
TransactionView * transactionView
Definition: walletview.h:67
WalletView(WalletModel *wallet_model, const PlatformStyle *platformStyle, QWidget *parent)
Definition: walletview.cpp:33
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: walletview.cpp:261
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
AddressBookPage * usedReceivingAddressesPage
Definition: walletview.h:65
void backupWallet()
Backup the wallet.
Definition: walletview.cpp:214
ClientModel * clientModel
Definition: walletview.h:52
AddressBookPage * usedSendingAddressesPage
Definition: walletview.h:64
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
Definition: walletview.cpp:241
void gotoOverviewPage()
Switch to overview (home) page.
Definition: walletview.cpp:149
void usedReceivingAddresses()
Show used receiving addresses.
Definition: walletview.cpp:256
void transactionClicked()
void processNewTransaction(const QModelIndex &parent, int start, int)
Show incoming transaction notification for new transactions.
Definition: walletview.cpp:128
void setPrivacy(bool privacy)
void showOutOfSyncWarning(bool fShow)
Definition: walletview.cpp:201
void encryptionStatusChanged()
Encryption status of wallet changed.