Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ui_interface.h
Go to the documentation of this file.
1 // Copyright (c) 2010 Satoshi Nakamoto
2 // Copyright (c) 2012 The Bitcoin developers
3 // Distributed under the MIT/X11 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 
21 {
25 };
26 
29 {
30 public:
33  {
35  ICON_WARNING = (1U << 0),
36  ICON_ERROR = (1U << 1),
42 
44  BTN_OK = 0x00000400U, // QMessageBox::Ok
45  BTN_YES = 0x00004000U, // QMessageBox::Yes
46  BTN_NO = 0x00010000U, // QMessageBox::No
47  BTN_ABORT = 0x00040000U, // QMessageBox::Abort
48  BTN_RETRY = 0x00080000U, // QMessageBox::Retry
49  BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore
50  BTN_CLOSE = 0x00200000U, // QMessageBox::Close
51  BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel
52  BTN_DISCARD = 0x00800000U, // QMessageBox::Discard
53  BTN_HELP = 0x01000000U, // QMessageBox::Help
54  BTN_APPLY = 0x02000000U, // QMessageBox::Apply
55  BTN_RESET = 0x04000000U, // QMessageBox::Reset
62 
64  MODAL = 0x10000000U,
66  NOSHOWGUI = 0x20000000U,
67 
72  };
73 
75  boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;
76 
78  boost::signals2::signal<void (const std::string &message)> InitMessage;
79 
81  boost::signals2::signal<std::string (const char* psz)> Translate;
82 
84  boost::signals2::signal<void ()> NotifyBlocksChanged;
85 
87  boost::signals2::signal<void (int newNumConnections)> NotifyNumConnectionsChanged;
88 
93  boost::signals2::signal<void (const uint256 &hash, ChangeType status)> NotifyAlertChanged;
94 
96  boost::signals2::signal<void (CWallet* wallet)> LoadWallet;
97 };
98 
100 
105 inline std::string _(const char* psz)
106 {
107  boost::optional<std::string> rv = uiInterface.Translate(psz);
108  return rv ? (*rv) : psz;
109 }
110 
111 #endif
CClientUIInterface uiInterface
Definition: util.cpp:100
MessageBoxFlags
Flags for CClientUIInterface::ThreadSafeMessageBox.
Definition: ui_interface.h:32
boost::signals2::signal< void(CWallet *wallet)> LoadWallet
A wallet has been loaded.
Definition: ui_interface.h:96
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated...
Definition: ui_interface.h:60
Don't bring GUI to foreground.
Definition: ui_interface.h:66
Signals for UI communication.
Definition: ui_interface.h:28
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:64
ChangeType
General change type (added, updated, removed).
Definition: ui_interface.h:20
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: ui_interface.h:81
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
Definition: ui_interface.h:87
These values are taken from qmessagebox.h "enum StandardButton" to be directly usable.
Definition: ui_interface.h:44
256-bit unsigned integer
Definition: uint256.h:531
boost::signals2::signal< void(const uint256 &hash, ChangeType status)> NotifyAlertChanged
New, updated or cancelled alert.
Definition: ui_interface.h:93
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: ui_interface.h:105
boost::signals2::signal< void()> NotifyBlocksChanged
Block chain changed.
Definition: ui_interface.h:84
Mask of all available icons in CClientUIInterface::MessageBoxFlags This needs to be updated...
Definition: ui_interface.h:41
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:100
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:75
Basic key store, that keeps keys in an address->secret map.
Definition: keystore.h:45
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:78
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:69