Fabcoin Core  0.16.2
P2P Digital Currency
tokenfilterproxy.h
Go to the documentation of this file.
1 #ifndef TOKENFILTERPROXY_H
2 #define TOKENFILTERPROXY_H
3 
4 #include <amount.h>
6 #include <QDateTime>
7 #include <QSortFilterProxyModel>
8 
9 #include <boost/multiprecision/cpp_int.hpp>
10 using namespace boost::multiprecision;
11 
12 class TokenFilterProxy : public QSortFilterProxyModel
13 {
14  Q_OBJECT
15 
16 public:
17  explicit TokenFilterProxy(QObject *parent = 0);
18 
20  static const QDateTime MIN_DATE;
22  static const QDateTime MAX_DATE;
24  static const quint32 ALL_TYPES = 0xFFFFFFFF;
25 
26  static quint32 TYPE(int type) { return 1<<type; }
27 
28  void setDateRange(const QDateTime &from, const QDateTime &to);
29  void setAddressPrefix(const QString &addrPrefix);
33  void setTypeFilter(quint32 modes);
34  void setMinAmount(const int256_t& minimum);
35  void setName(const QString _name);
36 
38  void setLimit(int limit);
39 
40  int rowCount(const QModelIndex &parent = QModelIndex()) const;
41 
42 protected:
43  bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
44  bool lessThan(const QModelIndex & left, const QModelIndex & right) const;
45 
46 private:
47  QDateTime dateFrom;
48  QDateTime dateTo;
49  QString addrPrefix;
50  QString name;
51  quint32 typeFilter;
52  int256_t minAmount;
53  int limitRows;
55 };
56 
57 #endif // TOKENFILTERPROXY_H
static quint32 TYPE(int type)
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)
PlatformStyle::TableColorType type
Definition: rpcconsole.cpp:61