Changeset View
Changeset View
Standalone View
Standalone View
src/interface/node.h
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | appInitMain(Config &config, | ||||
HTTPRPCRequestProcessor &httpRPCRequestProcessor) = 0; | HTTPRPCRequestProcessor &httpRPCRequestProcessor) = 0; | ||||
//! Stop node. | //! Stop node. | ||||
virtual void appShutdown() = 0; | virtual void appShutdown() = 0; | ||||
//! Start shutdown. | //! Start shutdown. | ||||
virtual void startShutdown() = 0; | virtual void startShutdown() = 0; | ||||
//! Return whether shutdown was requested. | |||||
virtual bool shutdownRequested() = 0; | |||||
//! Map port. | //! Map port. | ||||
virtual void mapPort(bool use_upnp) = 0; | virtual void mapPort(bool use_upnp) = 0; | ||||
//! Get proxy. | //! Get proxy. | ||||
virtual bool getProxy(Network net, proxyType &proxy_info) = 0; | virtual bool getProxy(Network net, proxyType &proxy_info) = 0; | ||||
//! Register handler for init messages. | //! Register handler for init messages. | ||||
using InitMessageFn = std::function<void(const std::string &message)>; | using InitMessageFn = std::function<void(const std::string &message)>; | ||||
virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | virtual std::unique_ptr<Handler> handleInitMessage(InitMessageFn fn) = 0; | ||||
//! Register handler for message box messages. | |||||
using MessageBoxFn = | |||||
std::function<bool(const std::string &message, | |||||
const std::string &caption, unsigned int style)>; | |||||
virtual std::unique_ptr<Handler> handleMessageBox(MessageBoxFn fn) = 0; | |||||
//! Register handler for question messages. | |||||
using QuestionFn = std::function<bool( | |||||
const std::string &message, const std::string &non_interactive_message, | |||||
const std::string &caption, unsigned int style)>; | |||||
virtual std::unique_ptr<Handler> handleQuestion(QuestionFn fn) = 0; | |||||
}; | }; | ||||
//! Return implementation of Node interface. | //! Return implementation of Node interface. | ||||
std::unique_ptr<Node> MakeNode(); | std::unique_ptr<Node> MakeNode(); | ||||
} // namespace interface | } // namespace interface | ||||
#endif // BITCOIN_INTERFACE_NODE_H | #endif // BITCOIN_INTERFACE_NODE_H |