Dogecoin Core  1.14.2
P2P Digital Currency
ui_interface.h
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2012-2016 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_UI_INTERFACE_H
7 #define BITCOIN_UI_INTERFACE_H
8 
9 #include <stdint.h>
10 #include <string>
11 
12 #include <boost/signals2/last_value.hpp>
13 #include <boost/signals2/signal.hpp>
14 
15 class CBasicKeyStore;
16 class CWallet;
17 class uint256;
18 class CBlockIndex;
19 
22 {
26 };
27 
30 {
31 public:
34  {
36  ICON_WARNING = (1U << 0),
37  ICON_ERROR = (1U << 1),
43 
45  BTN_OK = 0x00000400U, // QMessageBox::Ok
46  BTN_YES = 0x00004000U, // QMessageBox::Yes
47  BTN_NO = 0x00010000U, // QMessageBox::No
48  BTN_ABORT = 0x00040000U, // QMessageBox::Abort
49  BTN_RETRY = 0x00080000U, // QMessageBox::Retry
50  BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore
51  BTN_CLOSE = 0x00200000U, // QMessageBox::Close
52  BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel
53  BTN_DISCARD = 0x00800000U, // QMessageBox::Discard
54  BTN_HELP = 0x01000000U, // QMessageBox::Help
55  BTN_APPLY = 0x02000000U, // QMessageBox::Apply
56  BTN_RESET = 0x04000000U, // QMessageBox::Reset
63 
65  MODAL = 0x10000000U,
66 
68  SECURE = 0x40000000U,
69 
74  };
75 
77  boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;
78 
80  boost::signals2::signal<bool (const std::string& message, const std::string& noninteractive_message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeQuestion;
81 
83  boost::signals2::signal<void (const std::string &message)> InitMessage;
84 
86  boost::signals2::signal<void (int newNumConnections)> NotifyNumConnectionsChanged;
87 
89  boost::signals2::signal<void (bool networkActive)> NotifyNetworkActiveChanged;
90 
95  boost::signals2::signal<void (const uint256 &hash, ChangeType status)> NotifyAlertChanged;
96 
98  boost::signals2::signal<void (CWallet* wallet)> LoadWallet;
99 
101  boost::signals2::signal<void (const std::string &title, int nProgress)> ShowProgress;
102 
104  boost::signals2::signal<void (bool, const CBlockIndex *)> NotifyBlockTip;
105 
107  boost::signals2::signal<void (bool, const CBlockIndex *)> NotifyHeaderTip;
108 
110  boost::signals2::signal<void (void)> BannedListChanged;
111 };
112 
114 void InitWarning(const std::string& str);
115 
117 bool InitError(const std::string& str);
118 
119 std::string AmountHighWarn(const std::string& optname);
120 
121 std::string AmountErrMsg(const char* const optname, const std::string& strValue);
122 
124 
125 #endif // BITCOIN_UI_INTERFACE_H
Basic key store, that keeps keys in an address->secret map.
Definition: keystore.h:56
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:158
Signals for UI communication.
Definition: ui_interface.h:30
boost::signals2::signal< void(const uint256 &hash, ChangeType status)> NotifyAlertChanged
New, updated or cancelled alert.
Definition: ui_interface.h:95
boost::signals2::signal< void(CWallet *wallet)> LoadWallet
A wallet has been loaded.
Definition: ui_interface.h:98
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyBlockTip
New block has been accepted.
Definition: ui_interface.h:104
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
Definition: ui_interface.h:86
MessageBoxFlags
Flags for CClientUIInterface::ThreadSafeMessageBox.
Definition: ui_interface.h:34
@ ICON_MASK
Mask of all available icons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition: ui_interface.h:42
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition: ui_interface.h:61
@ BTN_OK
These values are taken from qmessagebox.h "enum StandardButton" to be directly usable.
Definition: ui_interface.h:45
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:71
@ MODAL
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:65
@ SECURE
Do not print contents of message to debug log.
Definition: ui_interface.h:68
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
Definition: ui_interface.h:101
boost::signals2::signal< void(bool, const CBlockIndex *)> NotifyHeaderTip
Best header has changed.
Definition: ui_interface.h:107
boost::signals2::signal< bool(const std::string &message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeMessageBox
Show message box.
Definition: ui_interface.h:77
boost::signals2::signal< bool(const std::string &message, const std::string &noninteractive_message, const std::string &caption, unsigned int style), boost::signals2::last_value< bool > > ThreadSafeQuestion
If possible, ask the user a question.
Definition: ui_interface.h:80
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:83
boost::signals2::signal< void(void)> BannedListChanged
Banlist did change.
Definition: ui_interface.h:110
boost::signals2::signal< void(bool networkActive)> NotifyNetworkActiveChanged
Network activity state changed.
Definition: ui_interface.h:89
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
Definition: wallet.h:493
256-bit opaque blob.
Definition: uint256.h:123
std::string AmountErrMsg(const char *const optname, const std::string &strValue)
ChangeType
General change type (added, updated, removed).
Definition: ui_interface.h:22
@ CT_UPDATED
Definition: ui_interface.h:24
@ CT_DELETED
Definition: ui_interface.h:25
@ CT_NEW
Definition: ui_interface.h:23
bool InitError(const std::string &str)
Show error message.
CClientUIInterface uiInterface
Definition: ui_interface.cpp:8
std::string AmountHighWarn(const std::string &optname)
void InitWarning(const std::string &str)
Show warning message.