Fabcoin Core  0.16.2
P2P Digital Currency
walletview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2017 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef FABCOIN_QT_WALLETVIEW_H
6 #define FABCOIN_QT_WALLETVIEW_H
7 
8 #include <amount.h>
9 
10 #include <QStackedWidget>
11 
12 class FabcoinGUI;
13 class ClientModel;
14 class OverviewPage;
15 class PlatformStyle;
16 class ReceiveCoinsDialog;
17 class SendCoinsDialog;
18 class SendCoinsRecipient;
19 class TransactionView;
20 class WalletModel;
21 class AddressBookPage;
22 class CreateContract;
23 class SendToContract;
24 class CallContract;
25 class QRCToken;
26 
27 QT_BEGIN_NAMESPACE
28 class QModelIndex;
29 class QProgressDialog;
30 QT_END_NAMESPACE
31 
32 /*
33  WalletView class. This class represents the view to a single wallet.
34  It was added to support multiple wallet functionality. Each wallet gets its own WalletView instance.
35  It communicates with both the client and the wallet models to give the user an up-to-date view of the
36  current core state.
37 */
38 class WalletView : public QStackedWidget
39 {
40  Q_OBJECT
41 
42 public:
43  explicit WalletView(const PlatformStyle *platformStyle, QWidget *parent);
44  ~WalletView();
45 
46  void setFabcoinGUI(FabcoinGUI *gui);
56 
57  bool handlePaymentRequest(const SendCoinsRecipient& recipient);
58 
59  void showOutOfSyncWarning(bool fShow);
60 
61 private:
64 
66  QWidget *transactionsPage;
75 
77 
78  QProgressDialog *progressDialog;
80 
81 public Q_SLOTS:
83  void gotoOverviewPage();
85  void gotoHistoryPage();
87  void gotoReceiveCoinsPage();
89  void gotoSendCoinsPage(QString addr = "");
95  void gotoCallContractPage();
97  void gotoSendTokenPage();
99  void gotoReceiveTokenPage();
101  void gotoAddTokenPage();
102 
104  void gotoSignMessageTab(QString addr = "");
106  void gotoVerifyMessageTab(QString addr = "");
107 
112  void processNewTransaction(const QModelIndex& parent, int start, int /*end*/);
113 
118  void processNewTokenTransaction(const QModelIndex& parent, int start, int /*end*/);
119 
121  void encryptWallet(bool status);
123  void backupWallet();
125  void restoreWallet();
127  void changePassphrase();
129  void unlockWallet(bool fromMenu = false);
131  void lockWallet();
132 
134  void usedSendingAddresses();
136  void usedReceivingAddresses();
137 
139  void updateEncryptionStatus();
140 
142  void showProgress(const QString &title, int nProgress);
143 
146 
147 Q_SIGNALS:
149  void showNormalIfMinimized();
151  void message(const QString &title, const QString &message, unsigned int style);
153  void encryptionStatusChanged(int status);
155  void hdEnabledStatusChanged(int hdEnabled);
157  void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
159  void incomingTokenTransaction(const QString& date, const QString& amount, const QString& type, const QString& address, const QString& label, const QString& title);
162 };
163 
164 #endif // FABCOIN_QT_WALLETVIEW_H
void unlockWallet(bool fromMenu=false)
Ask for passphrase to unlock wallet temporarily.
Definition: walletview.cpp:375
QWidget * transactionsPage
Definition: walletview.h:66
Dialog for requesting payment of fabcoins.
void incomingTokenTransaction(const QString &date, const QString &amount, const QString &type, const QString &address, const QString &label, const QString &title)
Notify that a new token transaction appeared.
void gotoVerifyMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to verify message tab.
Definition: walletview.cpp:304
void gotoSendToContractPage()
Switch to send contract page.
Definition: walletview.cpp:264
OverviewPage * overviewPage
Definition: walletview.h:65
TransactionView * transactionView
Definition: walletview.h:76
void usedSendingAddresses()
Show used sending addresses.
Definition: walletview.cpp:398
void gotoCreateContractPage()
Switch to create contract page.
Definition: walletview.cpp:259
void changePassphrase()
Change encrypted wallet passphrase.
Definition: walletview.cpp:368
ClientModel * clientModel
Definition: walletview.h:62
void requestedSyncWarningInfo()
User has requested more information about the out of sync state.
Definition: walletview.cpp:441
void processNewTokenTransaction(const QModelIndex &parent, int start, int)
Show incoming token transaction notification for new token transactions.
Definition: walletview.cpp:205
WalletModel * walletModel
Definition: walletview.h:63
Fabcoin GUI main class.
Definition: fabcoingui.h:51
CallContract * callContractPage
Definition: walletview.h:73
QRCToken * QRCTokenPage
Definition: walletview.h:74
void outOfSyncWarningClicked()
Notify that the out of sync warning icon has been pressed.
const PlatformStyle * platformStyle
Definition: walletview.h:79
void gotoAddTokenPage()
Switch to Add Token page.
Definition: walletview.cpp:286
void gotoSendCoinsPage(QString addr="")
Switch to send coins page.
Definition: walletview.cpp:251
void updateEncryptionStatus()
Re-emit encryption status signal.
Definition: walletview.cpp:326
CreateContract * createContractPage
Definition: walletview.h:71
void processNewTransaction(const QModelIndex &parent, int start, int)
Show incoming transaction notification for new transactions.
Definition: walletview.cpp:185
void gotoCallContractPage()
Switch to call contract page.
Definition: walletview.cpp:269
SendCoinsDialog * sendCoinsPage
Definition: walletview.h:68
int64_t CAmount
Amount in lius (Can be negative)
Definition: amount.h:15
void hdEnabledStatusChanged(int hdEnabled)
HD-Enabled status of wallet changed (only possible during startup)
void gotoHistoryPage()
Switch to history (transactions) page.
Definition: walletview.cpp:241
void usedReceivingAddresses()
Show used receiving addresses.
Definition: walletview.cpp:408
void setWalletModel(WalletModel *walletModel)
Set the wallet model.
Definition: walletview.cpp:141
void encryptionStatusChanged(int status)
Encryption status of wallet changed.
void incomingTransaction(const QString &date, int unit, const CAmount &amount, const QString &type, const QString &address, const QString &label)
Notify that a new transaction appeared.
Widget showing the transaction list for a wallet, including a filter row.
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
Dialog for sending fabcoins.
void restoreWallet()
Restore the wallet.
Definition: walletview.cpp:361
Widget that shows a list of sending or receiving addresses.
Model for Fabcoin network client.
Definition: clientmodel.h:38
void showNormalIfMinimized()
Signal that we want to show the main window.
void backupWallet()
Backup the wallet.
Definition: walletview.cpp:342
bool handlePaymentRequest(const SendCoinsRecipient &recipient)
Definition: walletview.cpp:316
void gotoOverviewPage()
Switch to overview (home) page.
Definition: walletview.cpp:236
AddressBookPage * usedSendingAddressesPage
Definition: walletview.h:69
void gotoSignMessageTab(QString addr="")
Show Sign/Verify Message dialog and switch to sign message tab.
Definition: walletview.cpp:292
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61
void setFabcoinGUI(FabcoinGUI *gui)
Definition: walletview.cpp:102
Interface to Fabcoin wallet from Qt view code.
Definition: walletmodel.h:103
void showProgress(const QString &title, int nProgress)
Show progress dialog e.g.
Definition: walletview.cpp:418
void lockWallet()
Lock the wallet.
Definition: walletview.cpp:390
WalletView(const PlatformStyle *platformStyle, QWidget *parent)
Definition: walletview.cpp:39
void setClientModel(ClientModel *clientModel)
Set the client model.
Definition: walletview.cpp:129
void gotoReceiveTokenPage()
Switch to Receive Token page.
Definition: walletview.cpp:280
struct evm_uint160be address(struct evm_env *env)
Definition: capi.c:13
void encryptWallet(bool status)
Encrypt the wallet.
Definition: walletview.cpp:331
ReceiveCoinsDialog * receiveCoinsPage
Definition: walletview.h:67
void gotoReceiveCoinsPage()
Switch to receive coins page.
Definition: walletview.cpp:246
void gotoSendTokenPage()
Switch to Send Token page.
Definition: walletview.cpp:274
SendToContract * sendToContractPage
Definition: walletview.h:72
Overview ("home") page widget.
Definition: overviewpage.h:29
void showOutOfSyncWarning(bool fShow)
Definition: walletview.cpp:321
QProgressDialog * progressDialog
Definition: walletview.h:78
AddressBookPage * usedReceivingAddressesPage
Definition: walletview.h:70