AusweisApp
Lade ...
Suche ...
Keine Treffer
RemoteDeviceModel.h
gehe zur Dokumentation dieser Datei
1
9#pragma once
10
11#include "GlobalStatus.h"
14
15#include <QAbstractListModel>
16#include <QList>
17#include <QMap>
18#include <QSharedPointer>
19#include <QSslCertificate>
20#include <QString>
21#include <QTimer>
22#include <QtQml/qqmlregistration.h>
23
24
25class test_RemoteDeviceModel;
26class test_RemoteDeviceFilterModel;
27
28
29namespace governikus
30{
31
33 : public QAbstractListModel
34{
36 QML_UNCREATABLE("Used by RemoteServiceModel only")
38
39 friend class ::test_RemoteDeviceModel;
40 friend class ::test_RemoteDeviceFilterModel;
41
42 private:
44 QList<RemoteDeviceModelEntry> mAllRemoteReaders;
45 RemoteServiceSettings::RemoteInfo mLastPairedDevice;
46 QTimer mTimer;
47 bool mIsDetectingRemoteDevices;
48#if defined(Q_OS_IOS)
50#endif
51
52 [[nodiscard]] bool indexIsValid(const QModelIndex& pIndex) const;
53 [[nodiscard]] QString getStatus(const RemoteDeviceModelEntry& pRemoteDeviceModelEntry) const;
54 [[nodiscard]] QString getCurrentDeviceName(const QModelIndex& pIndex) const;
55 [[nodiscard]] QString constructDisplayDeviceName(const QModelIndex& pIndex) const;
56 void updatePairedReaders();
57 void updateUnpairedReaders();
58 void removeVanishedReaders();
59 [[nodiscard]] virtual QList<RemoteDeviceModelEntry> presentReaders() const;
60 bool addOrUpdateReader(const RemoteDeviceModelEntry& pModelEntry);
61
62 private Q_SLOTS:
63 void onApplicationStateChanged(bool pIsAppInForeground);
64 void onUpdateReaderList();
65
66 public Q_SLOTS:
68
69 public:
83
84 explicit RemoteDeviceModel(QObject* pParent = nullptr);
85
86 [[nodiscard]] int rowCount(const QModelIndex& pParent = QModelIndex()) const override;
87 [[nodiscard]] QVariant data(const QModelIndex& pIndex, int pRole = Qt::DisplayRole) const override;
88 [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
89
92 [[nodiscard]] bool isPaired(const QModelIndex& pIndex) const;
93 [[nodiscard]] bool isPairing(const QModelIndex& pIndex) const;
94 [[nodiscard]] bool isSupported(const QModelIndex& pIndex) const;
95 void forgetDevice(const QModelIndex& pIndex);
96 void forgetDevice(const QString& pDeviceId);
98
99 public Q_SLOTS:
103
104 Q_SIGNALS:
106};
107
108
109} // namespace governikus
Code
Definition GlobalStatus.h:30
Definition RemoteDeviceModelEntry.h:26
Definition RemoteDeviceModel.h:34
RemoteDeviceModel(QObject *pParent=nullptr)
Definition RemoteDeviceModel.cpp:16
void forgetDevice(const QModelIndex &pIndex)
Definition RemoteDeviceModel.cpp:469
void onTranslationChanged()
Definition RemoteDeviceModel.cpp:463
SettingsRemoteRoles
Definition RemoteDeviceModel.h:71
@ IS_NETWORK_VISIBLE
Definition RemoteDeviceModel.h:76
@ LAST_CONNECTED
Definition RemoteDeviceModel.h:74
@ IS_SUPPORTED
Definition RemoteDeviceModel.h:77
@ DEVICE_ID
Definition RemoteDeviceModel.h:75
@ REMOTE_DEVICE_STATUS
Definition RemoteDeviceModel.h:73
@ IS_PAIRED
Definition RemoteDeviceModel.h:78
@ IS_PAIRING
Definition RemoteDeviceModel.h:79
@ LINK_QUALITY
Definition RemoteDeviceModel.h:80
@ IS_LAST_ADDED_DEVICE
Definition RemoteDeviceModel.h:81
@ REMOTE_DEVICE_NAME
Definition RemoteDeviceModel.h:72
QHash< int, QByteArray > roleNames() const override
Definition RemoteDeviceModel.cpp:41
bool isPairing(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:363
bool isPaired(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:352
void onDeviceDisconnected(GlobalStatus::Code pCloseCode, const QString &pId)
Definition RemoteDeviceModel.cpp:499
int rowCount(const QModelIndex &pParent=QModelIndex()) const override
Definition RemoteDeviceModel.cpp:269
void setLastPairedReader(const QSslCertificate &pCert)
Definition RemoteDeviceModel.cpp:491
void onKnownRemoteReadersChanged()
Definition RemoteDeviceModel.cpp:409
void setDetectRemoteDevices(bool pNewStatus)
Definition RemoteDeviceModel.cpp:385
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition RemoteDeviceModel.cpp:275
bool isSupported(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:374
QSharedPointer< IfdListEntry > getRemoteDeviceListEntry(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:327
Definition RemoteServiceSettings.h:40
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