remove transparency effect and windows-specific code for now, it's not working as...
[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 class AddressBookPage;
13 class SendCoinsDialog;
14 class Notificator;
15
16 QT_BEGIN_NAMESPACE
17 class QLabel;
18 class QLineEdit;
19 class QTableView;
20 class QAbstractItemModel;
21 class QModelIndex;
22 class QProgressBar;
23 class QStackedWidget;
24 class QUrl;
25 QT_END_NAMESPACE
26
27 class BitcoinGUI : public QMainWindow
28 {
29     Q_OBJECT
30 public:
31     explicit BitcoinGUI(QWidget *parent = 0);
32     void setClientModel(ClientModel *clientModel);
33     void setWalletModel(WalletModel *walletModel);
34     
35     /* Transaction table tab indices */
36     enum {
37         AllTransactions = 0,
38         SentReceived = 1,
39         Sent = 2,
40         Received = 3
41     } TabIndex;
42
43 protected:
44     void changeEvent(QEvent *e);
45     void closeEvent(QCloseEvent *event);
46     void dragEnterEvent(QDragEnterEvent *event);
47     void dropEvent(QDropEvent *event);
48
49 private:
50     ClientModel *clientModel;
51     WalletModel *walletModel;
52
53     QStackedWidget *centralWidget;
54
55     OverviewPage *overviewPage;
56     QWidget *transactionsPage;
57     AddressBookPage *addressBookPage;
58     AddressBookPage *receiveCoinsPage;
59     SendCoinsDialog *sendCoinsPage;
60
61     QLabel *labelEncryptionIcon;
62     QLabel *labelConnectionsIcon;
63     QLabel *labelBlocksIcon;
64     QLabel *progressBarLabel;
65     QProgressBar *progressBar;
66
67     QAction *overviewAction;
68     QAction *historyAction;
69     QAction *quitAction;
70     QAction *sendCoinsAction;
71     QAction *addressBookAction;
72     QAction *aboutAction;
73     QAction *receiveCoinsAction;
74     QAction *optionsAction;
75     QAction *openBitcoinAction;
76     QAction *exportAction;
77     QAction *encryptWalletAction;
78     QAction *changePassphraseAction;
79
80     QSystemTrayIcon *trayIcon;
81     Notificator *notificator;
82     TransactionView *transactionView;
83
84     QMovie *syncIconMovie;
85
86     void createActions();
87     QWidget *createTabs();
88     void createTrayIcon();
89
90 public slots:
91     void setNumConnections(int count);
92     void setNumBlocks(int count);
93     void setEncryptionStatus(int status);
94
95     void error(const QString &title, const QString &message);
96     /* It is currently not possible to pass a return value to another thread through
97        BlockingQueuedConnection, so use an indirected pointer.
98        http://bugreports.qt.nokia.com/browse/QTBUG-10440
99     */
100     void askFee(qint64 nFeeRequired, bool *payFee);
101
102 private slots:
103     // UI pages
104     void gotoOverviewPage();
105     void gotoHistoryPage();
106     void gotoAddressBookPage();
107     void gotoReceiveCoinsPage();
108     void gotoSendCoinsPage();
109
110     // Misc actions
111     void optionsClicked();
112     void aboutClicked();
113     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
114     void incomingTransaction(const QModelIndex & parent, int start, int end);
115     void encryptWallet(bool status);
116     void changePassphrase();
117     void unlockWallet();
118 };
119
120 #endif