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