Bitcoin Core 28.99.0
P2P Digital Currency
transactionfilterproxy.h
Go to the documentation of this file.
1// Copyright (c) 2011-2021 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
16class TransactionFilterProxy : public QSortFilterProxyModel
17{
18 Q_OBJECT
19
20public:
21 explicit TransactionFilterProxy(QObject *parent = nullptr);
22
24 static const quint32 ALL_TYPES = 0xFFFFFFFF;
25
26 static quint32 TYPE(int type) { return 1<<type; }
27
29 {
33 };
34
36 void setDateRange(const std::optional<QDateTime>& from, const std::optional<QDateTime>& to);
37 void setSearchString(const QString &);
41 void setTypeFilter(quint32 modes);
42 void setMinAmount(const CAmount& minimum);
44
47
48protected:
49 bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const override;
50
51private:
52 std::optional<QDateTime> dateFrom;
53 std::optional<QDateTime> dateTo;
55 quint32 typeFilter;
58 bool showInactive{true};
59};
60
61#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H
int64_t CAmount
Amount in satoshis (Can be negative)
Definition: amount.h:12
Filter the transaction list according to pre-specified rules.
std::optional< QDateTime > dateFrom
void setMinAmount(const CAmount &minimum)
void setDateRange(const std::optional< QDateTime > &from, const std::optional< QDateTime > &to)
Filter transactions between date range.
std::optional< QDateTime > dateTo
void setWatchOnlyFilter(WatchOnlyFilter filter)
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 setTypeFilter(quint32 modes)
TransactionFilterProxy(QObject *parent=nullptr)