Feathercoin  0.5.0
P2P Digital Currency
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
transactionfilterproxy.h
Go to the documentation of this file.
1 #ifndef TRANSACTIONFILTERPROXY_H
2 #define TRANSACTIONFILTERPROXY_H
3 
4 #include <QSortFilterProxyModel>
5 #include <QDateTime>
6 
8 class TransactionFilterProxy : public QSortFilterProxyModel
9 {
10  Q_OBJECT
11 
12 public:
13  explicit TransactionFilterProxy(QObject *parent = 0);
14 
16  static const QDateTime MIN_DATE;
18  static const QDateTime MAX_DATE;
20  static const quint32 ALL_TYPES = 0xFFFFFFFF;
21 
22  static quint32 TYPE(int type) { return 1<<type; }
23 
24  void setDateRange(const QDateTime &from, const QDateTime &to);
25  void setAddressPrefix(const QString &addrPrefix);
29  void setTypeFilter(quint32 modes);
30  void setMinAmount(qint64 minimum);
31 
33  void setLimit(int limit);
34 
35  int rowCount(const QModelIndex &parent = QModelIndex()) const;
36 
37 protected:
38  bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
39 
40 private:
41  QDateTime dateFrom;
42  QDateTime dateTo;
43  QString addrPrefix;
44  quint32 typeFilter;
45  qint64 minAmount;
46  int limitRows;
47 };
48 
49 #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 setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
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