AusweisApp
Lade ...
Suche ...
Keine Treffer
WorkflowModel.h
gehe zur Dokumentation dieser Datei
9#pragma once
10
12#include "UIPlugIn.h"
14
15#include <QObject>
16#include <QSharedPointer>
17#include <QString>
18
19class test_WorkflowModel;
20
21namespace governikus
22{
23
25 : public QObject
26{
27 Q_OBJECT
28 Q_PROPERTY(QString currentState READ getCurrentState NOTIFY fireCurrentStateChanged)
29 Q_PROPERTY(QString resultString READ getResultString NOTIFY fireResultChanged)
30 Q_PROPERTY(bool error READ isError NOTIFY fireResultChanged)
31 Q_PROPERTY(bool errorIsMasked READ isMaskedError NOTIFY fireResultChanged)
32 Q_PROPERTY(ReaderManagerPlugInType readerPlugInType READ getReaderPlugInType WRITE setReaderPlugInType NOTIFY fireReaderPlugInTypeChanged)
34 Q_PROPERTY(QVector<ReaderManagerPlugInType> supportedPlugInTypes READ getSupportedReaderPlugInTypes NOTIFY fireSupportedPlugInTypesChanged)
35 Q_PROPERTY(bool isBasicReader READ isBasicReader NOTIFY fireSelectedReaderChanged)
39 Q_PROPERTY(QString readerImage READ getReaderImage NOTIFY fireReaderImageChanged)
41 Q_PROPERTY(QString statusHintText READ getStatusHintText NOTIFY fireResultChanged)
43 Q_PROPERTY(QString statusCodeImage READ getStatusCodeImage NOTIFY fireResultChanged)
45 Q_PROPERTY(bool hasCard READ hasCard NOTIFY fireHasCardChanged)
46 friend class ::test_WorkflowModel;
47
48 private:
49 QSharedPointer<WorkflowContext> mContext;
50 QString mReaderImage;
51#if defined(Q_OS_IOS)
52 bool mRemoteScanWasRunning;
53#endif
54 void insertCard(ReaderManagerPlugInType pType) const;
55
56 public:
57 explicit WorkflowModel(QObject* pParent = nullptr);
58 ~WorkflowModel() override = default;
59
60 void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
61
62 [[nodiscard]] QString getCurrentState() const;
63 [[nodiscard]] virtual QString getResultString() const;
64 [[nodiscard]] bool isError() const;
65 [[nodiscard]] bool isMaskedError() const;
66
67 [[nodiscard]] ReaderManagerPlugInType getReaderPlugInType() const;
68 void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
69
70 [[nodiscard]] bool isBasicReader() const;
71 [[nodiscard]] bool isRemoteReader() const;
72 [[nodiscard]] bool hasCard() const;
73
74 [[nodiscard]] bool isCurrentSmartCardAllowed() const;
75
76 [[nodiscard]] bool isSmartSupported() const;
77 [[nodiscard]] virtual QVector<ReaderManagerPlugInType> getSupportedReaderPlugInTypes() const;
78
79 [[nodiscard]] bool getNextWorkflowPending() const;
80
81 [[nodiscard]] GlobalStatus::Code getStatusCode() const;
82 [[nodiscard]] QString getReaderImage() const;
83 [[nodiscard]] QString getStatusCodeImage() const;
84
85
86 [[nodiscard]] QString getStatusHintText() const;
87 [[nodiscard]] QString getStatusHintActionText() const;
88 [[nodiscard]] Q_INVOKABLE bool invokeStatusHintAction();
89
90 [[nodiscard]] bool showRemoveCardFeedback() const;
91 void setRemoveCardFeedback(bool pEnabled);
92
93 Q_INVOKABLE void insertSmartCard();
94 Q_INVOKABLE void insertSimulator();
95 Q_INVOKABLE void cancelWorkflow();
96 Q_INVOKABLE void startScanExplicitly();
97 Q_INVOKABLE void continueWorkflow();
98 Q_INVOKABLE void setInitialPluginType();
99 [[nodiscard]] Q_INVOKABLE bool shouldSkipResultView() const;
100 [[nodiscard]] Q_INVOKABLE bool isCancellationByUser() const;
101 [[nodiscard]] Q_INVOKABLE QString getEmailHeader() const;
102 [[nodiscard]] Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
103 Q_INVOKABLE void sendResultMail() const;
104
105 [[nodiscard]] QString eidTypeMismatchError() const;
106
107 private Q_SLOTS:
108 void onApplicationStateChanged(bool pIsAppInForeground);
109
110 public Q_SLOTS:
112
113 Q_SIGNALS:
115 void fireCurrentStateChanged(const QString& pState);
116 void fireStateEntered(const QString& pState);
118 void fireReaderPlugInTypeChanged(bool pExplicitStart = false);
127 void fireShowUiRequest(UiModule pModule);
129};
130
131
132} // namespace governikus
Code
Definition: GlobalStatus.h:28
Definition: WorkflowModel.h:26
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:50
~WorkflowModel() override=default
QString getStatusCodeImage() const
Definition: WorkflowModel.cpp:260
void fireReaderPlugInTypeChanged(bool pExplicitStart=false)
QVector< ReaderManagerPlugInType > supportedPlugInTypes
Definition: WorkflowModel.h:34
void fireIsCurrentSmartCardAllowedChanged()
bool isCurrentSmartCardAllowed
Definition: WorkflowModel.h:37
Q_INVOKABLE void insertSmartCard()
Definition: WorkflowModel.cpp:138
bool isError() const
Definition: WorkflowModel.cpp:90
Q_INVOKABLE void insertSimulator()
Definition: WorkflowModel.cpp:144
bool error
Definition: WorkflowModel.h:30
QString resultString
Definition: WorkflowModel.h:29
bool errorIsMasked
Definition: WorkflowModel.h:31
ReaderManagerPlugInType readerPlugInType
Definition: WorkflowModel.h:32
bool showRemoveCardFeedback
Definition: WorkflowModel.h:44
QString getCurrentState() const
Definition: WorkflowModel.cpp:78
bool isSmartSupported
Definition: WorkflowModel.h:33
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:444
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:333
QString eidTypeMismatchError
Definition: WorkflowModel.h:38
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:411
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:387
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:353
virtual QVector< ReaderManagerPlugInType > getSupportedReaderPlugInTypes() const
Definition: WorkflowModel.cpp:225
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:113
void fireCurrentStateChanged(const QString &pState)
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:248
Q_INVOKABLE void startScanExplicitly()
Definition: WorkflowModel.cpp:168
QString currentState
Definition: WorkflowModel.h:28
void fireShowUiRequest(UiModule pModule)
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:150
void setRemoveCardFeedback(bool pEnabled)
Definition: WorkflowModel.cpp:378
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:456
QString statusCodeImage
Definition: WorkflowModel.h:43
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:433
QString getStatusHintText() const
Definition: WorkflowModel.cpp:310
QString readerImage
Definition: WorkflowModel.h:39
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:423
bool hasNextWorkflowPending
Definition: WorkflowModel.h:40
QString getReaderImage() const
Definition: WorkflowModel.cpp:254
bool isBasicReader
Definition: WorkflowModel.h:35
void fireStateEntered(const QString &pState)
bool isMaskedError() const
Definition: WorkflowModel.cpp:96
virtual QString getResultString() const
Definition: WorkflowModel.cpp:84
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:102
friend class ::test_WorkflowModel
Definition: WorkflowModel.h:46
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:497
WorkflowModel(QObject *pParent=nullptr)
bool isRemoteReader
Definition: WorkflowModel.h:36
QString statusHintText
Definition: WorkflowModel.h:41
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:159
QString statusHintActionText
Definition: WorkflowModel.h:42
bool hasCard
Definition: WorkflowModel.h:45
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:242
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16