1 #ifndef TRANSACTIONFILTERPROXY_H
2 #define TRANSACTIONFILTERPROXY_H
4 #include <QSortFilterProxyModel>
7 /** Filter the 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);
26 @note Type filter takes a bit field created with TYPE() or ALL_TYPES
28 void setTypeFilter(quint32 modes);
29 void setMinAmount(qint64 minimum);
31 /** Set maximum number of rows returned, -1 if unlimited. */
32 void setLimit(int limit);
34 int rowCount(const QModelIndex &parent = QModelIndex()) const;
36 bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
52 #endif // TRANSACTIONFILTERPROXY_H