QtUI code cleanup / comment improvements
[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 QT_BEGIN_NAMESPACE
12 class QDateTime;
13 QT_END_NAMESPACE
14
15 // Model for Bitcoin network client
16 class ClientModel : public QObject
17 {
18     Q_OBJECT
19 public:
20     explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
21
22     OptionsModel *getOptionsModel();
23
24     int getNumConnections() const;
25     int getNumBlocks() const;
26
27     QDateTime getLastBlockDate() const;
28
29     // Return true if client connected to testnet
30     bool isTestNet() const;
31     // Return true if core is doing initial block download
32     bool inInitialBlockDownload() const;
33     // Return conservative estimate of total number of blocks, or 0 if unknown
34     int getTotalBlocksEstimate() const;
35
36     QString formatFullVersion() const;
37
38 private:
39     OptionsModel *optionsModel;
40
41     int cachedNumConnections;
42     int cachedNumBlocks;
43
44 signals:
45     void numConnectionsChanged(int count);
46     void numBlocksChanged(int count);
47
48     // Asynchronous error notification
49     void error(const QString &title, const QString &message);
50
51 public slots:
52
53 private slots:
54     void update();
55 };
56
57 #endif // CLIENTMODEL_H