16 #include <QAbstractTableModel> 18 #include <QSslCertificate> 21 class test_RemoteDeviceModel;
29 friend class ::test_RemoteDeviceModel;
36 QDateTime mLastConnected;
37 QSharedPointer<RemoteDeviceListEntry> mRemoteDeviceListEntry;
40 RemoteDeviceModelEntry(
const QString& pDeviceNameEscaped,
const QString& mId, QSharedPointer<RemoteDeviceListEntry>& pRemoteDeviceListEntry);
41 RemoteDeviceModelEntry(
const QString& pDeviceNameEscaped,
const QString& mId,
bool pNetworkVisible,
bool pConnected,
bool pSupported,
const QDateTime& pLastConnected, QSharedPointer<RemoteDeviceListEntry>& pRemoteDeviceListEntry);
46 [[nodiscard]]
const QString&
getId()
const;
47 void setId(
const QString& pId);
62 :
public QAbstractTableModel
69 friend class ::test_RemoteDeviceModel;
71 const int NUMBER_OF_COLUMNS = 2;
73 QMap<QString, RemoteServiceSettings::RemoteInfo> mPairedReaders;
74 QVector<RemoteDeviceModelEntry> mAllRemoteReaders;
75 const bool mShowPairedReaders;
76 const bool mShowUnpairedReaders;
79 [[nodiscard]]
bool indexIsValid(
const QModelIndex& pIndex)
const;
81 void updatePairedReaders();
82 void updateUnpairedReaders();
83 void removeVanishedReaders();
84 [[nodiscard]] QVector<RemoteDeviceModelEntry> presentReaders()
const;
88 void onUpdateReaderList();
109 RemoteDeviceModel(QObject* pParent =
nullptr,
bool pShowPairedReaders =
true,
bool pShowUnpairedReaders =
true);
111 [[nodiscard]] QVariant
headerData(
int pSection, Qt::Orientation pOrientation,
int pRole)
const override;
112 [[nodiscard]]
int rowCount(
const QModelIndex& pParent = QModelIndex())
const override;
113 [[nodiscard]]
int columnCount(
const QModelIndex& pParent = QModelIndex())
const override;
114 [[nodiscard]] QVariant
data(
const QModelIndex& pIndex,
int pRole = Qt::DisplayRole)
const override;
115 [[nodiscard]] QHash<int, QByteArray>
roleNames()
const override;
117 [[nodiscard]]
const QSharedPointer<RemoteDeviceListEntry>
getRemoteDeviceListEntry(
const QModelIndex& pIndex)
const;
119 [[nodiscard]]
bool isPaired(
const QModelIndex& pIndex)
const;
120 [[nodiscard]]
bool isSupported(
const QModelIndex& pIndex)
const;
int columnCount(const QModelIndex &pParent=QModelIndex()) const override
Definition: RemoteDeviceModel.cpp:388
ColumnId
Definition: RemoteDeviceModel.h:103
int rowCount(const QModelIndex &pParent=QModelIndex()) const override
Definition: RemoteDeviceModel.cpp:382
void onKnownRemoteReadersChanged()
Definition: RemoteDeviceModel.cpp:520
Code
Definition: GlobalStatus.h:25
void onDeviceDisconnected(GlobalStatus::Code pCloseCode, const QString &pId)
Definition: RemoteDeviceModel.cpp:586
QVariant headerData(int pSection, Qt::Orientation pOrientation, int pRole) const override
Definition: RemoteDeviceModel.cpp:360
Definition: RemoteDeviceModel.h:106
Definition: RemoteDeviceModel.h:105
const QSharedPointer< RemoteDeviceListEntry > getRemoteDeviceListEntry() const
Definition: RemoteDeviceModel.cpp:61
int getLinkQuality() const
Definition: RemoteDeviceModel.cpp:103
const QDateTime & getLastConnected() const
Definition: RemoteDeviceModel.cpp:131
QHash< int, QByteArray > roleNames() const override
Definition: RemoteDeviceModel.cpp:175
void fireLanguageChanged()
Definition: RemoteDeviceModel.h:98
bool isSupported(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:483
void setNetworkVisible(bool pNetworkVisible)
Definition: RemoteDeviceModel.cpp:125
Definition: RemoteDeviceModel.h:100
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition: RemoteDeviceModel.cpp:394
Definition: RemoteDeviceModel.h:93
Definition: RemoteDeviceModel.h:61
Definition: RemoteDeviceModel.h:26
RemoteDeviceModel(QObject *pParent=nullptr, bool pShowPairedReaders=true, bool pShowUnpairedReaders=true)
Definition: RemoteDeviceModel.cpp:149
void forgetDevice(const QModelIndex &pIndex)
Definition: RemoteDeviceModel.cpp:553
Definition: RemoteDeviceModel.h:97
void setId(const QString &pId)
Definition: RemoteDeviceModel.cpp:91
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
Definition: RemoteDeviceModel.h:94
RemoteDeviceModelEntry(const QString &pDeviceNameEscaped, const QString &mId, QSharedPointer< RemoteDeviceListEntry > &pRemoteDeviceListEntry)
Definition: RemoteDeviceModel.cpp:19
bool isPaired(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:472
QString getDeviceNameEscaped() const
Definition: RemoteDeviceModel.cpp:67
void setLastConnected(const QDateTime &pLastConnected)
Definition: RemoteDeviceModel.cpp:137
bool operator==(const RemoteDeviceModelEntry &pOther) const
Definition: RemoteDeviceModel.cpp:143
const QString & getId() const
Definition: RemoteDeviceModel.cpp:85
void onUiShown()
Definition: RemoteDeviceModel.cpp:494
QString emptyListDescriptionString
Definition: RemoteDeviceModel.h:66
Definition: RemoteDeviceModel.h:95
QString getEmptyListDescriptionString() const
Definition: RemoteDeviceModel.cpp:575
const QSharedPointer< RemoteDeviceListEntry > getRemoteDeviceListEntry(const QModelIndex &pIndex) const
Definition: RemoteDeviceModel.cpp:447
bool isNetworkVisible() const
Definition: RemoteDeviceModel.cpp:97
Definition: RemoteDeviceModel.h:99
SettingsRemoteRoles
Definition: RemoteDeviceModel.h:91
void onUiHidden()
Definition: RemoteDeviceModel.cpp:507
Definition: RemoteDeviceModel.h:96
bool isSupported() const
Definition: RemoteDeviceModel.cpp:119
void setPaired(bool pPaired)
Definition: RemoteDeviceModel.cpp:79
bool isPaired() const
Definition: RemoteDeviceModel.cpp:73