Stake miner status icon
[novacoin.git] / src / qt / transactionview.h
1 #ifndef TRANSACTIONVIEW_H
2 #define TRANSACTIONVIEW_H
3
4 #include <QWidget>
5
6 class WalletModel;
7 class TransactionFilterProxy;
8
9 QT_BEGIN_NAMESPACE
10 class QTableView;
11 class QComboBox;
12 class QLineEdit;
13 class QModelIndex;
14 class QMenu;
15 class QFrame;
16 class QDateTimeEdit;
17 QT_END_NAMESPACE
18
19 /** Widget showing the transaction list for a wallet, including a filter row.
20     Using the filter row, the user can view or export a subset of the transactions.
21   */
22 class TransactionView : public QWidget
23 {
24     Q_OBJECT
25 public:
26     explicit TransactionView(QWidget *parent = 0);
27
28     void setModel(WalletModel *model);
29
30     // Date ranges for filter
31     enum DateEnum
32     {
33         All,
34         Today,
35         ThisWeek,
36         ThisMonth,
37         LastMonth,
38         ThisYear,
39         Range
40     };
41
42 private:
43     WalletModel *model;
44     TransactionFilterProxy *transactionProxyModel;
45     QTableView *transactionView;
46
47     QComboBox *dateWidget;
48     QComboBox *typeWidget;
49     QLineEdit *addressWidget;
50     QLineEdit *amountWidget;
51
52     QMenu *contextMenu;
53
54     QFrame *dateRangeWidget;
55     QDateTimeEdit *dateFrom;
56     QDateTimeEdit *dateTo;
57
58     QWidget *createDateRangeWidget();
59
60 private slots:
61     void contextualMenu(const QPoint &);
62     void dateRangeChanged();
63     void showDetails();
64     void copyAddress();
65     void editLabel();
66     void copyLabel();
67     void copyAmount();
68     void copyTxID();
69
70 signals:
71     void doubleClicked(const QModelIndex&);
72
73 public slots:
74     void chooseDate(int idx);
75     void chooseType(int idx);
76     void changedPrefix(const QString &prefix);
77     void changedAmount(const QString &amount);
78     void exportClicked();
79     void focusTransaction(const QModelIndex&);
80
81 };
82
83 #endif // TRANSACTIONVIEW_H