Split off WalletModel from ClientModel, to be able to support multi-wallets in future
[novacoin.git] / src / qt / clientmodel.h
1 #ifndef CLIENTMODEL_H
2 #define CLIENTMODEL_H
3
4 #include <QObject>
5
6 class OptionsModel;
7 class AddressTableModel;
8 class TransactionTableModel;
9 class CWallet;
10
11 // Interface to Bitcoin network client
12 class ClientModel : public QObject
13 {
14     Q_OBJECT
15 public:
16     // The only reason that this constructor takes a wallet is because
17     // the global client settings are stored in the main wallet.
18     explicit ClientModel(CWallet *wallet, QObject *parent = 0);
19
20     OptionsModel *getOptionsModel();
21
22     int getNumConnections() const;
23     int getNumBlocks() const;
24
25     // Return true if core is doing initial block download
26     bool inInitialBlockDownload() const;
27     // Return conservative estimate of total number of blocks, or 0 if unknown
28     int getTotalBlocksEstimate() const;
29
30 private:
31     CWallet *wallet;
32
33     OptionsModel *optionsModel;
34
35 signals:
36     void numConnectionsChanged(int count);
37     void numBlocksChanged(int count);
38
39     // Asynchronous error notification
40     void error(const QString &title, const QString &message);
41
42 public slots:
43
44 private slots:
45     void update();
46 };
47
48 #endif // CLIENTMODEL_H