Rename "History" tab to more logical "Transactions", move "Number of transactions...
[novacoin.git] / src / qt / bitcoingui.h
1 #ifndef BITCOINGUI_H
2 #define BITCOINGUI_H
3
4 #include <QMainWindow>
5 #include <QSystemTrayIcon>
6
7 class TransactionTableModel;
8 class ClientModel;
9 class WalletModel;
10 class TransactionView;
11 class OverviewPage;
12
13 QT_BEGIN_NAMESPACE
14 class QLabel;
15 class QLineEdit;
16 class QTableView;
17 class QAbstractItemModel;
18 class QModelIndex;
19 class QProgressBar;
20 class QStackedWidget;
21 QT_END_NAMESPACE
22
23 class BitcoinGUI : public QMainWindow
24 {
25     Q_OBJECT
26 public:
27     explicit BitcoinGUI(QWidget *parent = 0);
28     void setClientModel(ClientModel *clientModel);
29     void setWalletModel(WalletModel *walletModel);
30     
31     /* Transaction table tab indices */
32     enum {
33         AllTransactions = 0,
34         SentReceived = 1,
35         Sent = 2,
36         Received = 3
37     } TabIndex;
38
39 protected:
40     void changeEvent(QEvent *e);
41     void closeEvent(QCloseEvent *event);
42
43 private:
44     ClientModel *clientModel;
45     WalletModel *walletModel;
46
47     QStackedWidget *centralWidget;
48     OverviewPage *overviewPage;
49     QWidget *transactionsPage;
50
51     QLabel *labelConnections;
52     QLabel *labelConnectionsIcon;
53     QLabel *labelBlocks;
54     QLabel *progressBarLabel;
55     QProgressBar *progressBar;
56
57     QAction *overviewAction;
58     QAction *historyAction;
59     QAction *quit;
60     QAction *sendCoins;
61     QAction *addressbook;
62     QAction *about;
63     QAction *receiveCoins;
64     QAction *options;
65     QAction *openBitcoin;
66
67     QSystemTrayIcon *trayIcon;
68     TransactionView *transactionView;
69
70     void createActions();
71     QWidget *createTabs();
72     void createTrayIcon();
73
74 public slots:
75     void setBalance(qint64 balance);
76     void setNumConnections(int count);
77     void setNumBlocks(int count);
78     void setNumTransactions(int count);
79     void error(const QString &title, const QString &message);
80     /* It is currently not possible to pass a return value to another thread through
81        BlockingQueuedConnection, so use an indirected pointer.
82        http://bugreports.qt.nokia.com/browse/QTBUG-10440
83     */
84     void askFee(qint64 nFeeRequired, bool *payFee);
85
86 private slots:
87     void sendCoinsClicked();
88     void addressbookClicked();
89     void optionsClicked();
90     void receiveCoinsClicked();
91     void aboutClicked();
92     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
93     void transactionDetails(const QModelIndex& idx);
94     void incomingTransaction(const QModelIndex & parent, int start, int end);
95
96     void gotoOverviewTab();
97     void gotoHistoryTab();
98 };
99
100 #endif