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 <memory> | #include <memory> | ||||
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 WalletController; | class WalletController; | ||||
class WalletModel; | class WalletModel; | ||||
namespace interfaces { | namespace interfaces { | ||||
class Handler; | class Handler; | ||||
class Node; | class Node; | ||||
} // namespace interfaces | } // namespace interfaces | ||||
Show All 22 Lines | private: | ||||
interfaces::Node &m_node; | interfaces::Node &m_node; | ||||
}; | }; | ||||
/** Main Bitcoin application object */ | /** Main Bitcoin application object */ | ||||
class BitcoinApplication : public QApplication { | class BitcoinApplication : public QApplication { | ||||
Q_OBJECT | Q_OBJECT | ||||
public: | public: | ||||
explicit BitcoinApplication(interfaces::Node &node); | explicit BitcoinApplication(); | ||||
~BitcoinApplication(); | ~BitcoinApplication(); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
/// Create payment server | /// Create payment server | ||||
void createPaymentServer(); | void createPaymentServer(); | ||||
#endif | #endif | ||||
/// parameter interaction/setup based on rules | /// parameter interaction/setup based on rules | ||||
void parameterSetup(); | void parameterSetup(); | ||||
Show All 19 Lines | #endif | ||||
int getReturnValue() const { return returnValue; } | int getReturnValue() const { return returnValue; } | ||||
/// Get window identifier of QMainWindow (BitcoinGUI) | /// Get window identifier of QMainWindow (BitcoinGUI) | ||||
WId getMainWinId() const; | WId getMainWinId() const; | ||||
/// Setup platform style | /// Setup platform style | ||||
void setupPlatformStyle(); | void setupPlatformStyle(); | ||||
interfaces::Node &node() const { | |||||
assert(m_node); | |||||
return *m_node; | |||||
} | |||||
void setNode(interfaces::Node &node); | |||||
public Q_SLOTS: | public Q_SLOTS: | ||||
void initializeResult(bool success); | void initializeResult(bool success); | ||||
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); | ||||
void requestedShutdown(); | void requestedShutdown(); | ||||
void splashFinished(); | void splashFinished(); | ||||
void windowShown(BitcoinGUI *window); | void windowShown(BitcoinGUI *window); | ||||
private: | private: | ||||
QThread *coreThread; | QThread *coreThread; | ||||
interfaces::Node &m_node; | |||||
OptionsModel *optionsModel; | OptionsModel *optionsModel; | ||||
ClientModel *clientModel; | ClientModel *clientModel; | ||||
BitcoinGUI *window; | BitcoinGUI *window; | ||||
QTimer *pollShutdownTimer; | QTimer *pollShutdownTimer; | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
PaymentServer *paymentServer{nullptr}; | PaymentServer *paymentServer{nullptr}; | ||||
WalletController *m_wallet_controller{nullptr}; | WalletController *m_wallet_controller{nullptr}; | ||||
#endif | #endif | ||||
int returnValue; | int returnValue; | ||||
const PlatformStyle *platformStyle; | const PlatformStyle *platformStyle; | ||||
std::unique_ptr<QWidget> shutdownWindow; | std::unique_ptr<QWidget> shutdownWindow; | ||||
SplashScreen *m_splash = nullptr; | |||||
interfaces::Node *m_node = nullptr; | |||||
void startThread(); | void startThread(); | ||||
}; | }; | ||||
int GuiMain(int argc, char *argv[]); | int GuiMain(int argc, char *argv[]); | ||||
#endif // BITCOIN_QT_BITCOIN_H | #endif // BITCOIN_QT_BITCOIN_H |