PRCYCoin  2.0.0.7rc1
P2P Digital Currency
guiinterface.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_GUIINTERFACE_H
7 #define BITCOIN_GUIINTERFACE_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 
21 enum ChangeType {
25 };
26 
29 {
30 public:
34  ICON_WARNING = (1U << 0),
35  ICON_ERROR = (1U << 1),
41 
43  BTN_OK = 0x00000400U, // QMessageBox::Ok
44  BTN_YES = 0x00004000U, // QMessageBox::Yes
45  BTN_NO = 0x00010000U, // QMessageBox::No
46  BTN_ABORT = 0x00040000U, // QMessageBox::Abort
47  BTN_RETRY = 0x00080000U, // QMessageBox::Retry
48  BTN_IGNORE = 0x00100000U, // QMessageBox::Ignore
49  BTN_CLOSE = 0x00200000U, // QMessageBox::Close
50  BTN_CANCEL = 0x00400000U, // QMessageBox::Cancel
51  BTN_DISCARD = 0x00800000U, // QMessageBox::Discard
52  BTN_HELP = 0x01000000U, // QMessageBox::Help
53  BTN_APPLY = 0x02000000U, // QMessageBox::Apply
54  BTN_RESET = 0x04000000U, // QMessageBox::Reset
60  BTN_CLOSE |
61  BTN_CANCEL |
62  BTN_DISCARD |
63  BTN_HELP |
64  BTN_APPLY |
65  BTN_RESET),
66 
68  MODAL = 0x10000000U,
69 
71  SECURE = 0x40000000U,
72 
77  };
78 
80  boost::signals2::signal<bool(const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;
81 
83  boost::signals2::signal<void(const std::string& message)> InitMessage;
84 
86  boost::signals2::signal<void()> ShowRecoveryDialog;
87 
89  boost::signals2::signal<std::string(const char* psz)> Translate;
90 
92  boost::signals2::signal<void(int newNumConnections)> NotifyNumConnectionsChanged;
93 
95  boost::signals2::signal<void()> 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 fInitialDownload, const CBlockIndex* newTip)> NotifyBlockTip;
105 
107  boost::signals2::signal<void(int size, const uint256& hash)> NotifyBlockSize;
108 
110  boost::signals2::signal<void (void)> BannedListChanged;
111 };
112 
114 
119 inline std::string _(const char* psz)
120 {
121  boost::optional<std::string> rv = uiInterface.Translate(psz);
122  return rv ? (*rv) : psz;
123 }
124 
125 #endif // BITCOIN_GUIINTERFACE_H
CClientUIInterface::MSG_INFORMATION
@ MSG_INFORMATION
Predefined combinations for certain default usage cases.
Definition: guiinterface.h:74
CClientUIInterface::MODAL
@ MODAL
Force blocking, modal message box dialog (not just OS notification)
Definition: guiinterface.h:68
CClientUIInterface::BTN_ABORT
@ BTN_ABORT
Definition: guiinterface.h:46
CT_DELETED
@ CT_DELETED
Definition: guiinterface.h:24
CClientUIInterface
Signals for UI communication.
Definition: guiinterface.h:28
uiInterface
CClientUIInterface uiInterface
Definition: init.cpp:101
CClientUIInterface::BTN_DISCARD
@ BTN_DISCARD
Definition: guiinterface.h:51
CClientUIInterface::ICON_WARNING
@ ICON_WARNING
Definition: guiinterface.h:34
CClientUIInterface::BannedListChanged
boost::signals2::signal< void(void)> BannedListChanged
Banlist did change.
Definition: guiinterface.h:110
CClientUIInterface::BTN_OK
@ BTN_OK
These values are taken from qmessagebox.h "enum StandardButton" to be directly usable.
Definition: guiinterface.h:43
CClientUIInterface::NotifyBlockSize
boost::signals2::signal< void(int size, const uint256 &hash)> NotifyBlockSize
New block has been accepted and is over a certain size.
Definition: guiinterface.h:107
CT_NEW
@ CT_NEW
Definition: guiinterface.h:22
CClientUIInterface::InitMessage
boost::signals2::signal< void(const std::string &message)> InitMessage
Progress message during initialization.
Definition: guiinterface.h:83
_
std::string _(const char *psz)
Translation function: Call Translate signal on UI interface, which returns a boost::optional result.
Definition: guiinterface.h:119
CClientUIInterface::SECURE
@ SECURE
Do not print contents of message to debug log.
Definition: guiinterface.h:71
CClientUIInterface::ICON_MASK
@ ICON_MASK
Mask of all available icons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition: guiinterface.h:40
CClientUIInterface::ThreadSafeMessageBox
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: guiinterface.h:80
CClientUIInterface::MSG_WARNING
@ MSG_WARNING
Definition: guiinterface.h:75
CClientUIInterface::BTN_RESET
@ BTN_RESET
Definition: guiinterface.h:54
CClientUIInterface::NotifyAlertChanged
boost::signals2::signal< void()> NotifyAlertChanged
New, updated or cancelled alert.
Definition: guiinterface.h:95
uint256
256-bit unsigned big integer.
Definition: uint256.h:38
CClientUIInterface::BTN_IGNORE
@ BTN_IGNORE
Definition: guiinterface.h:48
CClientUIInterface::BTN_CANCEL
@ BTN_CANCEL
Definition: guiinterface.h:50
CT_UPDATED
@ CT_UPDATED
Definition: guiinterface.h:23
ChangeType
ChangeType
General change type (added, updated, removed).
Definition: guiinterface.h:21
CClientUIInterface::BTN_HELP
@ BTN_HELP
Definition: guiinterface.h:52
CClientUIInterface::MSG_ERROR
@ MSG_ERROR
Definition: guiinterface.h:76
CClientUIInterface::LoadWallet
boost::signals2::signal< void(CWallet *wallet)> LoadWallet
A wallet has been loaded.
Definition: guiinterface.h:98
CClientUIInterface::ICON_INFORMATION
@ ICON_INFORMATION
Definition: guiinterface.h:33
CClientUIInterface::BTN_RETRY
@ BTN_RETRY
Definition: guiinterface.h:47
CClientUIInterface::BTN_YES
@ BTN_YES
Definition: guiinterface.h:44
CWallet
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances,...
Definition: wallet.h:243
CClientUIInterface::BTN_APPLY
@ BTN_APPLY
Definition: guiinterface.h:53
CClientUIInterface::ShowRecoveryDialog
boost::signals2::signal< void()> ShowRecoveryDialog
Show recovery dialog.
Definition: guiinterface.h:86
CClientUIInterface::BTN_CLOSE
@ BTN_CLOSE
Definition: guiinterface.h:49
CClientUIInterface::Translate
boost::signals2::signal< std::string(const char *psz)> Translate
Translate a message to the native language of the user.
Definition: guiinterface.h:89
CClientUIInterface::ICON_ERROR
@ ICON_ERROR
Definition: guiinterface.h:35
CBasicKeyStore
Basic key store, that keeps keys in an address->secret map.
Definition: keystore.h:57
CClientUIInterface::BTN_MASK
@ BTN_MASK
Mask of all available buttons in CClientUIInterface::MessageBoxFlags This needs to be updated,...
Definition: guiinterface.h:59
CClientUIInterface::NotifyBlockTip
boost::signals2::signal< void(bool fInitialDownload, const CBlockIndex *newTip)> NotifyBlockTip
New block has been accepted.
Definition: guiinterface.h:104
CClientUIInterface::ShowProgress
boost::signals2::signal< void(const std::string &title, int nProgress)> ShowProgress
Show progress e.g.
Definition: guiinterface.h:101
CBlockIndex
The block chain is a tree shaped structure starting with the genesis block at the root,...
Definition: chain.h:162
CClientUIInterface::MessageBoxFlags
MessageBoxFlags
Flags for CClientUIInterface::ThreadSafeMessageBox.
Definition: guiinterface.h:32
CClientUIInterface::BTN_NO
@ BTN_NO
Definition: guiinterface.h:45
CClientUIInterface::NotifyNumConnectionsChanged
boost::signals2::signal< void(int newNumConnections)> NotifyNumConnectionsChanged
Number of network connections changed.
Definition: guiinterface.h:92