PIVX Core  5.6.99
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Copyright (c) 2017-2021 The PIVX 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 PIVX_QT_TRANSACTIONFILTERPROXY_H
7 #define PIVX_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;
29  static const quint32 COMMON_TYPES = 0x0005FFFF;
30 
31  static quint32 TYPE(int type) { return 1 << type; }
32 
37  };
38 
39  void setDateRange(const QDateTime& from, const QDateTime& to);
40  void clearDateRange() {
41  if (dateFrom != MIN_DATE || dateTo == MAX_DATE)
43  }
44 
48  void setTypeFilter(quint32 modes);
49  void setMinAmount(const CAmount& minimum);
51 
53  void setLimit(int limit);
54 
56  void setShowInactive(bool showInactive);
57 
59  void setHideOrphans(bool fHide);
60 
61  int rowCount(const QModelIndex& parent = QModelIndex()) const;
62  static bool isOrphan(const int status, const int type);
63 
64 protected:
65  bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
66 
67 private:
68  QDateTime dateFrom;
69  QDateTime dateTo;
70  quint32 typeFilter;
73  int limitRows;
75  bool fHideOrphans = true;
76 };
77 
78 #endif // PIVX_QT_TRANSACTIONFILTERPROXY_H
int64_t CAmount
Amount in PIV (Can be negative)
Definition: amount.h:13
Filter the transaction list according to pre-specified rules.
void setMinAmount(const CAmount &minimum)
static const quint32 COMMON_TYPES
Type filter bit field (all types but Obfuscation-SPAM ...
void setHideOrphans(bool fHide)
Set whether to hide orphan stakes.
void setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
static const QDateTime MAX_DATE
Last date that can be represented (far in the future)
void setWatchOnlyFilter(WatchOnlyFilter filter)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const
static const quint32 ALL_TYPES
Type filter bit field (all types)
int rowCount(const QModelIndex &parent=QModelIndex()) const
TransactionFilterProxy(QObject *parent=0)
static quint32 TYPE(int type)
static const QDateTime MIN_DATE
Earliest date that can be represented (far in the past)
void setShowInactive(bool showInactive)
Set whether to show conflicted transactions.
static bool isOrphan(const int status, const int type)
void setDateRange(const QDateTime &from, const QDateTime &to)
void setTypeFilter(quint32 modes)