Use standard C99 (and Qt) types for 64-bit integers
[novacoin.git] / src / qt / transactionfilterproxy.h
1 #ifndef TRANSACTIONFILTERPROXY_H
2 #define TRANSACTIONFILTERPROXY_H
3
4 #include <QtGlobal>
5 #include <QSortFilterProxyModel>
6 #include <QDateTime>
7
8 /** Filter the transaction list according to pre-specified rules. */
9 class TransactionFilterProxy : public QSortFilterProxyModel
10 {
11     Q_OBJECT
12 public:
13     explicit TransactionFilterProxy(QObject *parent = 0);
14
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;
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);
26     /**
27       @note Type filter takes a bitfield created with TYPE() or ALL_TYPES
28      */
29     void setTypeFilter(quint32 modes);
30     void setMinAmount(qint64 minimum);
31
32     /** Set maximum number of rows returned, -1 if unlimited. */
33     void setLimit(int limit);
34
35     int rowCount(const QModelIndex &parent = QModelIndex()) const;
36 protected:
37     bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
38
39 private:
40     QDateTime dateFrom;
41     QDateTime dateTo;
42     QString addrPrefix;
43     quint32 typeFilter;
44     qint64 minAmount;
45     int limitRows;
46
47 signals:
48
49 public slots:
50
51 };
52
53 #endif // TRANSACTIONFILTERPROXY_H