Bitcoin Core  0.18.99
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2018 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 
14 class TransactionFilterProxy : public QSortFilterProxyModel
15 {
16  Q_OBJECT
17 
18 public:
19  explicit TransactionFilterProxy(QObject *parent = nullptr);
20 
22  static const QDateTime MIN_DATE;
24  static const QDateTime MAX_DATE;
26  static const quint32 ALL_TYPES = 0xFFFFFFFF;
27 
28  static quint32 TYPE(int type) { return 1<<type; }
29 
31  {
35  };
36 
37  void setDateRange(const QDateTime &from, const QDateTime &to);
38  void setSearchString(const QString &);
42  void setTypeFilter(quint32 modes);
43  void setMinAmount(const CAmount& minimum);
45 
47  void setLimit(int limit);
48 
50  void setShowInactive(bool showInactive);
51 
52  int rowCount(const QModelIndex &parent = QModelIndex()) const;
53 
54 protected:
55  bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
56 
57 private:
58  QDateTime dateFrom;
59  QDateTime dateTo;
60  QString m_search_string;
61  quint32 typeFilter;
64  int limitRows;
66 };
67 
68 #endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
void setTypeFilter(quint32 modes)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
int rowCount(const QModelIndex &parent=QModelIndex()) const
static quint32 TYPE(int type)
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past)
static const QDateTime MAX_DATE
Last date that can be represented (far in the future)
void setDateRange(const QDateTime &from, const QDateTime &to)
TransactionFilterProxy(QObject *parent=nullptr)
void setWatchOnlyFilter(WatchOnlyFilter filter)
void setMinAmount(const CAmount &minimum)
void setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
void setShowInactive(bool showInactive)
Set whether to show conflicted transactions.
Filter the transaction list according to pre-specified rules.
static const quint32 ALL_TYPES
Type filter bit field (all types)
void setSearchString(const QString &)