dogecoin/src/qt/transactionfilterproxy.h

69 lines
2 KiB
C
Raw Normal View History

2014-01-05 21:03:23 +01:00
// Copyright (c) 2011-2014 The Bitcoin Core developers
2014-12-13 05:09:33 +01:00
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
2014-11-03 16:16:40 +01:00
#ifndef BITCOIN_QT_TRANSACTIONFILTERPROXY_H
#define BITCOIN_QT_TRANSACTIONFILTERPROXY_H
2014-04-23 00:46:19 +02:00
#include "amount.h"
#include <QDateTime>
#include <QSortFilterProxyModel>
2011-11-13 13:19:52 +01:00
/** Filter the transaction list according to pre-specified rules. */
class TransactionFilterProxy : public QSortFilterProxyModel
{
Q_OBJECT
public:
explicit TransactionFilterProxy(QObject *parent = 0);
2011-11-13 13:19:52 +01:00
/** Earliest date that can be represented (far in the past) */
static const QDateTime MIN_DATE;
2011-11-13 13:19:52 +01:00
/** Last date that can be represented (far in the future) */
static const QDateTime MAX_DATE;
2011-11-13 13:19:52 +01:00
/** Type filter bit field (all types) */
static const quint32 ALL_TYPES = 0xFFFFFFFF;
static quint32 TYPE(int type) { return 1<<type; }
enum WatchOnlyFilter
{
WatchOnlyFilter_All,
WatchOnlyFilter_Yes,
WatchOnlyFilter_No
};
void setDateRange(const QDateTime &from, const QDateTime &to);
void setAddressPrefix(const QString &addrPrefix);
2011-11-13 13:19:52 +01:00
/**
2012-07-26 02:48:39 +02:00
@note Type filter takes a bit field created with TYPE() or ALL_TYPES
2011-11-13 13:19:52 +01:00
*/
void setTypeFilter(quint32 modes);
2014-04-23 00:46:19 +02:00
void setMinAmount(const CAmount& minimum);
void setWatchOnlyFilter(WatchOnlyFilter filter);
2011-11-13 13:19:52 +01:00
/** Set maximum number of rows returned, -1 if unlimited. */
void setLimit(int limit);
/** Set whether to show conflicted transactions. */
void setShowInactive(bool showInactive);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;
private:
QDateTime dateFrom;
QDateTime dateTo;
QString addrPrefix;
quint32 typeFilter;
WatchOnlyFilter watchOnlyFilter;
2014-04-23 00:46:19 +02:00
CAmount minAmount;
int limitRows;
bool showInactive;
};
2014-11-03 16:16:40 +01:00
#endif // BITCOIN_QT_TRANSACTIONFILTERPROXY_H