Dogecoin Core  1.14.2
P2P Digital Currency
walletview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 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 BitcoinGUI;
13 class ClientModel;
14 class OverviewPage;
15 class PlatformStyle;
16 class ReceiveCoinsDialog;
17 class SendCoinsDialog;
18 class SendCoinsRecipient;
19 class TransactionView;
20 class WalletModel;
21 class AddressBookPage;
22 
23 QT_BEGIN_NAMESPACE
24 class QModelIndex;
25 class QProgressDialog;
26 QT_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 */
34 class WalletView : public QStackedWidget
35 {
36  Q_OBJECT
37 
38 public:
39  explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);
40  ~WalletView();
41 
42  void setBitcoinGUI(BitcoinGUI *gui);
52 
53  bool handlePaymentRequest(const SendCoinsRecipient& recipient);
54 
55  void showOutOfSyncWarning(bool fShow);
56 
57 private:
60 
62  QWidget *transactionsPage;
67 
69 
70  QProgressDialog *progressDialog;
72 
73 public Q_SLOTS:
75  void gotoOverviewPage();
77  void gotoHistoryPage();
79  void gotoReceiveCoinsPage();
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(bool status);
96  void backupWallet();
98  void changePassphrase();
100  void unlockWallet();
102  void printPaperWallets();
103 
105  void usedSendingAddresses();
107  void usedReceivingAddresses();
108 
110  void updateEncryptionStatus();
111 
113  void showProgress(const QString &title, int nProgress);
114 
117 
118 Q_SIGNALS:
122  void message(const QString &title, const QString &message, unsigned int style);
124  void encryptionStatusChanged(int status);
126  void hdEnabledStatusChanged(int hdEnabled);
128  void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
131 };
132 
133 #endif // BITCOIN_QT_WALLETVIEW_H
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:15
Widget that shows a list of sending or receiving addresses.
Bitcoin GUI main class.
Definition: bitcoingui.h:47
Model for Bitcoin network client.
Definition: clientmodel.h:42
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:99
const PlatformStyle * platformStyle
Definition: walletview.h:71
void gotoHistoryPage()
Switch to history (transactions) page.
Definition: walletview.cpp:178
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletview.cpp:208
void setWalletModel(WalletModel *walletModel)
Set the wallet model.
Definition: walletview.cpp:117
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletview.cpp:220
void encryptWallet(bool status)
Encrypt the wallet.
Definition: walletview.cpp:235
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletview.cpp:188
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletview.cpp:265
QProgressDialog * progressDialog
Definition: walletview.h:70
SendCoinsDialog * sendCoinsPage
Definition: walletview.h:64
OverviewPage * overviewPage
Definition: walletview.h:61
void setBitcoinGUI(BitcoinGUI *gui)
Definition: walletview.cpp:88
void setClientModel(ClientModel *clientModel)
Set the client model.
Definition: walletview.cpp:109
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
void gotoReceiveCoinsPage()
Switch to receive coins page.
Definition: walletview.cpp:183
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletview.cpp:196
QWidget * transactionsPage
Definition: walletview.h:62
void usedSendingAddresses()
Show used sending addresses.
Definition: walletview.cpp:285
ReceiveCoinsDialog * receiveCoinsPage
Definition: walletview.h:63
void hdEnabledStatusChanged(int hdEnabled)
HD-Enabled status of wallet changed (only possible during startup)
TransactionView * transactionView
Definition: walletview.h:68
void printPaperWallets()
Open the print paper wallets dialog.
Definition: walletview.cpp:333
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: walletview.cpp:305
WalletView(const PlatformStyle *platformStyle, QWidget *parent)
Definition: walletview.cpp:33
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.
Definition: walletview.cpp:246
void encryptionStatusChanged(int status)
Encryption status of wallet changed.
ClientModel * clientModel
Definition: walletview.h:58
void showNormalIfMinimized()
Signal that we want to show the main window.
void requestedSyncWarningInfo()
User has requested more information about the out of sync state.
Definition: walletview.cpp:328
AddressBookPage * usedSendingAddressesPage
Definition: walletview.h:65
void unlockWallet()
Ask for passphrase to unlock wallet temporarily.
Definition: walletview.cpp:272
WalletModel * walletModel
Definition: walletview.h:59
void gotoOverviewPage()
Switch to overview (home) page.
Definition: walletview.cpp:173
void usedReceivingAddresses()
Show used receiving addresses.
Definition: walletview.cpp:295
void updateEncryptionStatus()
Re-emit encryption status signal.
Definition: walletview.cpp:230
void processNewTransaction(const QModelIndex &parent, int start, int)
Show incoming transaction notification for new transactions.
Definition: walletview.cpp:153
void incomingTransaction(const QString &date, int unit, const CAmount &amount, const QString &type, const QString &address, const QString &label)
Notify that a new transaction appeared.
void showOutOfSyncWarning(bool fShow)
Definition: walletview.cpp:225