Merge #11997: [tests] util_tests.cpp: actually check ignored args
[bitcoinplatinum.git] / src / qt / walletview.h
blob30d68e4eff5a52ec6e821c344beb4ddfb92c858e
1 // Copyright (c) 2011-2017 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.
5 #ifndef BITCOIN_QT_WALLETVIEW_H
6 #define BITCOIN_QT_WALLETVIEW_H
8 #include <amount.h>
10 #include <QStackedWidget>
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;
23 QT_BEGIN_NAMESPACE
24 class QModelIndex;
25 class QProgressDialog;
26 QT_END_NAMESPACE
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.
34 class WalletView : public QStackedWidget
36 Q_OBJECT
38 public:
39 explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);
40 ~WalletView();
42 void setBitcoinGUI(BitcoinGUI *gui);
43 /** Set the client model.
44 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
46 void setClientModel(ClientModel *clientModel);
47 /** Set the wallet model.
48 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
49 functionality.
51 void setWalletModel(WalletModel *walletModel);
53 bool handlePaymentRequest(const SendCoinsRecipient& recipient);
55 void showOutOfSyncWarning(bool fShow);
57 private:
58 ClientModel *clientModel;
59 WalletModel *walletModel;
61 OverviewPage *overviewPage;
62 QWidget *transactionsPage;
63 ReceiveCoinsDialog *receiveCoinsPage;
64 SendCoinsDialog *sendCoinsPage;
65 AddressBookPage *usedSendingAddressesPage;
66 AddressBookPage *usedReceivingAddressesPage;
68 TransactionView *transactionView;
70 QProgressDialog *progressDialog;
71 const PlatformStyle *platformStyle;
73 public Q_SLOTS:
74 /** Switch to overview (home) page */
75 void gotoOverviewPage();
76 /** Switch to history (transactions) page */
77 void gotoHistoryPage();
78 /** Switch to receive coins page */
79 void gotoReceiveCoinsPage();
80 /** Switch to send coins page */
81 void gotoSendCoinsPage(QString addr = "");
83 /** Show Sign/Verify Message dialog and switch to sign message tab */
84 void gotoSignMessageTab(QString addr = "");
85 /** Show Sign/Verify Message dialog and switch to verify message tab */
86 void gotoVerifyMessageTab(QString addr = "");
88 /** Show incoming transaction notification for new transactions.
90 The new items are those between start and end inclusive, under the given parent item.
92 void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
93 /** Encrypt the wallet */
94 void encryptWallet(bool status);
95 /** Backup the wallet */
96 void backupWallet();
97 /** Change encrypted wallet passphrase */
98 void changePassphrase();
99 /** Ask for passphrase to unlock wallet temporarily */
100 void unlockWallet();
102 /** Show used sending addresses */
103 void usedSendingAddresses();
104 /** Show used receiving addresses */
105 void usedReceivingAddresses();
107 /** Re-emit encryption status signal */
108 void updateEncryptionStatus();
110 /** Show progress dialog e.g. for rescan */
111 void showProgress(const QString &title, int nProgress);
113 /** User has requested more information about the out of sync state */
114 void requestedSyncWarningInfo();
116 Q_SIGNALS:
117 /** Signal that we want to show the main window */
118 void showNormalIfMinimized();
119 /** Fired when a message should be reported to the user */
120 void message(const QString &title, const QString &message, unsigned int style);
121 /** Encryption status of wallet changed */
122 void encryptionStatusChanged(int status);
123 /** HD-Enabled status of wallet changed (only possible during startup) */
124 void hdEnabledStatusChanged(int hdEnabled);
125 /** Notify that a new transaction appeared */
126 void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
127 /** Notify that the out of sync warning icon has been pressed */
128 void outOfSyncWarningClicked();
131 #endif // BITCOIN_QT_WALLETVIEW_H