Export functionality for transaction list
[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     QAction *exportAction;
67
68     QSystemTrayIcon *trayIcon;
69     TransactionView *transactionView;
70
71     void createActions();
72     QWidget *createTabs();
73     void createTrayIcon();
74
75 public slots:
76     void setBalance(qint64 balance);
77     void setNumConnections(int count);
78     void setNumBlocks(int count);
79     void setNumTransactions(int count);
80     void error(const QString &title, const QString &message);
81     /* It is currently not possible to pass a return value to another thread through
82        BlockingQueuedConnection, so use an indirected pointer.
83        http://bugreports.qt.nokia.com/browse/QTBUG-10440
84     */
85     void askFee(qint64 nFeeRequired, bool *payFee);
86
87 private slots:
88     void sendCoinsClicked();
89     void addressbookClicked();
90     void optionsClicked();
91     void receiveCoinsClicked();
92     void aboutClicked();
93     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
94     void transactionDetails(const QModelIndex& idx);
95     void incomingTransaction(const QModelIndex & parent, int start, int end);
96     void exportClicked();
97
98     void gotoOverviewTab();
99     void gotoHistoryTab();
100 };
101
102 #endif