Bitcoin ABC  0.24.10
P2P Digital Currency
transactionview.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_TRANSACTIONVIEW_H
6 #define BITCOIN_QT_TRANSACTIONVIEW_H
7 
8 #include <qt/guiutil.h>
9 #include <uint256.h>
10 
11 #include <QKeyEvent>
12 #include <QWidget>
13 
14 class PlatformStyle;
16 class WalletModel;
17 
18 QT_BEGIN_NAMESPACE
19 class QComboBox;
20 class QDateTimeEdit;
21 class QFrame;
22 class QLineEdit;
23 class QMenu;
24 class QModelIndex;
25 class QTableView;
26 QT_END_NAMESPACE
27 
33 class TransactionView : public QWidget {
34  Q_OBJECT
35 
36 public:
37  explicit TransactionView(const PlatformStyle *platformStyle,
38  QWidget *parent = nullptr);
39 
40  void setModel(WalletModel *model);
41 
42  // Date ranges for filter
43  enum DateEnum {
44  All,
51  };
52 
53  enum ColumnWidths {
60  };
61 
62 private:
63  WalletModel *model{nullptr};
65  QTableView *transactionView{nullptr};
66 
67  QComboBox *dateWidget;
68  QComboBox *typeWidget;
69  QComboBox *watchOnlyWidget;
70  QLineEdit *search_widget;
71  QLineEdit *amountWidget;
72 
73  QMenu *contextMenu;
74 
75  QFrame *dateRangeWidget;
76  QDateTimeEdit *dateFrom;
77  QDateTimeEdit *dateTo;
78  QAction *abandonAction{nullptr};
79  QAction *copyAddressAction{nullptr};
80  QAction *copyLabelAction{nullptr};
81 
82  QWidget *createDateRangeWidget();
83 
85 
86  virtual void resizeEvent(QResizeEvent *event) override;
87 
88  bool eventFilter(QObject *obj, QEvent *event) override;
89 
90 private Q_SLOTS:
91  void contextualMenu(const QPoint &);
92  void dateRangeChanged();
93  void showDetails();
94  void copyAddress();
95  void editLabel();
96  void copyLabel();
97  void copyAmount();
98  void copyTxID();
99  void copyTxHex();
100  void copyTxPlainText();
101  void openThirdPartyTxUrl(QString url);
102  void updateWatchOnlyColumn(bool fHaveWatchOnly);
103  void abandonTx();
104 
105 Q_SIGNALS:
106  void doubleClicked(const QModelIndex &);
107 
111  void message(const QString &title, const QString &message,
112  unsigned int style);
113 
114 public Q_SLOTS:
115  void chooseDate(int idx);
116  void chooseType(int idx);
117  void chooseWatchonly(int idx);
118  void changedAmount();
119  void changedSearch();
120  void exportClicked();
121  void focusTransaction(const QModelIndex &);
122  void focusTransaction(const uint256 &txid);
123 };
124 
125 #endif // BITCOIN_QT_TRANSACTIONVIEW_H
TransactionView
Widget showing the transaction list for a wallet, including a filter row.
Definition: transactionview.h:33
TransactionView::TYPE_COLUMN_WIDTH
@ TYPE_COLUMN_WIDTH
Definition: transactionview.h:57
TransactionView::createDateRangeWidget
QWidget * createDateRangeWidget()
Definition: transactionview.cpp:594
TransactionView::search_widget
QLineEdit * search_widget
Definition: transactionview.h:70
TransactionView::editLabel
void editLabel()
Definition: transactionview.cpp:519
WalletModel
Interface to Bitcoin wallet from Qt view code.
Definition: walletmodel.h:47
TransactionView::openThirdPartyTxUrl
void openThirdPartyTxUrl(QString url)
Definition: transactionview.cpp:579
TransactionView::abandonAction
QAction * abandonAction
Definition: transactionview.h:78
TransactionView::DateEnum
DateEnum
Definition: transactionview.h:43
TransactionView::ThisYear
@ ThisYear
Definition: transactionview.h:49
TransactionView::focusTransaction
void focusTransaction(const QModelIndex &)
Definition: transactionview.cpp:647
TransactionView::ColumnWidths
ColumnWidths
Definition: transactionview.h:53
uint256.h
GUIUtil::TableViewLastColumnResizingFixer
Makes a QTableView last column feel as if it was being resized from its left border.
Definition: guiutil.h:224
TransactionView::ThisMonth
@ ThisMonth
Definition: transactionview.h:47
TransactionView::LastMonth
@ LastMonth
Definition: transactionview.h:48
TransactionView::STATUS_COLUMN_WIDTH
@ STATUS_COLUMN_WIDTH
Definition: transactionview.h:54
TransactionView::chooseWatchonly
void chooseWatchonly(int idx)
Definition: transactionview.cpp:362
TransactionView::transactionView
QTableView * transactionView
Definition: transactionview.h:65
TransactionView::copyTxID
void copyTxID()
Definition: transactionview.cpp:505
TransactionView::dateTo
QDateTimeEdit * dateTo
Definition: transactionview.h:77
url
const char * url
Definition: rpcconsole.cpp:52
TransactionView::showDetails
void showDetails()
Definition: transactionview.cpp:565
TransactionView::changedSearch
void changedSearch()
Definition: transactionview.cpp:372
TransactionView::changedAmount
void changedAmount()
Definition: transactionview.cpp:380
guiutil.h
TransactionView::DATE_COLUMN_WIDTH
@ DATE_COLUMN_WIDTH
Definition: transactionview.h:56
TransactionView::eventFilter
bool eventFilter(QObject *obj, QEvent *event) override
Definition: transactionview.cpp:697
TransactionView::copyAmount
void copyAmount()
Definition: transactionview.cpp:500
TransactionView::message
void message(const QString &title, const QString &message, unsigned int style)
Fired when a message should be reported to the user.
TransactionView::All
@ All
Definition: transactionview.h:44
uint256
256-bit opaque blob.
Definition: uint256.h:127
TransactionView::transactionProxyModel
TransactionFilterProxy * transactionProxyModel
Definition: transactionview.h:64
TransactionView::dateRangeChanged
void dateRangeChanged()
Definition: transactionview.cpp:631
TransactionView::copyLabel
void copyLabel()
Definition: transactionview.cpp:495
TransactionView::watchOnlyWidget
QComboBox * watchOnlyWidget
Definition: transactionview.h:69
TransactionView::WATCHONLY_COLUMN_WIDTH
@ WATCHONLY_COLUMN_WIDTH
Definition: transactionview.h:55
TransactionView::updateWatchOnlyColumn
void updateWatchOnlyColumn(bool fHaveWatchOnly)
Definition: transactionview.cpp:711
TransactionView::MINIMUM_COLUMN_WIDTH
@ MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:59
TransactionView::ThisWeek
@ ThisWeek
Definition: transactionview.h:46
TransactionView::contextMenu
QMenu * contextMenu
Definition: transactionview.h:73
TransactionView::resizeEvent
virtual void resizeEvent(QResizeEvent *event) override
Definition: transactionview.cpp:690
TransactionView::copyLabelAction
QAction * copyLabelAction
Definition: transactionview.h:80
TransactionView::copyTxHex
void copyTxHex()
Definition: transactionview.cpp:509
TransactionView::chooseDate
void chooseDate(int idx)
Definition: transactionview.cpp:297
TransactionView::setModel
void setModel(WalletModel *model)
Definition: transactionview.cpp:231
TransactionView::copyAddress
void copyAddress()
Definition: transactionview.cpp:490
TransactionView::amountWidget
QLineEdit * amountWidget
Definition: transactionview.h:71
TransactionView::typeWidget
QComboBox * typeWidget
Definition: transactionview.h:68
TransactionView::abandonTx
void abandonTx()
Definition: transactionview.cpp:467
TransactionView::copyAddressAction
QAction * copyAddressAction
Definition: transactionview.h:79
TransactionView::contextualMenu
void contextualMenu(const QPoint &)
Definition: transactionview.cpp:440
TransactionView::dateRangeWidget
QFrame * dateRangeWidget
Definition: transactionview.h:75
TransactionView::AMOUNT_MINIMUM_COLUMN_WIDTH
@ AMOUNT_MINIMUM_COLUMN_WIDTH
Definition: transactionview.h:58
TransactionView::chooseType
void chooseType(int idx)
Definition: transactionview.cpp:354
TransactionView::columnResizingFixer
GUIUtil::TableViewLastColumnResizingFixer * columnResizingFixer
Definition: transactionview.h:84
TransactionView::TransactionView
TransactionView(const PlatformStyle *platformStyle, QWidget *parent=nullptr)
Definition: transactionview.cpp:37
TransactionView::doubleClicked
void doubleClicked(const QModelIndex &)
PlatformStyle
Definition: platformstyle.h:13
TransactionView::copyTxPlainText
void copyTxPlainText()
Definition: transactionview.cpp:514
TransactionView::model
WalletModel * model
Definition: transactionview.h:63
TransactionView::exportClicked
void exportClicked()
Definition: transactionview.cpp:394
TransactionView::dateWidget
QComboBox * dateWidget
Definition: transactionview.h:67
TransactionView::dateFrom
QDateTimeEdit * dateFrom
Definition: transactionview.h:76
TransactionView::Today
@ Today
Definition: transactionview.h:45
TransactionView::Range
@ Range
Definition: transactionview.h:50
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:16