1 // Copyright (c) 2011-2014 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
5 #ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H
6 #define BITCOIN_QT_TRANSACTIONFILTERPROXY_H
11 #include <QSortFilterProxyModel>
13 /** Filter the transaction list according to pre-specified rules. */
14 class TransactionFilterProxy
: public QSortFilterProxyModel
19 explicit TransactionFilterProxy(QObject
*parent
= 0);
21 /** Earliest date that can be represented (far in the past) */
22 static const QDateTime MIN_DATE
;
23 /** Last date that can be represented (far in the future) */
24 static const QDateTime MAX_DATE
;
25 /** Type filter bit field (all types) */
26 static const quint32 ALL_TYPES
= 0xFFFFFFFF;
28 static quint32
TYPE(int type
) { return 1<<type
; }
37 void setDateRange(const QDateTime
&from
, const QDateTime
&to
);
38 void setAddressPrefix(const QString
&addrPrefix
);
40 @note Type filter takes a bit field created with TYPE() or ALL_TYPES
42 void setTypeFilter(quint32 modes
);
43 void setMinAmount(const CAmount
& minimum
);
44 void setWatchOnlyFilter(WatchOnlyFilter filter
);
46 /** Set maximum number of rows returned, -1 if unlimited. */
47 void setLimit(int limit
);
49 /** Set whether to show conflicted transactions. */
50 void setShowInactive(bool showInactive
);
52 int rowCount(const QModelIndex
&parent
= QModelIndex()) const;
55 bool filterAcceptsRow(int source_row
, const QModelIndex
& source_parent
) const;
62 WatchOnlyFilter watchOnlyFilter
;
68 #endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H