1 // Copyright (c) 2011-2015 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_OVERVIEWPAGE_H
6 #define BITCOIN_QT_OVERVIEWPAGE_H
7 
8 #include "amount.h"
9 
10 #include <QWidget>
11 #include <memory>
12 
13 class ClientModel;
14 class TransactionFilterProxy;
15 class TxViewDelegate;
16 class PlatformStyle;
17 class WalletModel;
18 
19 namespace Ui {
20     class OverviewPage;
21 }
22 
23 QT_BEGIN_NAMESPACE
24 class QModelIndex;
25 QT_END_NAMESPACE
26 
27 /** Overview ("home") page widget */
28 class OverviewPage : public QWidget
29 {
30     Q_OBJECT
31 
32 public:
33     explicit OverviewPage(const PlatformStyle *platformStyle, QWidget *parent = 0);
34     ~OverviewPage();
35 
36     void setClientModel(ClientModel *clientModel);
37     void setWalletModel(WalletModel *walletModel);
38     void showOutOfSyncWarning(bool fShow);
39 
40 public Q_SLOTS:
41     void setBalance(const CAmount& balance, const CAmount& unconfirmedBalance, const CAmount& immatureBalance,
42                     const CAmount& watchOnlyBalance, const CAmount& watchUnconfBalance, const CAmount& watchImmatureBalance);
43 
44 Q_SIGNALS:
45     void transactionClicked(const QModelIndex &index);
46 
47 private:
48     Ui::OverviewPage *ui;
49     ClientModel *clientModel;
50     WalletModel *walletModel;
51     CAmount currentBalance;
52     CAmount currentUnconfirmedBalance;
53     CAmount currentImmatureBalance;
54     CAmount currentWatchOnlyBalance;
55     CAmount currentWatchUnconfBalance;
56     CAmount currentWatchImmatureBalance;
57 
58     TxViewDelegate *txdelegate;
59     std::unique_ptr<TransactionFilterProxy> filter;
60 
61 private Q_SLOTS:
62     void updateDisplayUnit();
63     void handleTransactionClicked(const QModelIndex &index);
64     void updateAlerts(const QString &warnings);
65     void updateWatchOnlyLabels(bool showWatchOnly);
66 };
67 
68 #endif // BITCOIN_QT_OVERVIEWPAGE_H
69