Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 #ifndef BITCOIN_UI_INTERFACE_H
6 #define BITCOIN_UI_INTERFACE_H
7 
8 #include <string>
9 #include "util.h" // for int64
10 #include <boost/signals2/signal.hpp>
11 #include <boost/signals2/last_value.hpp>
12 
13 class CBasicKeyStore;
14 class CWallet;
15 class uint256;
16 
19 {
23 };
24 
27 {
28 public:
31  {
33  ICON_WARNING = (1U << 0),
34  ICON_ERROR = (1U << 1),
40 
42  BTN_OK = 0x00000400U, // QMessageBox::Ok
43  BTN_YES = 0x00004000U, // QMessageBox::Yes
44  BTN_NO = 0x00010000U, // QMessageBox::No
45  BTN_ABORT = 0x00040000U, // QMessageBox::Abort
46  BTN_RETRY = 0x00080000U, // QMessageBox::Retry
47  BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore
48  BTN_CLOSE = 0x00200000U, // QMessageBox::Close
49  BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel
50  BTN_DISCARD = 0x00800000U, // QMessageBox::Discard
51  BTN_HELP = 0x01000000U, // QMessageBox::Help
52  BTN_APPLY = 0x02000000U, // QMessageBox::Apply
53  BTN_RESET = 0x04000000U, // QMessageBox::Reset
60 
62  MODAL = 0x10000000U,
63 
68  };
69 
71  boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;
72 
74  boost::signals2::signal<bool (int64 nFeeRequired), boost::signals2::last_value<bool> > ThreadSafeAskFee;
75 
77  boost::signals2::signal<void (const std::string& strURI)> ThreadSafeHandleURI;
78 
80  boost::signals2::signal<void (const std::string &message)> InitMessage;
81 
83  boost::signals2::signal<std::string (const char* psz)> Translate;
84 
86  boost::signals2::signal<void ()> NotifyBlocksChanged;
87 
89  boost::signals2::signal<void (int newNumConnections)> NotifyNumConnectionsChanged;
90 
95  boost::signals2::signal<void (const uint256 &hash, ChangeType status)> NotifyAlertChanged;
96 };
97 
99 
104 inline std::string _(const char* psz)
105 {
106  boost::optional<std::string> rv = uiInterface.Translate(psz);
107  return rv ? (*rv) : psz;
108 }
109 
110 #endif
CClientUIInterface uiInterface
Definition: init.cpp:32
MessageBoxFlags
Flags for CClientUIInterface::ThreadSafeMessageBox.
Definition: ui_interface.h:30
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated...
Definition: ui_interface.h:58
Signals for UI communication.
Definition: ui_interface.h:26
Force blocking, modal message box dialog (not just OS notification)
Definition: ui_interface.h:62
ChangeType
General change type (added, updated, removed).
Definition: ui_interface.h:18
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: ui_interface.h:83
boost::signals2::signal< bool(int64 nFeeRequired), boost::signals2::last_value< bool > > ThreadSafeAskFee
Ask the user whether they want to pay a fee or not.
Definition: ui_interface.h:74
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
Definition: ui_interface.h:89
These values are taken from qmessagebox.h "enum StandardButton" to be directly usable.
Definition: ui_interface.h:42
256-bit unsigned integer
Definition: uint256.h:537
boost::signals2::signal< void(const uint256 &hash, ChangeType status)> NotifyAlertChanged
New, updated or cancelled alert.
Definition: ui_interface.h:95
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result...
Definition: ui_interface.h:104
boost::signals2::signal< void()> NotifyBlocksChanged
Block chain changed.
Definition: ui_interface.h:86
Mask of all available icons in CClientUIInterface::MessageBoxFlags This needs to be updated...
Definition: ui_interface.h:39
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:69
boost::signals2::signal< void(const std::string &strURI)> ThreadSafeHandleURI
Handle a URL passed at the command line.
Definition: ui_interface.h:77
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:71
Basic key store, that keeps keys in an address->secret map.
Definition: keystore.h:43
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: ui_interface.h:80
Predefined combinations for certain default usage cases.
Definition: ui_interface.h:65