18#include <QAbstractTableModel>
20#include <QSslCertificate>
23class test_RemoteDeviceModel;
24class test_RemoteDeviceFilterModel;
31 friend class ::test_RemoteDeviceModel;
41 QDateTime mLastConnected;
42 QSharedPointer<IfdListEntry> mRemoteDeviceListEntry;
52 const QDateTime& pLastConnected,
53 const QSharedPointer<IfdListEntry>& pRemoteDeviceListEntry);
60 [[nodiscard]]
const QString&
getId()
const;
61 void setId(
const QString& pId);
76 :
public QAbstractListModel
87 const
bool mShowPairedReaders;
88 const
bool mShowUnpairedReaders;
90 bool mIsDetectingRemoteDevices;
92 bool mRemoteDetectionWasRunning;
95 [[nodiscard]]
bool indexIsValid(
const QModelIndex& pIndex)
const;
97 void updatePairedReaders();
98 void updateUnpairedReaders();
99 void removeVanishedReaders();
100 [[nodiscard]] QVector<RemoteDeviceModelEntry> presentReaders()
const;
104 void onApplicationStateChanged(
bool pIsAppInForeground);
105 void onUpdateReaderList();
125 RemoteDeviceModel(QObject* pParent =
nullptr,
bool pShowPairedReaders =
true,
bool pShowUnpairedReaders =
true);
127 [[nodiscard]]
int rowCount(
const QModelIndex& pParent = QModelIndex())
const override;
128 [[nodiscard]] QVariant
data(
const QModelIndex& pIndex,
int pRole = Qt::DisplayRole)
const override;
129 [[nodiscard]] QHash<int, QByteArray>
roleNames()
const override;
133 [[nodiscard]]
bool isPaired(
const QModelIndex& pIndex)
const;
134 [[nodiscard]]
bool isPairing(
const QModelIndex& pIndex)
const;
135 [[nodiscard]]
bool isSupported(
const QModelIndex& pIndex)
const;
Code
Definition: GlobalStatus.h:28
Definition: RemoteDeviceModel.h:30
bool operator==(const RemoteDeviceModelEntry &pOther) const
Definition: RemoteDeviceModel.cpp:165
void setPaired(bool pPaired)
Definition: RemoteDeviceModel.cpp:89
bool isSupported() const
Definition: RemoteDeviceModel.cpp:141
void setLastConnected(const QDateTime &pLastConnected)
Definition: RemoteDeviceModel.cpp:159
const QSharedPointer< IfdListEntry > & getRemoteDeviceListEntry() const
Definition: RemoteDeviceModel.cpp:71
void setId(const QString &pId)
Definition: RemoteDeviceModel.cpp:113
void setNetworkVisible(bool pNetworkVisible)
Definition: RemoteDeviceModel.cpp:147
const QString & getId() const
Definition: RemoteDeviceModel.cpp:107
void setIsPairing(bool pIsPairing)
Definition: RemoteDeviceModel.cpp:101
QString getDeviceNameEscaped() const
Definition: RemoteDeviceModel.cpp:77
const QDateTime & getLastConnected() const
Definition: RemoteDeviceModel.cpp:153
bool isPaired() const
Definition: RemoteDeviceModel.cpp:83
bool isNetworkVisible() const
Definition: RemoteDeviceModel.cpp:119
int getLinkQuality() const
Definition: RemoteDeviceModel.cpp:125
bool isPairing() const
Definition: RemoteDeviceModel.cpp:95
Definition: RemoteDeviceModel.h:77
void forgetDevice(const QModelIndex &pIndex)
Definition: RemoteDeviceModel.cpp:599
QString getEmptyListDescriptionString() const
Definition: RemoteDeviceModel.cpp:621
void onTranslationChanged()
Definition: RemoteDeviceModel.cpp:593
SettingsRemoteRoles
Definition: RemoteDeviceModel.h:112
@ IS_NETWORK_VISIBLE
Definition: RemoteDeviceModel.h:117
@ LAST_CONNECTED
Definition: RemoteDeviceModel.h:115
@ IS_SUPPORTED
Definition: RemoteDeviceModel.h:118
@ DEVICE_ID
Definition: RemoteDeviceModel.h:116
@ REMOTE_DEVICE_STATUS
Definition: RemoteDeviceModel.h:114
@ IS_PAIRED
Definition: RemoteDeviceModel.h:119
@ IS_PAIRING
Definition: RemoteDeviceModel.h:120
@ LINK_QUALITY
Definition: RemoteDeviceModel.h:121
@ IS_LAST_ADDED_DEVICE
Definition: RemoteDeviceModel.h:122
@ REMOTE_DEVICE_NAME
Definition: RemoteDeviceModel.h:113
QHash< int, QByteArray > roleNames() const override
Definition: RemoteDeviceModel.cpp:198
bool isPairing(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:487
bool isPaired(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:476
friend class ::test_RemoteDeviceFilterModel
Definition: RemoteDeviceModel.h:81
void onDeviceDisconnected(GlobalStatus::Code pCloseCode, const QString &pId)
Definition: RemoteDeviceModel.cpp:640
int rowCount(const QModelIndex &pParent=QModelIndex()) const override
Definition: RemoteDeviceModel.cpp:393
void setLastPairedReader(const QSslCertificate &pCert)
Definition: RemoteDeviceModel.cpp:632
void onKnownRemoteReadersChanged()
Definition: RemoteDeviceModel.cpp:533
friend class ::test_RemoteDeviceModel
Definition: RemoteDeviceModel.h:80
void setDetectRemoteDevices(bool pNewStatus)
Definition: RemoteDeviceModel.cpp:509
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition: RemoteDeviceModel.cpp:399
bool isSupported(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:498
QSharedPointer< IfdListEntry > getRemoteDeviceListEntry(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:451
QString emptyListDescriptionString
Definition: RemoteDeviceModel.h:79
Definition: RemoteServiceSettings.h:31
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16