1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_WALLETVIEW_H
6 #define BITCOIN_QT_WALLETVIEW_H
10 #include <QStackedWidget>
15 class ReceiveCoinsDialog;
16 class SendCoinsDialog;
17 class SendCoinsRecipient;
18 class TransactionView;
23 class QProgressDialog;
27 WalletView class. This class represents the view to a single wallet.
28 It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.
29 It communicates with both the client and the wallet models to give the user an up-to-date view of the
32 class WalletView : public QStackedWidget
37 explicit WalletView(QWidget *parent);
40 void setBitcoinGUI(BitcoinGUI *gui);
41 /** Set the client model.
42 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
44 void setClientModel(ClientModel *clientModel);
45 /** Set the wallet model.
46 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
49 void setWalletModel(WalletModel *walletModel);
51 bool handlePaymentRequest(const SendCoinsRecipient& recipient);
53 void showOutOfSyncWarning(bool fShow);
56 ClientModel *clientModel;
57 WalletModel *walletModel;
59 OverviewPage *overviewPage;
60 QWidget *transactionsPage;
61 ReceiveCoinsDialog *receiveCoinsPage;
62 SendCoinsDialog *sendCoinsPage;
64 TransactionView *transactionView;
66 QProgressDialog *progressDialog;
69 /** Switch to overview (home) page */
70 void gotoOverviewPage();
71 /** Switch to history (transactions) page */
72 void gotoHistoryPage();
73 /** Switch to receive coins page */
74 void gotoReceiveCoinsPage();
75 /** Switch to send coins page */
76 void gotoSendCoinsPage(QString addr = "");
78 /** Show Sign/Verify Message dialog and switch to sign message tab */
79 void gotoSignMessageTab(QString addr = "");
80 /** Show Sign/Verify Message dialog and switch to verify message tab */
81 void gotoVerifyMessageTab(QString addr = "");
83 /** Show incoming transaction notification for new transactions.
85 The new items are those between start and end inclusive, under the given parent item.
87 void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
88 /** Encrypt the wallet */
89 void encryptWallet(bool status);
90 /** Backup the wallet */
92 /** Change encrypted wallet passphrase */
93 void changePassphrase();
94 /** Ask for passphrase to unlock wallet temporarily */
97 /** Show used sending addresses */
98 void usedSendingAddresses();
99 /** Show used receiving addresses */
100 void usedReceivingAddresses();
102 /** Re-emit encryption status signal */
103 void updateEncryptionStatus();
105 /** Show progress dialog e.g. for rescan */
106 void showProgress(const QString &title, int nProgress);
109 /** Signal that we want to show the main window */
110 void showNormalIfMinimized();
111 /** Fired when a message should be reported to the user */
112 void message(const QString &title, const QString &message, unsigned int style);
113 /** Encryption status of wallet changed */
114 void encryptionStatusChanged(int status);
115 /** Notify that a new transaction appeared */
116 void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address);
119 #endif // BITCOIN_QT_WALLETVIEW_H