AusweisApp2
AuthModel.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "context/AuthContext.h"
10 #include "Env.h"
11 #include "WorkflowModel.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)
30  Q_PROPERTY(QString errorHeader READ getErrorHeader NOTIFY fireResultChanged)
31  Q_PROPERTY(QString errorText READ getErrorText NOTIFY fireResultChanged)
32  Q_PROPERTY(QString statusCode READ getStatusCode NOTIFY fireResultChanged)
33 
34  private:
35  QSharedPointer<AuthContext> mContext;
36  QString mTransactionInfo;
37 
38  protected:
40  ~AuthModel() override = default;
41  static AuthModel& getInstance();
42 
43  public:
44  void resetContext(const QSharedPointer<AuthContext>& pContext = QSharedPointer<AuthContext>());
45 
46  const QString& getTransactionInfo() const;
47  int getProgressValue() const;
48  const QString getProgressMessage() const;
49  QString getErrorHeader() const;
50  QString getErrorText() const;
51  QString getStatusCode() const;
52 
53  Q_INVOKABLE void setSkipRedirect(bool pSkipRedirect);
54 
55  private Q_SLOTS:
56  void onDidAuthenticateEac1Changed();
57 
58  Q_SIGNALS:
60  void fireProgressChanged();
61 };
62 
63 
64 } // namespace governikus
governikus::AuthModel::progressValue
int progressValue
Definition: AuthModel.h:28
governikus::AuthModel::getInstance
static AuthModel & getInstance()
Definition: AuthModel.cpp:111
AuthContext.h
governikus::AuthModel::getProgressValue
int getProgressValue() const
Definition: AuthModel.cpp:51
governikus::AuthModel::errorText
QString errorText
Definition: AuthModel.h:31
governikus::AuthModel::getProgressMessage
const QString getProgressMessage() const
Definition: AuthModel.cpp:62
governikus::AuthModel::fireProgressChanged
void fireProgressChanged()
Definition: moc_AuthModel.cpp:225
ReaderManagerPlugInInfo.h
governikus::AuthModel::statusCode
QString statusCode
Definition: AuthModel.h:32
governikus::AuthModel
Definition: AuthModel.h:23
governikus::AuthContext::fireProgressChanged
void fireProgressChanged()
Definition: moc_AuthContext.cpp:165
governikus::AuthModel::errorHeader
QString errorHeader
Definition: AuthModel.h:30
AuthModel.h
governikus::AuthModel::progressMessage
QString progressMessage
Definition: AuthModel.h:29
governikus::AuthModel::getErrorHeader
QString getErrorHeader() const
Definition: AuthModel.cpp:73
governikus::getEnumName
QLatin1String getEnumName(T pType)
Definition: EnumHelper.h:181
governikus::AuthModel::getStatusCode
QString getStatusCode() const
Definition: AuthModel.cpp:104
governikus::AuthContext::fireDidAuthenticateEac1Changed
void fireDidAuthenticateEac1Changed()
Definition: moc_AuthContext.cpp:171
governikus::Env
Definition: Env.h:39
governikus::AuthModel::setSkipRedirect
Q_INVOKABLE void setSkipRedirect(bool pSkipRedirect)
Definition: AuthModel.cpp:133
governikus::GlobalStatus::Code::Unknown_Error
@ Unknown_Error
governikus::WorkflowModel::fireResultChanged
void fireResultChanged()
Definition: moc_WorkflowModel.cpp:346
governikus::AuthModel::resetContext
void resetContext(const QSharedPointer< AuthContext > &pContext=QSharedPointer< AuthContext >())
Definition: AuthModel.cpp:23
governikus::AuthModel::fireTransactionInfoChanged
void fireTransactionInfoChanged()
Definition: moc_AuthModel.cpp:219
governikus
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15
governikus::AuthModel::getTransactionInfo
const QString & getTransactionInfo() const
Definition: AuthModel.cpp:45
Env.h
governikus::AuthModel::transactionInfo
QString transactionInfo
Definition: AuthModel.h:27
defineSingleton
defineSingleton(AuthModel) AuthModel
Definition: AuthModel.cpp:12
WorkflowModel.h
governikus::AuthModel::getErrorText
QString getErrorText() const
Definition: AuthModel.cpp:85
governikus::AuthModel::AuthModel
AuthModel()
governikus::AuthModel::~AuthModel
~AuthModel() override=default
governikus::WorkflowModel
Definition: WorkflowModel.h:23
SingletonHelper.h
governikus::WorkflowModel::resetContext
void resetContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:38