monero-gui/src/libwalletqt/TransactionHistory.h

60 lines
1.6 KiB
C
Raw Normal View History

2016-06-08 10:53:24 +00:00
#ifndef TRANSACTIONHISTORY_H
#define TRANSACTIONHISTORY_H
#include <QObject>
#include <QList>
#include <QDateTime>
2016-06-08 10:53:24 +00:00
2016-12-13 18:51:07 +00:00
namespace Monero {
2016-06-08 10:53:24 +00:00
class TransactionHistory;
}
class TransactionInfo;
class TransactionHistory : public QObject
{
Q_OBJECT
Q_PROPERTY(int count READ count)
Q_PROPERTY(QDateTime firstDateTime READ firstDateTime NOTIFY firstDateTimeChanged)
Q_PROPERTY(QDateTime lastDateTime READ lastDateTime NOTIFY lastDateTimeChanged)
Q_PROPERTY(int minutesToUnlock READ minutesToUnlock)
Q_PROPERTY(bool locked READ locked)
2016-06-08 10:53:24 +00:00
public:
Q_INVOKABLE TransactionInfo *transaction(int index);
// Q_INVOKABLE TransactionInfo * transaction(const QString &id);
Q_INVOKABLE QList<TransactionInfo*> getAll(quint32 accountIndex) const;
Q_INVOKABLE void refresh(quint32 accountIndex);
Q_INVOKABLE QString writeCSV(quint32 accountIndex, QString out);
quint64 count() const;
QDateTime firstDateTime() const;
QDateTime lastDateTime() const;
quint64 minutesToUnlock() const;
bool locked() const;
2016-06-08 10:53:24 +00:00
signals:
void refreshStarted() const;
void refreshFinished() const;
void firstDateTimeChanged() const;
void lastDateTimeChanged() const;
2016-06-08 10:53:24 +00:00
public slots:
private:
2016-12-13 18:51:07 +00:00
explicit TransactionHistory(Monero::TransactionHistory * pimpl, QObject *parent = 0);
2016-06-08 10:53:24 +00:00
private:
friend class Wallet;
2016-12-13 18:51:07 +00:00
Monero::TransactionHistory * m_pimpl;
2016-06-08 10:53:24 +00:00
mutable QList<TransactionInfo*> m_tinfo;
mutable QDateTime m_firstDateTime;
mutable QDateTime m_lastDateTime;
mutable int m_minutesToUnlock;
// history contains locked transfers
mutable bool m_locked;
2016-06-08 10:53:24 +00:00
};
#endif // TRANSACTIONHISTORY_H