Implement filter row instead of tabs, allows for more expressive filters
[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 TransactionView;
10
11 QT_BEGIN_NAMESPACE
12 class QLabel;
13 class QLineEdit;
14 class QTableView;
15 class QAbstractItemModel;
16 class QModelIndex;
17 class QProgressBar;
18 QT_END_NAMESPACE
19
20 class BitcoinGUI : public QMainWindow
21 {
22     Q_OBJECT
23 public:
24     explicit BitcoinGUI(QWidget *parent = 0);
25     void setModel(ClientModel *model);
26     
27     /* Transaction table tab indices */
28     enum {
29         AllTransactions = 0,
30         SentReceived = 1,
31         Sent = 2,
32         Received = 3
33     } TabIndex;
34
35 protected:
36     void changeEvent(QEvent *e);
37     void closeEvent(QCloseEvent *event);
38
39 private:
40     ClientModel *model;
41
42     QLineEdit *address;
43     QLabel *labelBalance;
44     QLabel *labelConnections;
45     QLabel *labelConnectionsIcon;
46     QLabel *labelBlocks;
47     QLabel *labelTransactions;
48     QLabel *progressBarLabel;
49     QProgressBar *progressBar;
50
51     QAction *quit;
52     QAction *sendcoins;
53     QAction *addressbook;
54     QAction *about;
55     QAction *receivingAddresses;
56     QAction *options;
57     QAction *openBitcoin;
58
59     QSystemTrayIcon *trayIcon;
60     TransactionView *transactionView;
61
62     void createActions();
63     QWidget *createTabs();
64     void createTrayIcon();
65
66 public slots:
67     void setBalance(qint64 balance);
68     void setAddress(const QString &address);
69     void setNumConnections(int count);
70     void setNumBlocks(int count);
71     void setNumTransactions(int count);
72     void error(const QString &title, const QString &message);
73     /* It is currently not possible to pass a return value to another thread through
74        BlockingQueuedConnection, so use an indirected pointer.
75        http://bugreports.qt.nokia.com/browse/QTBUG-10440
76     */
77     void askFee(qint64 nFeeRequired, bool *payFee);
78
79 private slots:
80     void sendcoinsClicked();
81     void addressbookClicked();
82     void optionsClicked();
83     void receivingAddressesClicked();
84     void aboutClicked();
85     void newAddressClicked();
86     void copyClipboardClicked();
87     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
88     void transactionDetails(const QModelIndex& idx);
89     void incomingTransaction(const QModelIndex & parent, int start, int end);
90 };
91
92 #endif