Anoncoin  0.9.4
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1 // Copyright (c) 2011-2013 The Bitcoin developers
2 // Copyright (c) 2013-2014 The Anoncoin Core developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 
6 #ifndef TRANSACTIONFILTERPROXY_H
7 #define TRANSACTIONFILTERPROXY_H
8 
9 #include <QDateTime>
10 #include <QSortFilterProxyModel>
11 
13 class TransactionFilterProxy : public QSortFilterProxyModel
14 {
15  Q_OBJECT
16 
17 public:
18  explicit TransactionFilterProxy(QObject *parent = 0);
19 
21  static const QDateTime MIN_DATE;
23  static const QDateTime MAX_DATE;
25  static const quint32 ALL_TYPES = 0xFFFFFFFF;
26 
27  static quint32 TYPE(int type) { return 1<<type; }
28 
30  {
34  };
35 
36  void setDateRange(const QDateTime &from, const QDateTime &to);
37  void setAddressPrefix(const QString &addrPrefix);
41  void setTypeFilter(quint32 modes);
42  void setMinAmount(qint64 minimum);
44 
46  void setLimit(int limit);
47 
49  void setShowInactive(bool showInactive);
50 
51  int rowCount(const QModelIndex &parent = QModelIndex()) const;
52 
53 protected:
54  bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
55 
56 private:
57  QDateTime dateFrom;
58  QDateTime dateTo;
59  QString addrPrefix;
60  quint32 typeFilter;
62  qint64 minAmount;
63  int limitRows;
65 };
66 
67 #endif // TRANSACTIONFILTERPROXY_H
void setTypeFilter(quint32 modes)
TransactionFilterProxy(QObject *parent=0)
void setAddressPrefix(const QString &addrPrefix)
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)
void setDateRange(const QDateTime &from, const QDateTime &to)
void setMinAmount(qint64 minimum)
void setWatchOnlyFilter(WatchOnlyFilter filter)
void setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
void setShowInactive(bool showInactive)
Set whether to show conflicted transactions.
int rowCount(const QModelIndex &parent=QModelIndex()) const
Filter the transaction list according to pre-specified rules.
static const quint32 ALL_TYPES
Type filter bit field (all types)
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const