AusweisApp2
AuthModel.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "Env.h"
10 #include "WorkflowModel.h"
11 #include "context/AuthContext.h"
12 
13 #include <QObject>
14 #include <QQmlEngine>
15 #include <QSharedPointer>
16 #include <QString>
17 
18 namespace governikus
19 {
20 
21 class AuthModel
22  : public WorkflowModel
23 {
24  Q_OBJECT
25  friend class Env;
26 
27  Q_PROPERTY(QString transactionInfo READ getTransactionInfo NOTIFY fireTransactionInfoChanged)
28  Q_PROPERTY(int progressValue READ getProgressValue NOTIFY fireProgressChanged)
29  Q_PROPERTY(QString progressMessage READ getProgressMessage NOTIFY fireProgressChanged)
31  Q_PROPERTY(QString errorHeader READ getErrorHeader NOTIFY fireResultChanged)
32  Q_PROPERTY(QString errorText READ getErrorText NOTIFY fireResultChanged)
33  Q_PROPERTY(QString statusCodeString READ getStatusCodeString NOTIFY fireResultChanged)
34 
35  private:
36  QSharedPointer<AuthContext> mContext;
37  QString mTransactionInfo;
38 
39  protected:
40  AuthModel();
41  ~AuthModel() override = default;
42 
43  public:
44  void resetAuthContext(const QSharedPointer<AuthContext>& pContext = QSharedPointer<AuthContext>());
45 
46  [[nodiscard]] const QString& getTransactionInfo() const;
47  [[nodiscard]] int getProgressValue() const;
48  [[nodiscard]] QString getProgressMessage() const;
49  [[nodiscard]] bool getShowChangePinView() const;
50  [[nodiscard]] QString getErrorHeader() const;
51  [[nodiscard]] QString getErrorText() const;
52  [[nodiscard]] QString getStatusCodeString() const;
53 
54  Q_INVOKABLE void cancelWorkflowToChangePin();
55  Q_INVOKABLE void requestTransportPinChange();
56 
57  private Q_SLOTS:
58  void onDidAuthenticateEac1Changed();
59 
60  Q_SIGNALS:
64 };
65 
66 
67 } // namespace governikus
Definition: AuthModel.h:23
int progressValue
Definition: AuthModel.h:28
void fireShowChangePinViewChanged()
void fireTransactionInfoChanged()
Q_INVOKABLE void cancelWorkflowToChangePin()
Definition: AuthModel.cpp:117
QString errorText
Definition: AuthModel.h:32
QString getProgressMessage() const
Definition: AuthModel.cpp:58
const QString & getTransactionInfo() const
Definition: AuthModel.cpp:41
QString getStatusCodeString() const
Definition: AuthModel.cpp:111
int getProgressValue() const
Definition: AuthModel.cpp:47
void resetAuthContext(const QSharedPointer< AuthContext > &pContext=QSharedPointer< AuthContext >())
Definition: AuthModel.cpp:17
QString getErrorHeader() const
Definition: AuthModel.cpp:80
QString errorHeader
Definition: AuthModel.h:31
~AuthModel() override=default
QString statusCodeString
Definition: AuthModel.h:33
bool showChangePinView
Definition: AuthModel.h:30
Q_INVOKABLE void requestTransportPinChange()
Definition: AuthModel.cpp:128
AuthModel()
Definition: AuthModel.cpp:9
bool getShowChangePinView() const
Definition: AuthModel.cpp:69
QString getErrorText() const
Definition: AuthModel.cpp:92
QString transactionInfo
Definition: AuthModel.h:27
QString progressMessage
Definition: AuthModel.h:29
Definition: Env.h:44
Definition: WorkflowModel.h:23
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16