AusweisApp2
Lade ...
Suche ...
Keine Treffer
SurveyModel.h
gehe zur Dokumentation dieser Datei
1
8#pragma once
9
10#include <QAbstractListModel>
11#include <QNetworkReply>
12#include <QObject>
13#include <QPair>
14#include <QString>
15
16class test_SurveyModel;
17
18namespace governikus
19{
20
22 : public QAbstractListModel
23{
24 Q_OBJECT
25 friend class Env;
26 friend class ::test_SurveyModel;
27
28 private:
29 const QString mBuildNumber;
30 const QString mAndroidVersion;
31 const QString mKernelVersion;
32 int mMaximumNfcPacketLength;
33 const QString mVendor;
34 const QString mModelNumber;
35 const QString mModelName;
36 const QString mAusweisAppVersionNumber;
37
38 QVector<QPair<QString, QString>> mData;
39 QSharedPointer<QNetworkReply> mReply;
40
41 enum UserRoles
42 {
43 TITLE = Qt::UserRole + 1,
44 VALUE
45 };
46
48 ~SurveyModel() override = default;
49
50 void buildDataObject();
51 [[nodiscard]] QByteArray toJsonByteArray() const;
52
53 private Q_SLOTS:
54 void onSslErrors(const QList<QSslError>& pErrors);
55 void onSslHandshakeDone();
56 void onNetworkReplyFinished();
57
58 public:
59 [[nodiscard]] int rowCount(const QModelIndex& = QModelIndex()) const override;
60 [[nodiscard]] QVariant data(const QModelIndex& pIndex, int pRole = Qt::DisplayRole) const override;
61 [[nodiscard]] QHash<int, QByteArray> roleNames() const override;
62
63 void setMaximumNfcPacketLength(int pMaximumNfcPacketLength);
64
65 void transmitSurvey();
66};
67
68} // namespace governikus
Definition: Env.h:44
Definition: SurveyModel.h:23
void transmitSurvey()
Definition: SurveyModel.cpp:143
void setMaximumNfcPacketLength(int pMaximumNfcPacketLength)
Definition: SurveyModel.cpp:136
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition: SurveyModel.cpp:67
int rowCount(const QModelIndex &=QModelIndex()) const override
Definition: SurveyModel.cpp:61
QHash< int, QByteArray > roleNames() const override
Definition: SurveyModel.cpp:85
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15