Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
clientmodel.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Distributed under the MIT/X11 software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef CLIENTMODEL_H
6 #define CLIENTMODEL_H
7 
8 #include <QObject>
9 
10 class AddressTableModel;
11 class OptionsModel;
13 
14 class CWallet;
15 
16 QT_BEGIN_NAMESPACE
17 class QDateTime;
18 class QTimer;
19 QT_END_NAMESPACE
20 
26 };
27 
30  CONNECTIONS_IN = (1U << 0),
31  CONNECTIONS_OUT = (1U << 1),
33 };
34 
36 class ClientModel : public QObject
37 {
38  Q_OBJECT
39 
40 public:
41  explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0);
42  ~ClientModel();
43 
45 
47  int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const;
48  int getNumBlocks() const;
50 
51  quint64 getTotalBytesRecv() const;
52  quint64 getTotalBytesSent() const;
53 
54  double getVerificationProgress() const;
55  QDateTime getLastBlockDate() const;
56 
58  QString getNetworkName() const;
60  bool inInitialBlockDownload() const;
62  enum BlockSource getBlockSource() const;
64  QString getStatusBarWarnings() const;
65 
66  QString formatFullVersion() const;
67  QString formatBuildDate() const;
68  bool isReleaseVersion() const;
69  QString clientName() const;
70  QString formatClientStartupTime() const;
71 
72 private:
74 
78 
80 
81  QTimer *pollTimer;
82 
85 
86 signals:
87  void numConnectionsChanged(int count);
88  void numBlocksChanged(int count);
89  void alertsChanged(const QString &warnings);
90  void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut);
91 
93  void message(const QString &title, const QString &message, unsigned int style);
94 
95 public slots:
96  void updateTimer();
97  void updateNumConnections(int numConnections);
98  void updateAlert(const QString &hash, int status);
99 };
100 
101 #endif // CLIENTMODEL_H
void numBlocksChanged(int count)
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
quint64 getTotalBytesRecv() const
Definition: clientmodel.cpp:68
int getNumConnections(unsigned int flags=CONNECTIONS_ALL) const
Return number of connections, default is in- and outbound (total)
Definition: clientmodel.cpp:42
OptionsModel * getOptionsModel()
QString formatClientStartupTime() const
QString getStatusBarWarnings() const
Return warnings to be displayed in status bar.
void numConnectionsChanged(int count)
bool isReleaseVersion() const
void alertsChanged(const QString &warnings)
QString getNetworkName() const
Return network (main, testnet3, regtest)
void bytesChanged(quint64 totalBytesIn, quint64 totalBytesOut)
bool inInitialBlockDownload() const
Return true if core is doing initial block download.
bool cachedImporting
Definition: clientmodel.h:77
double getVerificationProgress() const
Definition: clientmodel.cpp:87
NumConnections
Definition: clientmodel.h:28
QDateTime getLastBlockDate() const
Definition: clientmodel.cpp:78
BlockSource
Definition: clientmodel.h:21
void updateAlert(const QString &hash, int status)
void unsubscribeFromCoreSignals()
QString clientName() const
void subscribeToCoreSignals()
QString formatBuildDate() const
UI model for the transaction table of a wallet.
Model for Bitcoin network client.
Definition: clientmodel.h:36
int cachedNumBlocks
Definition: clientmodel.h:75
QTimer * pollTimer
Definition: clientmodel.h:81
Qt model of the address book in the core.
int getNumBlocks() const
Definition: clientmodel.cpp:56
quint64 getTotalBytesSent() const
Definition: clientmodel.cpp:73
int numBlocksAtStartup
Definition: clientmodel.h:79
bool cachedReindexing
Definition: clientmodel.h:76
ClientModel(OptionsModel *optionsModel, QObject *parent=0)
Definition: clientmodel.cpp:24
Interface from Qt to configuration data structure for Bitcoin client.
Definition: optionsmodel.h:20
void updateTimer()
Definition: clientmodel.cpp:93
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:100
OptionsModel * optionsModel
Definition: clientmodel.h:73
int getNumBlocksAtStartup()
Definition: clientmodel.cpp:62
void updateNumConnections(int numConnections)
QString formatFullVersion() const
enum BlockSource getBlockSource() const
Return true if core is importing blocks.