11#include <QAbstractListModel>
14#include <QSharedPointer>
15#include <QSslCertificate>
18#include <QtQml/qqmlregistration.h>
21class test_RemoteDeviceModel;
22class test_RemoteDeviceFilterModel;
29 :
public QAbstractListModel
32 QML_UNCREATABLE(
"Used by RemoteServiceModel only")
35 friend class ::test_RemoteDeviceModel;
36 friend class ::test_RemoteDeviceFilterModel;
39 QMap<QByteArray, RemoteServiceSettings::RemoteInfo> mPairedReaders;
40 QList<RemoteDeviceModelEntry> mAllRemoteReaders;
43 bool mIsDetectingRemoteDevices;
45 bool mRemoteDetectionWasRunning;
48 [[nodiscard]]
bool indexIsValid(
const QModelIndex& pIndex)
const;
50 [[nodiscard]] QString getCurrentDeviceName(
const QModelIndex& pIndex)
const;
51 [[nodiscard]] QString constructDisplayDeviceName(
const QModelIndex& pIndex)
const;
52 void updatePairedReaders();
53 void updateUnpairedReaders();
54 void removeVanishedReaders();
55 [[nodiscard]]
virtual QList<RemoteDeviceModelEntry> presentReaders()
const;
60 void onApplicationStateChanged(
bool pIsAppInForeground);
62 void onApplicationStateChanged(
bool pIsAppInForeground)
const;
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:25
Definition RemoteDeviceModelEntry.h:22
Definition RemoteDeviceModel.h:30
RemoteDeviceModel(QObject *pParent=nullptr)
Definition RemoteDeviceModel.cpp:16
void forgetDevice(const QModelIndex &pIndex)
Definition RemoteDeviceModel.cpp:481
void onTranslationChanged()
Definition RemoteDeviceModel.cpp:475
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:365
bool isPaired(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:354
void onDeviceDisconnected(GlobalStatus::Code pCloseCode, const QString &pId)
Definition RemoteDeviceModel.cpp:511
int rowCount(const QModelIndex &pParent=QModelIndex()) const override
Definition RemoteDeviceModel.cpp:271
void setLastPairedReader(const QSslCertificate &pCert)
Definition RemoteDeviceModel.cpp:503
void onKnownRemoteReadersChanged()
Definition RemoteDeviceModel.cpp:418
void stopDetection(bool pStopScan)
Definition RemoteDeviceModel.cpp:401
void startDetection()
Definition RemoteDeviceModel.cpp:387
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition RemoteDeviceModel.cpp:277
bool isSupported(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:376
QSharedPointer< IfdListEntry > getRemoteDeviceListEntry(const QModelIndex &pIndex) const
Definition RemoteDeviceModel.cpp:329
Definition RemoteServiceSettings.h:36
Defines the AccessRight and AccessRole enum.
Definition CommandApdu.h:17