AusweisApp2
Lade ...
Suche ...
Keine Treffer
ReaderModel.h
gehe zur Dokumentation dieser Datei
9#pragma once
10
12#include "SortedReaderModel.h"
13
14#include <QAbstractTableModel>
15#include <QHash>
16#include <QSet>
17#include <QTime>
18#include <QVector>
19
20
21namespace governikus
22{
23
25 : public QAbstractListModel
26{
27 Q_OBJECT
28
31 Q_PROPERTY(SortedReaderModel * sortedModel READ getSortedModel CONSTANT)
32
33 private:
34 QSet<const ReaderConfigurationInfo> mKnownDrivers;
35 QVector<ReaderConfigurationInfo> mConnectedReaders;
36 QTime mConnectedReadersUpdateTime;
37 SortedReaderModel mSortedModel;
38
39 [[nodiscard]] QString getStatus(const ReaderConfigurationInfo& pReaderConfigurationInfo) const;
40 void collectReaderData();
41
42 [[nodiscard]] bool indexIsValid(const QModelIndex& pIndex) const;
43
44 [[nodiscard]] QUrl getReaderImageUrl(const QModelIndex& pIndex) const;
45
46 public:
48 {
49 READER_NAME = Qt::UserRole + 1,
56 };
57 explicit ReaderModel(QObject* pParent = nullptr);
58
59 [[nodiscard]] int rowCount(const QModelIndex& pParent = QModelIndex()) const override;
60 [[nodiscard]] QVariant data(const QModelIndex& pIndex, int pRole = Qt::DisplayRole) const override;
61 [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
62
63 [[nodiscard]] QString getHTMLDescription(const QModelIndex& pIndex) const;
64 [[nodiscard]] QString getEmptyListDescriptionString() const;
65 [[nodiscard]] bool isSupportedReader(const QModelIndex& pIndex) const;
66 [[nodiscard]] bool isInstalledReader(const QModelIndex& pIndex) const;
67 [[nodiscard]] QString getLastUpdatedInformation() const;
68
69 [[nodiscard]] SortedReaderModel* getSortedModel();
70
71 private Q_SLOTS:
72 void onUpdateContent();
73
74 public Q_SLOTS:
76
77 Q_SIGNALS:
79};
80
81
82} // namespace governikus
Definition: ReaderConfigurationInfo.h:21
Definition: ReaderModel.h:26
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition: ReaderModel.cpp:121
QString getLastUpdatedInformation() const
Definition: ReaderModel.cpp:251
QString getHTMLDescription(const QModelIndex &pIndex) const
Definition: ReaderModel.cpp:173
QString lastUpdatedInformation
Definition: ReaderModel.h:30
int rowCount(const QModelIndex &pParent=QModelIndex()) const override
Definition: ReaderModel.cpp:115
QString emptyListDescriptionString
Definition: ReaderModel.h:29
bool isInstalledReader(const QModelIndex &pIndex) const
Definition: ReaderModel.cpp:239
bool isSupportedReader(const QModelIndex &pIndex) const
Definition: ReaderModel.cpp:227
UserRoles
Definition: ReaderModel.h:48
@ READER_NAME
Definition: ReaderModel.h:49
@ READER_STATUS
Definition: ReaderModel.h:50
@ READER_HTML_DESCRIPTION
Definition: ReaderModel.h:52
@ READER_SUPPORTED
Definition: ReaderModel.h:55
@ READER_IMAGE_PATH
Definition: ReaderModel.h:51
@ READER_DRIVER_URL
Definition: ReaderModel.h:53
@ READER_INSTALLED
Definition: ReaderModel.h:54
SortedReaderModel * getSortedModel()
Definition: ReaderModel.cpp:264
QHash< int, QByteArray > roleNames() const override
Definition: ReaderModel.cpp:155
QString getEmptyListDescriptionString() const
Definition: ReaderModel.cpp:216
SortedReaderModel * sortedModel
Definition: ReaderModel.h:31
void onTranslationChanged()
Definition: ReaderModel.cpp:109
Definition: SortedReaderModel.h:14
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16