mirror of
https://github.com/wownero/wowlet.git
synced 2026-10-17 15:21:30 +02:00
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
// SPDX-License-Identifier: BSD-3-Clause
|
|
// SPDX-FileCopyrightText: 2020-2023 The Monero Project
|
|
|
|
#ifndef SUBADDRESSACCOUNTMODEL_H
|
|
#define SUBADDRESSACCOUNTMODEL_H
|
|
|
|
#include "Subaddress.h"
|
|
#include <QAbstractTableModel>
|
|
#include <QSortFilterProxyModel>
|
|
|
|
#include "rows/AccountRow.h"
|
|
|
|
class SubaddressAccount;
|
|
|
|
class SubaddressAccountModel : public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
enum Column {
|
|
Number,
|
|
Address,
|
|
Label,
|
|
Balance,
|
|
UnlockedBalance,
|
|
COUNT
|
|
};
|
|
|
|
SubaddressAccountModel(QObject *parent, SubaddressAccount *subaddressAccount);
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
|
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
|
|
|
AccountRow* entryFromIndex(const QModelIndex &index) const;
|
|
|
|
public slots:
|
|
void startReset();
|
|
void endReset();
|
|
|
|
private:
|
|
QVariant parseSubaddressAccountRow(const AccountRow &row, const QModelIndex &index, int role) const;
|
|
|
|
SubaddressAccount *m_subaddressAccount;
|
|
};
|
|
|
|
class SubaddressAccountProxyModel : public QSortFilterProxyModel
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SubaddressAccountProxyModel(QObject *parent = nullptr);
|
|
};
|
|
|
|
#endif // SUBADDRESSACCOUNTMODEL_H
|