15#include <QAbstractListModel>
18#include <QSharedPointer>
19#include <QSslCertificate>
22#include <QtQml/qqmlregistration.h>
25class test_RemoteDeviceModel;
26class test_RemoteDeviceFilterModel;
33 :
public QAbstractListModel
36 QML_UNCREATABLE(
"Used by RemoteServiceModel only")
39 friend class ::test_RemoteDeviceModel;
40 friend class ::test_RemoteDeviceFilterModel;
43 QMap<QString, RemoteServiceSettings::RemoteInfo> mPairedReaders;
44 QList<RemoteDeviceModelEntry> mAllRemoteReaders;
47 bool mIsDetectingRemoteDevices;
49 bool mRemoteDetectionWasRunning;
52 [[nodiscard]]
bool indexIsValid(
const QModelIndex& pIndex)
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;
63 void onApplicationStateChanged(
bool pIsAppInForeground);
64 void onUpdateReaderList();
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;
92 [[nodiscard]]
bool isPaired(
const QModelIndex& pIndex)
const;
93 [[nodiscard]]
bool isPairing(
const QModelIndex& pIndex)
const;
94 [[nodiscard]]
bool isSupported(
const QModelIndex& pIndex)
const;
Code
Definition GlobalStatus.h:30
Definition RemoteDeviceModelEntry.h:26
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