Raven Core  3.0.0
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2014 The Bitcoin Core developers
2 // Copyright (c) 2017-2019 The Raven Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef RAVEN_QT_TRANSACTIONFILTERPROXY_H
7 #define RAVEN_QT_TRANSACTIONFILTERPROXY_H
8 
9 #include "amount.h"
10 
11 #include <QDateTime>
12 #include <QSortFilterProxyModel>
13 
15 class TransactionFilterProxy : public QSortFilterProxyModel
16 {
17  Q_OBJECT
18 
19 public:
20  explicit TransactionFilterProxy(QObject *parent = 0);
21 
23  static const QDateTime MIN_DATE;
25  static const QDateTime MAX_DATE;
27  static const quint32 ALL_TYPES = 0xFFFFFFFF;
28 
29  static quint32 TYPE(int type) { return 1<<type; }
30 
32  {
36  };
37 
38  void setDateRange(const QDateTime &from, const QDateTime &to);
39  void setAddressPrefix(const QString &addrPrefix);
40  void setAssetNamePrefix(const QString &assetNamePrefix);
44  void setTypeFilter(quint32 modes);
45  void setMinAmount(const CAmount& minimum);
47 
49  void setLimit(int limit);
50 
52  void setShowInactive(bool showInactive);
53 
54  int rowCount(const QModelIndex &parent = QModelIndex()) const;
55 
56 protected:
57  bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
58 
59 private:
60  QDateTime dateFrom;
61  QDateTime dateTo;
62  QString addrPrefix;
63  QString assetNamePrefix;
64  quint32 typeFilter;
67  int limitRows;
69 };
70 #endif // RAVEN_QT_TRANSACTIONFILTERPROXY_H
void setTypeFilter(quint32 modes)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
int rowCount(const QModelIndex &parent=QModelIndex()) const
TransactionFilterProxy(QObject *parent=0)
void setAddressPrefix(const QString &addrPrefix)
static quint32 TYPE(int type)
int64_t CAmount
Amount in corbies (Can be negative)
Definition: amount.h:13
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)
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.
void setAssetNamePrefix(const QString &assetNamePrefix)
Filter the transaction list according to pre-specified rules.
static const quint32 ALL_TYPES
Type filter bit field (all types)