Bitcoin ABC  0.24.10
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 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_TRANSACTIONFILTERPROXY_H
6 #define BITCOIN_QT_TRANSACTIONFILTERPROXY_H
7 
8 #include <amount.h>
9 
10 #include <QDateTime>
11 #include <QSortFilterProxyModel>
12 
16 class TransactionFilterProxy : public QSortFilterProxyModel {
17  Q_OBJECT
18 
19 public:
20  explicit TransactionFilterProxy(QObject *parent = nullptr);
21 
25  static const QDateTime MIN_DATE;
29  static const QDateTime MAX_DATE;
33  static const quint32 ALL_TYPES = 0xFFFFFFFF;
34 
35  static quint32 TYPE(int type) { return 1 << type; }
36 
41  };
42 
43  void setDateRange(const QDateTime &from, const QDateTime &to);
44  void setSearchString(const QString &);
48  void setTypeFilter(quint32 modes);
49  void setMinAmount(const Amount minimum);
51 
55  void setLimit(int limit);
56 
60  void setShowInactive(bool showInactive);
61 
62  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
63 
64 protected:
65  bool filterAcceptsRow(int source_row,
66  const QModelIndex &source_parent) const override;
67 
68 private:
69  QDateTime dateFrom;
70  QDateTime dateTo;
71  QString m_search_string;
72  quint32 typeFilter;
75  int limitRows;
77 };
78 
79 #endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
TransactionFilterProxy::setSearchString
void setSearchString(const QString &)
Definition: transactionfilterproxy.cpp:80
TransactionFilterProxy::dateTo
QDateTime dateTo
Definition: transactionfilterproxy.h:70
TransactionFilterProxy::WatchOnlyFilter_All
@ WatchOnlyFilter_All
Definition: transactionfilterproxy.h:38
TransactionFilterProxy::WatchOnlyFilter_No
@ WatchOnlyFilter_No
Definition: transactionfilterproxy.h:40
TransactionFilterProxy::MIN_DATE
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past).
Definition: transactionfilterproxy.h:25
TransactionFilterProxy::filterAcceptsRow
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
Definition: transactionfilterproxy.cpp:24
TransactionFilterProxy::setShowInactive
void setShowInactive(bool showInactive)
Set whether to show conflicted transactions.
Definition: transactionfilterproxy.cpp:107
TransactionFilterProxy::showInactive
bool showInactive
Definition: transactionfilterproxy.h:76
TransactionFilterProxy::setMinAmount
void setMinAmount(const Amount minimum)
Definition: transactionfilterproxy.cpp:93
TransactionFilterProxy::setLimit
void setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
Definition: transactionfilterproxy.cpp:103
TransactionFilterProxy::TYPE
static quint32 TYPE(int type)
Definition: transactionfilterproxy.h:35
TransactionFilterProxy::limitRows
int limitRows
Definition: transactionfilterproxy.h:75
TransactionFilterProxy::typeFilter
quint32 typeFilter
Definition: transactionfilterproxy.h:72
TransactionFilterProxy::setTypeFilter
void setTypeFilter(quint32 modes)
Definition: transactionfilterproxy.cpp:88
TransactionFilterProxy::setWatchOnlyFilter
void setWatchOnlyFilter(WatchOnlyFilter filter)
Definition: transactionfilterproxy.cpp:98
TransactionFilterProxy::MAX_DATE
static const QDateTime MAX_DATE
Last date that can be represented (far in the future).
Definition: transactionfilterproxy.h:29
Amount
Definition: amount.h:19
TransactionFilterProxy::m_search_string
QString m_search_string
Definition: transactionfilterproxy.h:71
TransactionFilterProxy::setDateRange
void setDateRange(const QDateTime &from, const QDateTime &to)
Definition: transactionfilterproxy.cpp:73
TransactionFilterProxy::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const override
Definition: transactionfilterproxy.cpp:112
TransactionFilterProxy::WatchOnlyFilter_Yes
@ WatchOnlyFilter_Yes
Definition: transactionfilterproxy.h:39
TransactionFilterProxy::TransactionFilterProxy
TransactionFilterProxy(QObject *parent=nullptr)
Definition: transactionfilterproxy.cpp:18
TransactionFilterProxy::WatchOnlyFilter
WatchOnlyFilter
Definition: transactionfilterproxy.h:37
TransactionFilterProxy::minAmount
Amount minAmount
Definition: transactionfilterproxy.h:74
TransactionFilterProxy::watchOnlyFilter
WatchOnlyFilter watchOnlyFilter
Definition: transactionfilterproxy.h:73
amount.h
TransactionFilterProxy::ALL_TYPES
static const quint32 ALL_TYPES
Type filter bit field (all types).
Definition: transactionfilterproxy.h:33
TransactionFilterProxy::dateFrom
QDateTime dateFrom
Definition: transactionfilterproxy.h:69
TransactionFilterProxy
Filter the transaction list according to pre-specified rules.
Definition: transactionfilterproxy.h:16