Changeset View
Changeset View
Standalone View
Standalone View
src/ui_interface.h
// Copyright (c) 2010 Satoshi Nakamoto | // Copyright (c) 2010 Satoshi Nakamoto | ||||
// Copyright (c) 2012-2016 The Bitcoin Core developers | // Copyright (c) 2012-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_UI_INTERFACE_H | #ifndef BITCOIN_UI_INTERFACE_H | ||||
#define BITCOIN_UI_INTERFACE_H | #define BITCOIN_UI_INTERFACE_H | ||||
#include <functional> | #include <functional> | ||||
#include <memory> | #include <memory> | ||||
#include <string> | #include <string> | ||||
class CBlockIndex; | class CBlockIndex; | ||||
struct bilingual_str; | |||||
namespace boost { | namespace boost { | ||||
namespace signals2 { | namespace signals2 { | ||||
class connection; | class connection; | ||||
} | } | ||||
} // namespace boost | } // namespace boost | ||||
/** General change type (added, updated, removed). */ | /** General change type (added, updated, removed). */ | ||||
enum ChangeType { CT_NEW, CT_UPDATED, CT_DELETED }; | enum ChangeType { CT_NEW, CT_UPDATED, CT_DELETED }; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public: | ||||
}; | }; | ||||
#define ADD_SIGNALS_DECL_WRAPPER(signal_name, rtype, args...) \ | #define ADD_SIGNALS_DECL_WRAPPER(signal_name, rtype, args...) \ | ||||
rtype signal_name(args); \ | rtype signal_name(args); \ | ||||
using signal_name##Sig = rtype(args); \ | using signal_name##Sig = rtype(args); \ | ||||
boost::signals2::connection signal_name##_connect( \ | boost::signals2::connection signal_name##_connect( \ | ||||
std::function<signal_name##Sig> fn); | std::function<signal_name##Sig> fn); | ||||
/** Show message box. */ | /** | ||||
* Show message box. | |||||
*/ | |||||
ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox, bool, | ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox, bool, | ||||
const std::string &message, | const bilingual_str &message, | ||||
const std::string &caption, unsigned int style); | const std::string &caption, unsigned int style); | ||||
/** | /** | ||||
* If possible, ask the user a question. If not, falls back to | * If possible, ask the user a question. If not, falls back to | ||||
* ThreadSafeMessageBox(noninteractive_message, caption, style) and returns | * ThreadSafeMessageBox(noninteractive_message, caption, style) and returns | ||||
* false. | * false. | ||||
*/ | */ | ||||
ADD_SIGNALS_DECL_WRAPPER(ThreadSafeQuestion, bool, | ADD_SIGNALS_DECL_WRAPPER(ThreadSafeQuestion, bool, | ||||
const std::string &message, | const bilingual_str &message, | ||||
const std::string &noninteractive_message, | const std::string &noninteractive_message, | ||||
const std::string &caption, unsigned int style); | const std::string &caption, unsigned int style); | ||||
/** Progress message during initialization. */ | /** Progress message during initialization. */ | ||||
ADD_SIGNALS_DECL_WRAPPER(InitMessage, void, const std::string &message); | ADD_SIGNALS_DECL_WRAPPER(InitMessage, void, const std::string &message); | ||||
/** Number of network connections changed. */ | /** Number of network connections changed. */ | ||||
Show All 39 Lines |