1 // Copyright (c) 2011-2018 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 <interfaces/wallet.h>
9 
10 #include <QWidget>
11 #include <memory>
12 
13 class ClientModel;
14 class TransactionFilterProxy;
15 class TxViewDelegate;
16 class TknViewDelegate;
17 class PlatformStyle;
18 class WalletModel;
19 
20 namespace Ui {
21     class OverviewPage;
22 }
23 
24 QT_BEGIN_NAMESPACE
25 class QModelIndex;
26 QT_END_NAMESPACE
27 
28 /** Overview ("home") page widget */
29 class OverviewPage : public QWidget
30 {
31     Q_OBJECT
32 
33 public:
34     explicit OverviewPage(const PlatformStyle *platformStyle, QWidget *parent = nullptr);
35     ~OverviewPage();
36 
37     void setClientModel(ClientModel *clientModel);
38     void setWalletModel(WalletModel *walletModel);
39     void showOutOfSyncWarning(bool fShow);
40 
41 public Q_SLOTS:
42     void setBalance(const interfaces::WalletBalances& balances);
43     void checkForInvalidTokens();
44 
45 Q_SIGNALS:
46     void showMoreClicked();
47     void transactionClicked(const QModelIndex &index);
48     void outOfSyncWarningClicked();
49     void sendCoinsClicked(QString addr = "");
50     void receiveCoinsClicked();
51 
52 private:
53     Ui::OverviewPage *ui;
54     ClientModel *clientModel;
55     WalletModel *walletModel;
56     interfaces::WalletBalances m_balances;
57 
58     TxViewDelegate *txdelegate;
59     std::unique_ptr<TransactionFilterProxy> filter;
60 
61 private Q_SLOTS:
62     void updateDisplayUnit();
63     void updateAlerts(const QString &warnings);
64     void updateWatchOnlyLabels(bool showWatchOnly);
65     void handleOutOfSyncWarningClicks();
66 
67     void on_showMoreButton_clicked();
68     void on_buttonSend_clicked();
69     void on_buttonReceive_clicked();
70     void showDetails();
71 };
72 
73 #endif // BITCOIN_QT_OVERVIEWPAGE_H
74