AusweisApp2
SurveyModel.h
gehe zur Dokumentation dieser Datei
1 
8 #pragma once
9 
10 #include <QAbstractListModel>
11 #include <QObject>
12 #include <QPair>
13 #include <QString>
14 
15 namespace governikus
16 {
18  : public QAbstractListModel
19 {
20  Q_OBJECT
21 
22  private:
23  const QString mBuildNumber;
24  const QString mAndroidVersion;
25  const QString mKernelVersion;
26  int mMaximumNfcPacketLength;
27  const QString mVendor;
28  const QString mModelNumber;
29  const QString mModelName;
30  const QString mAusweisAppVersionNumber;
31 
32  QVector<QPair<QString, QString>> mData;
33 
34  enum UserRoles
35  {
36  TITLE = Qt::UserRole + 1,
37  VALUE
38  };
39 
40 
41  void buildDataObject();
42  QByteArray toJsonByteArray() const;
43 
44  public:
45  explicit SurveyModel(QObject* pParent = nullptr);
46 
47  int rowCount(const QModelIndex& = QModelIndex()) const override;
48  QVariant data(const QModelIndex& pIndex, int pRole = Qt::DisplayRole) const override;
49  QHash<int, QByteArray> roleNames() const override;
50 
51  static SurveyModel& getInstance();
52 
53  void setMaximumNfcPacketLength(int pMaximumNfcPacketLength);
54 
55  void transmitSurvey() const;
56 };
57 
58 } // namespace governikus
governikus::SurveyModel::transmitSurvey
void transmitSurvey() const
Definition: SurveyModel.cpp:148
governikus::SurveyModel::roleNames
QHash< int, QByteArray > roleNames() const override
Definition: SurveyModel.cpp:90
VALUE_NAME
#define VALUE_NAME(_name, _key)
defineSingleton
defineSingleton(SurveyModel) namespace
Definition: SurveyModel.cpp:23
governikus::SurveyModel::getInstance
static SurveyModel & getInstance()
Definition: SurveyModel.cpp:60
governikus::DeviceInfo
Definition: DeviceInfo.h:16
governikus::SurveyModel::rowCount
int rowCount(const QModelIndex &=QModelIndex()) const override
Definition: SurveyModel.cpp:66
VENDOR
#define VENDOR
Definition: config.h:6
SecureStorage.h
governikus::SurveyModel
Definition: SurveyModel.h:19
NetworkManager.h
governikus::SurveyModel::SurveyModel
SurveyModel(QObject *pParent=nullptr)
Definition: SurveyModel.cpp:45
SurveyModel.h
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
DeviceInfo.h
Env.h
governikus::SurveyModel::data
QVariant data(const QModelIndex &pIndex, int pRole=Qt::DisplayRole) const override
Definition: SurveyModel.cpp:72
governikus::SurveyModel::setMaximumNfcPacketLength
void setMaximumNfcPacketLength(int pMaximumNfcPacketLength)
Definition: SurveyModel.cpp:141
SingletonHelper.h