Changeset View
Changeset View
Standalone View
Standalone View
src/qt/clientmodel.h
Show All 22 Lines | |||||
} // namespace interfaces | } // namespace interfaces | ||||
QT_BEGIN_NAMESPACE | QT_BEGIN_NAMESPACE | ||||
class QTimer; | class QTimer; | ||||
QT_END_NAMESPACE | QT_END_NAMESPACE | ||||
enum class BlockSource { NONE, REINDEX, DISK, NETWORK }; | enum class BlockSource { NONE, REINDEX, DISK, NETWORK }; | ||||
/** Model for Bitcoin network client. */ | |||||
class ClientModel : public QObject { | |||||
Q_OBJECT | |||||
public: | |||||
enum NumConnections { | enum NumConnections { | ||||
CONNECTIONS_NONE = 0, | CONNECTIONS_NONE = 0, | ||||
CONNECTIONS_IN = (1U << 0), | CONNECTIONS_IN = (1U << 0), | ||||
CONNECTIONS_OUT = (1U << 1), | CONNECTIONS_OUT = (1U << 1), | ||||
CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT), | CONNECTIONS_ALL = (CONNECTIONS_IN | CONNECTIONS_OUT), | ||||
}; | }; | ||||
/** Model for Bitcoin network client. */ | |||||
class ClientModel : public QObject { | |||||
Q_OBJECT | |||||
public: | |||||
explicit ClientModel(interfaces::Node &node, OptionsModel *optionsModel, | explicit ClientModel(interfaces::Node &node, OptionsModel *optionsModel, | ||||
QObject *parent = 0); | QObject *parent = 0); | ||||
~ClientModel(); | ~ClientModel(); | ||||
interfaces::Node &node() const { return m_node; } | interfaces::Node &node() const { return m_node; } | ||||
OptionsModel *getOptionsModel(); | OptionsModel *getOptionsModel(); | ||||
PeerTableModel *getPeerTableModel(); | PeerTableModel *getPeerTableModel(); | ||||
BanTableModel *getBanTableModel(); | BanTableModel *getBanTableModel(); | ||||
//! Return number of connections, default is in- and outbound (total) | //! Return number of connections, default is in- and outbound (total) | ||||
int getNumConnections(unsigned int flags = CONNECTIONS_ALL) const; | int getNumConnections(NumConnections flags = CONNECTIONS_ALL) const; | ||||
int getHeaderTipHeight() const; | int getHeaderTipHeight() const; | ||||
int64_t getHeaderTipTime() const; | int64_t getHeaderTipTime() const; | ||||
//! Returns enum BlockSource of the current importing/syncing state | //! Returns enum BlockSource of the current importing/syncing state | ||||
enum BlockSource getBlockSource() const; | enum BlockSource getBlockSource() const; | ||||
//! Return warnings to be displayed in status bar | //! Return warnings to be displayed in status bar | ||||
QString getStatusBarWarnings() const; | QString getStatusBarWarnings() const; | ||||
▲ Show 20 Lines • Show All 58 Lines • Show Last 20 Lines |