1 #ifndef TRANSACTIONFILTERPROXY_H
2 #define TRANSACTIONFILTERPROXY_H
4 #include <QSortFilterProxyModel>
7 // Filter transaction list according to pre-specified rules
8 class TransactionFilterProxy : public QSortFilterProxyModel
12 explicit TransactionFilterProxy(QObject *parent = 0);
14 // Earliest date that can be represented (far in the past)
15 static const QDateTime MIN_DATE;
16 // Last date that can be represented (far in the future)
17 static const QDateTime MAX_DATE;
18 // Type filter bit field (all types)
19 static const quint32 ALL_TYPES = 0xFFFFFFFF;
21 static quint32 TYPE(int type) { return 1<<type; }
23 void setDateRange(const QDateTime &from, const QDateTime &to);
24 void setAddressPrefix(const QString &addrPrefix);
25 // Type filter takes a bitfield created with TYPE() or ALL_TYPES
26 void setTypeFilter(quint32 modes);
27 void setMinAmount(qint64 minimum);
29 // Set maximum number of rows returned, -1 if unlimited
30 void setLimit(int limit);
32 int rowCount(const QModelIndex &parent = QModelIndex()) const;
34 bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
50 #endif // TRANSACTIONFILTERPROXY_H