Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoin.h
// Copyright (c) 2011-2016 The Bitcoin Core developers | // Copyright (c) 2011-2016 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_QT_BITCOIN_H | #ifndef BITCOIN_QT_BITCOIN_H | ||||
#define BITCOIN_QT_BITCOIN_H | #define BITCOIN_QT_BITCOIN_H | ||||
#if defined(HAVE_CONFIG_H) | #if defined(HAVE_CONFIG_H) | ||||
#include <config/bitcoin-config.h> | #include <config/bitcoin-config.h> | ||||
#endif | #endif | ||||
#include <QApplication> | #include <QApplication> | ||||
#include <cassert> | #include <cassert> | ||||
#include <memory> | #include <memory> | ||||
#include <interfaces/node.h> | |||||
class BitcoinGUI; | class BitcoinGUI; | ||||
class ClientModel; | class ClientModel; | ||||
class Config; | class Config; | ||||
class HTTPRPCRequestProcessor; | class HTTPRPCRequestProcessor; | ||||
class NetworkStyle; | class NetworkStyle; | ||||
class OptionsModel; | class OptionsModel; | ||||
class PaymentServer; | class PaymentServer; | ||||
class PlatformStyle; | class PlatformStyle; | ||||
class RPCServer; | class RPCServer; | ||||
class SplashScreen; | class SplashScreen; | ||||
class WalletController; | class WalletController; | ||||
class WalletModel; | class WalletModel; | ||||
namespace interfaces { | |||||
class Handler; | |||||
class Node; | |||||
} // namespace interfaces | |||||
/** | /** | ||||
* Class encapsulating Bitcoin ABC startup and shutdown. | * Class encapsulating Bitcoin ABC startup and shutdown. | ||||
* Allows running startup and shutdown in a different thread from the UI thread. | * Allows running startup and shutdown in a different thread from the UI thread. | ||||
*/ | */ | ||||
class BitcoinABC : public QObject { | class BitcoinABC : public QObject { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit BitcoinABC(interfaces::Node &node); | explicit BitcoinABC(interfaces::Node &node); | ||||
public Q_SLOTS: | public Q_SLOTS: | ||||
void initialize(Config *config, RPCServer *rpcServer, | void initialize(Config *config, RPCServer *rpcServer, | ||||
HTTPRPCRequestProcessor *httpRPCRequestProcessor); | HTTPRPCRequestProcessor *httpRPCRequestProcessor); | ||||
void shutdown(); | void shutdown(); | ||||
Q_SIGNALS: | Q_SIGNALS: | ||||
void initializeResult(bool success); | void initializeResult(bool success, | ||||
interfaces::BlockAndHeaderTipInfo tip_info); | |||||
void shutdownResult(); | void shutdownResult(); | ||||
void runawayException(const QString &message); | void runawayException(const QString &message); | ||||
private: | private: | ||||
/// Pass fatal exception message to UI thread | /// Pass fatal exception message to UI thread | ||||
void handleRunawayException(const std::exception *e); | void handleRunawayException(const std::exception *e); | ||||
interfaces::Node &m_node; | interfaces::Node &m_node; | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | #endif | ||||
interfaces::Node &node() const { | interfaces::Node &node() const { | ||||
assert(m_node); | assert(m_node); | ||||
return *m_node; | return *m_node; | ||||
} | } | ||||
void setNode(interfaces::Node &node); | void setNode(interfaces::Node &node); | ||||
public Q_SLOTS: | public Q_SLOTS: | ||||
void initializeResult(bool success); | void initializeResult(bool success, | ||||
interfaces::BlockAndHeaderTipInfo tip_info); | |||||
void shutdownResult(); | void shutdownResult(); | ||||
/// Handle runaway exceptions. Shows a message box with the problem and | /// Handle runaway exceptions. Shows a message box with the problem and | ||||
/// quits the program. | /// quits the program. | ||||
void handleRunawayException(const QString &message); | void handleRunawayException(const QString &message); | ||||
Q_SIGNALS: | Q_SIGNALS: | ||||
void requestedInitialize(Config *config, RPCServer *rpcServer, | void requestedInitialize(Config *config, RPCServer *rpcServer, | ||||
HTTPRPCRequestProcessor *httpRPCRequestProcessor); | HTTPRPCRequestProcessor *httpRPCRequestProcessor); | ||||
Show All 26 Lines |