AusweisApp
Lade ...
Suche ...
Keine Treffer
NotificationModel.h
gehe zur Dokumentation dieser Datei
1
5#pragma once
6
7#include "Env.h"
8#include "SingletonCreator.h"
9
10#include <QAbstractListModel>
11#include <QContiguousCache>
12#include <QHash>
13#include <QObject>
14#include <QString>
15#include <QVariant>
16#include <QtQml/qqmlregistration.h>
17
18class test_NotificationModel;
19
20namespace governikus
21{
22
24 : public QAbstractListModel
25 , public SingletonCreator<NotificationModel>
26{
30
31 friend class Env;
32 friend class ::test_NotificationModel;
33
35
36 private:
37 enum UserRoles
38 {
39 TYPE = Qt::UserRole + 1,
40 TIME,
41 TEXT
42 };
43
44 struct NotificationEntry
45 {
46 QString mType;
47 QString mTime;
48 QString mText;
49 };
50
51 QContiguousCache<NotificationEntry> mNotificationEntries;
52
53 NotificationModel();
54 ~NotificationModel() override = default;
55 QString getLastType() const;
56
57 private Q_SLOTS:
58 void onNewLogMsg(const QString& pMsg, const QString& pCategoryName);
59
60 public:
61 [[nodiscard]] int rowCount(const QModelIndex& pIndex) const override;
62 [[nodiscard]] QVariant data(const QModelIndex& pIndex, int pRole) const override;
63 [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
64
67};
68
69} // namespace governikus
#define TYPE(x)
Definition Env.h:42
Definition NotificationModel.h:26
QHash< int, QByteArray > roleNames() const override
Definition NotificationModel.cpp:83
QVariant data(const QModelIndex &pIndex, int pRole) const override
Definition NotificationModel.cpp:62
QString lastType
Definition NotificationModel.h:34
int rowCount(const QModelIndex &pIndex) const override
Definition NotificationModel.cpp:55
Definition SingletonCreator.h:22
Implementation of GeneralAuthenticate response APDUs.
Definition CommandApdu.h:17
QSharedPointer< T > decodeObject(const QByteArray &pData, bool pLogging=true)
Template function for decoding an OpenSSL type from DER encoded QByteArray.
Definition ASN1TemplateUtil.h:114