aboutsummaryrefslogtreecommitdiff
path: root/src/model/SubaddressAccountModel.h
blob: e78a3f84996e276eed2998f1bdc150d7c52ecbd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef SUBADDRESSACCOUNTMODEL_H
#define SUBADDRESSACCOUNTMODEL_H

#include <QAbstractListModel>

class SubaddressAccount;

class SubaddressAccountModel : public QAbstractListModel
{
    Q_OBJECT

public:
    enum SubaddressAccountRowRole {
        SubaddressAccountRole = Qt::UserRole + 1, // for the SubaddressAccountRow object;
        SubaddressAccountAddressRole,
        SubaddressAccountLabelRole,
        SubaddressAccountBalanceRole,
        SubaddressAccountUnlockedBalanceRole,
    };
    Q_ENUM(SubaddressAccountRowRole)

    SubaddressAccountModel(QObject *parent, SubaddressAccount *subaddressAccount);

    int rowCount(const QModelIndex &parent = QModelIndex()) const override;
    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
    QHash<int, QByteArray> roleNames() const  override;

public slots:
    void startReset();
    void endReset();

private:
    SubaddressAccount *m_subaddressAccount;
};

#endif // SUBADDRESSACCOUNTMODEL_H