Bitcoin ABC 0.32.4
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
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.
4
5#ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H
6#define BITCOIN_QT_TRANSACTIONFILTERPROXY_H
7
8#include <consensus/amount.h>
9
10#include <QDateTime>
11#include <QSortFilterProxyModel>
12
13#include <optional>
14
18class TransactionFilterProxy : public QSortFilterProxyModel {
19 Q_OBJECT
20
21public:
22 explicit TransactionFilterProxy(QObject *parent = nullptr);
23
27 static const quint32 ALL_TYPES = 0xFFFFFFFF;
28
29 static quint32 TYPE(int type) { return 1 << type; }
30
35 };
36
40 void setDateRange(const std::optional<QDateTime> &from,
41 const std::optional<QDateTime> &to);
42 void setSearchString(const QString &);
46 void setTypeFilter(quint32 modes);
47 void setMinAmount(const Amount minimum);
49
53 void setLimit(int limit);
54
59
60 int rowCount(const QModelIndex &parent = QModelIndex()) const override;
61
62protected:
63 bool filterAcceptsRow(int source_row,
64 const QModelIndex &source_parent) const override;
65
66private:
67 std::optional<QDateTime> dateFrom;
68 std::optional<QDateTime> dateTo;
70 quint32 typeFilter;
75};
76
77#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
Filter the transaction list according to pre-specified rules.
std::optional< QDateTime > dateFrom
void setDateRange(const std::optional< QDateTime > &from, const std::optional< QDateTime > &to)
Filter transactions between date range.
void setLimit(int limit)
Set maximum number of rows returned, -1 if unlimited.
std::optional< QDateTime > dateTo
void setWatchOnlyFilter(WatchOnlyFilter filter)
int rowCount(const QModelIndex &parent=QModelIndex()) const override
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override
static const quint32 ALL_TYPES
Type filter bit field (all types).
static quint32 TYPE(int type)
void setShowInactive(bool showInactive)
Set whether to show conflicted transactions.
void setSearchString(const QString &)
void setMinAmount(const Amount minimum)
void setTypeFilter(quint32 modes)
TransactionFilterProxy(QObject *parent=nullptr)
Definition: amount.h:19