AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
SelfAuthenticationData.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "EnumHelper.h"
10 
11 #include <functional>
12 
13 #include <QCoreApplication>
14 #include <QDateTime>
15 #include <QDomElement>
16 #include <QMap>
17 #include <QPair>
18 #include <QSharedData>
19 #include <QString>
20 #include <QVector>
21 
22 namespace governikus
23 {
24 
25 defineEnumType(SelfAuthDataPermission,
26  UNKNOWN /* used for parser only */,
27  ALLOWED,
28  PROHIBITED,
29  NOTONCHIP)
30 
31 defineEnumType(SelfAuthData,
32  UNKNOWN, /* used for parser only */
36  GivenNames,
40  BirthName,
49  /* additional fields */
54  PlaceOfResidenceNoPlaceInfo)
55 
56 
58 {
59  public:
60  using OrderedSelfData = QVector<QPair<QString, QString> >;
61 
62  private:
63  class SelfData
64  : public QSharedData
65  {
66  Q_DECLARE_TR_FUNCTIONS(governikus::SelfData)
67 
68  private:
69  bool parse(const QDomDocument& pDoc, const QString& pElementName, const std::function<bool(const QDomElement&)>& pParserFunc);
70  bool parseOperationsAllowedByUser(const QDomElement& pElement);
71  bool parsePersonalData(const QDomElement& pElement);
72  bool tryToInsertChild(const QDomElement& pElement, SelfAuthData pAuthData);
73 
74  public:
75  bool mValid;
76  const QDateTime mDateTime;
77  QMap<SelfAuthData, SelfAuthDataPermission> mOperationsAllowed;
78  QMap<SelfAuthData, QString> mSelfAuthData;
79 
80  SelfData(const QByteArray& pData);
81  QString getValue(SelfAuthData pData) const;
82  OrderedSelfData getOrderedSelfInfo() const;
83  };
84 
85  QSharedDataPointer<SelfData> d;
86 
87  public:
88  SelfAuthenticationData(const QByteArray& pData = QByteArray());
89  ~SelfAuthenticationData() = default;
90 
94  bool isValid() const;
95  QString getValue(SelfAuthData pData) const;
96  const QDateTime& getDateTime() const;
97  OrderedSelfData getOrderedSelfData() const;
98 };
99 
100 } /* namespace governikus */
PlaceOfBirth
Definition: AccessRoleAndRight.h:77
PlaceVerification
Definition: SelfAuthenticationData.h:32
DateOfExpiry
Definition: SelfAuthenticationData.h:32
RestrictedID
Definition: SelfAuthenticationData.h:32
PlaceOfResidenceCity
Definition: SelfAuthenticationData.h:32
ArtisticName
Definition: AccessRoleAndRight.h:80
Nationality
Definition: AccessRoleAndRight.h:76
PlaceOfResidenceZipCode
Definition: SelfAuthenticationData.h:32
UNKNOWN
Definition: SelfAuthenticationData.h:32
QVector< QPair< QString, QString > > OrderedSelfData
Definition: SelfAuthenticationData.h:60
DateOfBirth
Definition: AccessRoleAndRight.h:78
AcademicTitle
Definition: SelfAuthenticationData.h:32
PlaceOfResidence
Definition: SelfAuthenticationData.h:32
DocumentType
Definition: AccessRoleAndRight.h:85
FamilyNames
Definition: SelfAuthenticationData.h:32
AgeVerification
Definition: AccessRoleAndRight.h:88
BirthName
Definition: AccessRoleAndRight.h:75
defineEnumType(UiModule, CURRENT, DEFAULT, IDENTIFY, SETTINGS, PINMANAGEMENT) defineEnumType(StatusFormat
UI modules that can be requested to show.
PlaceOfResidenceStreet
Definition: SelfAuthenticationData.h:32
Definition: SelfAuthenticationData.h:57
ResidencePermitI
Definition: AccessRoleAndRight.h:72
GivenNames
Definition: AccessRoleAndRight.h:82
PlaceOfResidenceCountry
Definition: SelfAuthenticationData.h:32
IssuingState
Definition: SelfAuthenticationData.h:32