Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
walletview.h
Go to the documentation of this file.
1// Copyright (c) 2011-present 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#include <qt/bitcoinunits.h>
10
11#include <QStackedWidget>
12
13class ClientModel;
14class OverviewPage;
15class PlatformStyle;
17class SendCoinsDialog;
19class TransactionView;
20class WalletModel;
21class AddressBookPage;
22
23QT_BEGIN_NAMESPACE
24class QModelIndex;
25class QProgressDialog;
26QT_END_NAMESPACE
27
28/*
29 WalletView class. This class represents the view to a single wallet.
30 It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.
31 It communicates with both the client and the wallet models to give the user an up-to-date view of the
32 current core state.
33*/
34class WalletView : public QStackedWidget
35{
36 Q_OBJECT
37
38public:
39 explicit WalletView(WalletModel* wallet_model, const PlatformStyle* platformStyle, QWidget* parent);
41
46 WalletModel* getWalletModel() const noexcept { return walletModel; }
47
48 bool handlePaymentRequest(const SendCoinsRecipient& recipient);
49
50 void showOutOfSyncWarning(bool fShow);
51
52private:
54
60
67
69
70 QProgressDialog* progressDialog{nullptr};
72
73public Q_SLOTS:
75 void gotoOverviewPage();
77 void gotoHistoryPage();
81 void gotoSendCoinsPage(QString addr = "");
82
84 void gotoSignMessageTab(QString addr = "");
86 void gotoVerifyMessageTab(QString addr = "");
87
92 void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
94 void encryptWallet();
96 void backupWallet();
98 void changePassphrase();
100 void unlockWallet();
101
106
108 void showProgress(const QString &title, int nProgress);
109
110private Q_SLOTS:
111 void disableTransactionView(bool disable);
112
113Q_SIGNALS:
114 void setPrivacy(bool privacy);
116 void coinsSent();
118 void message(const QString &title, const QString &message, unsigned int style);
122 void incomingTransaction(const QString& date, BitcoinUnit unit, const CAmount& amount, const QString& type, const QString& address, const QString& label, const QString& walletName);
125};
126
127#endif // BITCOIN_QT_WALLETVIEW_H
int64_t CAmount
Amount in satoshis (Can be negative).
Definition amount.h:12
BitcoinUnits::Unit BitcoinUnit
Widget that shows a list of sending or receiving addresses.
Model for Bitcoin network client.
Definition clientmodel.h:57
Overview ("home") page widget.
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:49
const PlatformStyle * platformStyle
Definition walletview.h:71
void gotoHistoryPage()
Switch to history (transactions) page.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
void disableTransactionView(bool disable)
WalletModel *const walletModel
Definition walletview.h:59
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
void changePassphrase()
Change encrypted wallet passphrase.
QProgressDialog * progressDialog
Definition walletview.h:70
SendCoinsDialog * sendCoinsPage
Definition walletview.h:64
OverviewPage * overviewPage
Definition walletview.h:61
void setClientModel(ClientModel *clientModel)
Set the client model.
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
WalletModel * getWalletModel() const noexcept
Definition walletview.h:46
void gotoReceiveCoinsPage()
Switch to receive coins page.
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
QWidget * transactionsPage
Definition walletview.h:62
void usedSendingAddresses()
Show used sending addresses.
ReceiveCoinsDialog * receiveCoinsPage
Definition walletview.h:63
void encryptWallet()
Encrypt the wallet.
TransactionView * transactionView
Definition walletview.h:68
WalletView(WalletModel *wallet_model, const PlatformStyle *platformStyle, QWidget *parent)
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
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:66
void backupWallet()
Backup the wallet.
void incomingTransaction(const QString &date, BitcoinUnit unit, const CAmount &amount, const QString &type, const QString &address, const QString &label, const QString &walletName)
Notify that a new transaction appeared.
ClientModel * clientModel
Definition walletview.h:53
AddressBookPage * usedSendingAddressesPage
Definition walletview.h:65
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
void gotoOverviewPage()
Switch to overview (home) page.
void usedReceivingAddresses()
Show used receiving addresses.
void transactionClicked()
void coinsSent()
void processNewTransaction(const QModelIndex &parent, int start, int)
Show incoming transaction notification for new transactions.
void setPrivacy(bool privacy)
void showOutOfSyncWarning(bool fShow)
void encryptionStatusChanged()
Encryption status of wallet changed.