General cleanups
[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 client connected to testnet
26     bool isTestNet() const;
27     // Return true if core is doing initial block download
28     bool inInitialBlockDownload() const;
29     // Return conservative estimate of total number of blocks, or 0 if unknown
30     int getTotalBlocksEstimate() const;
31
32     QString formatFullVersion() const;
33
34 private:
35     CWallet *wallet;
36
37     OptionsModel *optionsModel;
38
39 signals:
40     void numConnectionsChanged(int count);
41     void numBlocksChanged(int count);
42
43     // Asynchronous error notification
44     void error(const QString &title, const QString &message);
45
46 public slots:
47
48 private slots:
49     void update();
50 };
51
52 #endif // CLIENTMODEL_H