Bitcoin Core
32.1.0
P2P Digital Currency
Toggle main menu visibility
Loading...
Searching...
No Matches
src
node
interface_ui.h
Go to the documentation of this file.
1
// Copyright (c) 2010 Satoshi Nakamoto
2
// Copyright (c) 2012-present The Bitcoin Core developers
3
// Distributed under the MIT software license, see the accompanying
4
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6
#ifndef BITCOIN_NODE_INTERFACE_UI_H
7
#define BITCOIN_NODE_INTERFACE_UI_H
8
9
#include <
util/btcsignals.h
>
10
11
#include <cstdint>
12
#include <functional>
13
#include <string>
14
#include <vector>
15
16
class
CBlockIndex
;
17
enum class
SynchronizationState
;
18
struct
bilingual_str
;
19
21
class
CClientUIInterface
22
{
23
public
:
25
enum
MessageBoxFlags
: uint32_t {
26
ICON_INFORMATION
= 0,
27
ICON_WARNING
= (1U << 0),
28
ICON_ERROR
= (1U << 1),
33
ICON_MASK
= (
ICON_INFORMATION
|
ICON_WARNING
|
ICON_ERROR
),
34
36
BTN_OK
= 0x00000400U,
// QMessageBox::Ok
37
BTN_YES
= 0x00004000U,
// QMessageBox::Yes
38
BTN_NO
= 0x00010000U,
// QMessageBox::No
39
BTN_ABORT
= 0x00040000U,
// QMessageBox::Abort
40
BTN_RETRY
= 0x00080000U,
// QMessageBox::Retry
41
BTN_IGNORE
= 0x00100000U,
// QMessageBox::Ignore
42
BTN_CLOSE
= 0x00200000U,
// QMessageBox::Close
43
BTN_CANCEL
= 0x00400000U,
// QMessageBox::Cancel
44
BTN_DISCARD
= 0x00800000U,
// QMessageBox::Discard
45
BTN_HELP
= 0x01000000U,
// QMessageBox::Help
46
BTN_APPLY
= 0x02000000U,
// QMessageBox::Apply
47
BTN_RESET
= 0x04000000U,
// QMessageBox::Reset
52
BTN_MASK
= (
BTN_OK
|
BTN_YES
|
BTN_NO
|
BTN_ABORT
|
BTN_RETRY
|
BTN_IGNORE
|
53
BTN_CLOSE
|
BTN_CANCEL
|
BTN_DISCARD
|
BTN_HELP
|
BTN_APPLY
|
BTN_RESET
),
54
56
MODAL
= 0x10000000U,
57
59
SECURE
= 0x40000000U,
60
62
MSG_INFORMATION
=
ICON_INFORMATION
,
63
MSG_WARNING
= (
ICON_WARNING
|
BTN_OK
|
MODAL
),
64
MSG_ERROR
= (
ICON_ERROR
|
BTN_OK
|
MODAL
)
65
};
66
68
btcsignals::signal
<void(
const
bilingual_str
& message,
unsigned
int
style)>
ThreadSafeMessageBox
;
69
71
btcsignals::signal
<bool(
const
bilingual_str
& message,
const
std::string& noninteractive_message,
unsigned
int
style),
btcsignals::any_of
>
ThreadSafeQuestion
;
72
74
btcsignals::signal
<void(
const
std::string& message)>
InitMessage
;
75
77
btcsignals::signal
<void()>
InitWallet
;
78
80
btcsignals::signal
<void(
int
newNumConnections)>
NotifyNumConnectionsChanged
;
81
83
btcsignals::signal
<void(
bool
networkActive)>
NotifyNetworkActiveChanged
;
84
88
btcsignals::signal
<void()>
NotifyAlertChanged
;
89
94
btcsignals::signal
<void(
const
std::string& title,
int
nProgress,
bool
resume_possible)>
ShowProgress
;
95
97
btcsignals::signal
<void(
SynchronizationState
,
const
CBlockIndex
& block,
double
verification_progress)>
NotifyBlockTip
;
98
100
btcsignals::signal
<void(
SynchronizationState
, int64_t height, int64_t timestamp,
bool
presync)>
NotifyHeaderTip
;
101
103
btcsignals::signal
<void(
void
)>
BannedListChanged
;
104
};
105
107
void
InitWarning
(
const
bilingual_str
& str);
108
110
bool
InitError
(
const
bilingual_str
& str);
111
bool
InitError
(
const
bilingual_str
& str,
const
std::vector<std::string>& details);
112
113
extern
CClientUIInterface
uiInterface
;
114
115
#endif
// BITCOIN_NODE_INTERFACE_UI_H
btcsignals.h
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition
chain.h:94
CClientUIInterface
Signals for UI communication.
Definition
interface_ui.h:22
CClientUIInterface::InitMessage
btcsignals::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition
interface_ui.h:74
CClientUIInterface::ThreadSafeQuestion
btcsignals::signal< bool(const bilingual_str &message, const std::string &noninteractive_message, unsigned int style), btcsignals::any_of > ThreadSafeQuestion
If possible, ask the user a question.
Definition
interface_ui.h:71
CClientUIInterface::InitWallet
btcsignals::signal< void()> InitWallet
Wallet loader created.
Definition
interface_ui.h:77
CClientUIInterface::NotifyAlertChanged
btcsignals::signal< void()> NotifyAlertChanged
Status bar alerts changed.
Definition
interface_ui.h:88
CClientUIInterface::NotifyNetworkActiveChanged
btcsignals::signal< void(bool networkActive)> NotifyNetworkActiveChanged
Network activity state changed.
Definition
interface_ui.h:83
CClientUIInterface::NotifyNumConnectionsChanged
btcsignals::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
Definition
interface_ui.h:80
CClientUIInterface::ThreadSafeMessageBox
btcsignals::signal< void(const bilingual_str &message, unsigned int style)> ThreadSafeMessageBox
Show message box.
Definition
interface_ui.h:68
CClientUIInterface::NotifyBlockTip
btcsignals::signal< void(SynchronizationState, const CBlockIndex &block, double verification_progress)> NotifyBlockTip
New block has been accepted.
Definition
interface_ui.h:97
CClientUIInterface::ShowProgress
btcsignals::signal< void(const std::string &title, int nProgress, bool resume_possible)> ShowProgress
Show progress e.g.
Definition
interface_ui.h:94
CClientUIInterface::MessageBoxFlags
MessageBoxFlags
Flags for CClientUIInterface::ThreadSafeMessageBox.
Definition
interface_ui.h:25
CClientUIInterface::MSG_ERROR
@ MSG_ERROR
Definition
interface_ui.h:64
CClientUIInterface::BTN_ABORT
@ BTN_ABORT
Definition
interface_ui.h:39
CClientUIInterface::BTN_DISCARD
@ BTN_DISCARD
Definition
interface_ui.h:44
CClientUIInterface::ICON_WARNING
@ ICON_WARNING
Definition
interface_ui.h:27
CClientUIInterface::ICON_ERROR
@ ICON_ERROR
Definition
interface_ui.h:28
CClientUIInterface::BTN_YES
@ BTN_YES
Definition
interface_ui.h:37
CClientUIInterface::MSG_WARNING
@ MSG_WARNING
Definition
interface_ui.h:63
CClientUIInterface::ICON_MASK
@ ICON_MASK
Mask of all available icons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition
interface_ui.h:33
CClientUIInterface::BTN_HELP
@ BTN_HELP
Definition
interface_ui.h:45
CClientUIInterface::BTN_IGNORE
@ BTN_IGNORE
Definition
interface_ui.h:41
CClientUIInterface::BTN_MASK
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition
interface_ui.h:52
CClientUIInterface::BTN_RESET
@ BTN_RESET
Definition
interface_ui.h:47
CClientUIInterface::BTN_APPLY
@ BTN_APPLY
Definition
interface_ui.h:46
CClientUIInterface::BTN_CLOSE
@ BTN_CLOSE
Definition
interface_ui.h:42
CClientUIInterface::BTN_OK
@ BTN_OK
These values are taken from qmessagebox.h "enum StandardButton" to be directly usable.
Definition
interface_ui.h:36
CClientUIInterface::ICON_INFORMATION
@ ICON_INFORMATION
Definition
interface_ui.h:26
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition
interface_ui.h:62
CClientUIInterface::MODAL
@ MODAL
Force blocking, modal message box dialog (not just OS notification).
Definition
interface_ui.h:56
CClientUIInterface::BTN_NO
@ BTN_NO
Definition
interface_ui.h:38
CClientUIInterface::BTN_CANCEL
@ BTN_CANCEL
Definition
interface_ui.h:43
CClientUIInterface::BTN_RETRY
@ BTN_RETRY
Definition
interface_ui.h:40
CClientUIInterface::SECURE
@ SECURE
Do not print contents of message to debug log.
Definition
interface_ui.h:59
CClientUIInterface::BannedListChanged
btcsignals::signal< void(void)> BannedListChanged
Banlist did change.
Definition
interface_ui.h:103
CClientUIInterface::NotifyHeaderTip
btcsignals::signal< void(SynchronizationState, int64_t height, int64_t timestamp, bool presync)> NotifyHeaderTip
Best header has changed.
Definition
interface_ui.h:100
btcsignals::any_of
A combiner, which checks if at least one callback returned true.
Definition
btcsignals.h:42
btcsignals::signal
Definition
btcsignals.h:152
uiInterface
CClientUIInterface uiInterface
Definition
interface_ui.cpp:13
InitWarning
void InitWarning(const bilingual_str &str)
Show warning message.
Definition
interface_ui.cpp:33
InitError
bool InitError(const bilingual_str &str)
Show error message.
Definition
interface_ui.cpp:15
bilingual_str
Bilingual messages:
Definition
translation.h:24
SynchronizationState
SynchronizationState
Current sync state passed to tip changed callbacks.
Definition
validation.h:96
Generated on
for Bitcoin Core by
1.18.0