aboutsummaryrefslogtreecommitdiff
path: root/src/model/SubaddressAccountModel.h
diff options
context:
space:
mode:
authorselsta <selsta@sent.at>2019-01-14 13:25:59 +0100
committerselsta <selsta@sent.at>2019-01-22 23:07:30 +0100
commitbd809abc52cc8d312c0023cfc9ae2d14e191d0b5 (patch)
tree0fa88add33f5c5aea7ebd492ce32f3a03ae07a40 /src/model/SubaddressAccountModel.h
parent9689fff957ba994b619a2a7fb881598a997f66c2 (diff)
downloadmonzero-gui-bd809abc52cc8d312c0023cfc9ae2d14e191d0b5.tar.gz
monzero-gui-bd809abc52cc8d312c0023cfc9ae2d14e191d0b5.tar.xz
monzero-gui-bd809abc52cc8d312c0023cfc9ae2d14e191d0b5.zip
add account support
Co-authored-by: kenshi84 <kenshi84@protonmail.ch>
Diffstat (limited to 'src/model/SubaddressAccountModel.h')
-rw-r--r--src/model/SubaddressAccountModel.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/model/SubaddressAccountModel.h b/src/model/SubaddressAccountModel.h
new file mode 100644
index 00000000..e78a3f84
--- /dev/null
+++ b/src/model/SubaddressAccountModel.h
@@ -0,0 +1,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