]> Git Repo - VerusCoin.git/blob - src/qt/walletview.h
Merge pull request #4980
[VerusCoin.git] / src / qt / walletview.h
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5 #ifndef WALLETVIEW_H
6 #define WALLETVIEW_H
7
8 #include "amount.h"
9
10 #include <QStackedWidget>
11
12 class BitcoinGUI;
13 class ClientModel;
14 class OverviewPage;
15 class ReceiveCoinsDialog;
16 class SendCoinsDialog;
17 class SendCoinsRecipient;
18 class TransactionView;
19 class WalletModel;
20
21 QT_BEGIN_NAMESPACE
22 class QModelIndex;
23 class QProgressDialog;
24 QT_END_NAMESPACE
25
26 /*
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
30   current core state.
31 */
32 class WalletView : public QStackedWidget
33 {
34     Q_OBJECT
35
36 public:
37     explicit WalletView(QWidget *parent);
38     ~WalletView();
39
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.
43     */
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
47         functionality.
48     */
49     void setWalletModel(WalletModel *walletModel);
50
51     bool handlePaymentRequest(const SendCoinsRecipient& recipient);
52
53     void showOutOfSyncWarning(bool fShow);
54
55 private:
56     ClientModel *clientModel;
57     WalletModel *walletModel;
58
59     OverviewPage *overviewPage;
60     QWidget *transactionsPage;
61     ReceiveCoinsDialog *receiveCoinsPage;
62     SendCoinsDialog *sendCoinsPage;
63
64     TransactionView *transactionView;
65
66     QProgressDialog *progressDialog;
67
68 public slots:
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 = "");
77
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 = "");
82
83     /** Show incoming transaction notification for new transactions.
84
85         The new items are those between start and end inclusive, under the given parent item.
86     */
87     void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
88     /** Encrypt the wallet */
89     void encryptWallet(bool status);
90     /** Backup the wallet */
91     void backupWallet();
92     /** Change encrypted wallet passphrase */
93     void changePassphrase();
94     /** Ask for passphrase to unlock wallet temporarily */
95     void unlockWallet();
96
97     /** Show used sending addresses */
98     void usedSendingAddresses();
99     /** Show used receiving addresses */
100     void usedReceivingAddresses();
101
102     /** Re-emit encryption status signal */
103     void updateEncryptionStatus();
104
105     /** Show progress dialog e.g. for rescan */
106     void showProgress(const QString &title, int nProgress);
107
108 signals:
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);
117 };
118
119 #endif // WALLETVIEW_H
This page took 0.0309 seconds and 4 git commands to generate.