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(QList<ReaderManagerPlugInType> supportedPlugInTypes READ getSupportedReaderPlugInTypes NOTIFY fireSupportedPlugInTypesChanged)
35 Q_PROPERTY(bool isBasicReader READ isBasicReader NOTIFY fireSelectedReaderChanged)
40 Q_PROPERTY(QString statusHintText READ getStatusHintText NOTIFY fireResultChanged)
42 Q_PROPERTY(QString statusCodeImage READ getStatusCodeImage NOTIFY fireResultChanged)
44 Q_PROPERTY(bool hasCard READ hasCard NOTIFY fireHasCardChanged)
45 friend class ::test_WorkflowModel;
46
47 private:
48 QSharedPointer<WorkflowContext> mContext;
49#if defined(Q_OS_IOS)
50 bool mRemoteScanWasRunning;
51#endif
52 void insertCard(ReaderManagerPlugInType pType) const;
53
54 public:
55 explicit WorkflowModel(QObject* pParent = nullptr);
56 ~WorkflowModel() override = default;
57
58 void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
59
60 [[nodiscard]] QString getCurrentState() const;
61 [[nodiscard]] virtual QString getResultString() const;
62 [[nodiscard]] bool isError() const;
63 [[nodiscard]] bool isMaskedError() const;
64
65 [[nodiscard]] ReaderManagerPlugInType getReaderPlugInType() const;
66 void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
67
68 [[nodiscard]] bool isBasicReader() const;
69 [[nodiscard]] bool isRemoteReader() const;
70 [[nodiscard]] bool hasCard() const;
71
72 [[nodiscard]] bool isCurrentSmartCardAllowed() const;
73
74 [[nodiscard]] bool isSmartSupported() const;
75 [[nodiscard]] virtual QList<ReaderManagerPlugInType> getSupportedReaderPlugInTypes() const;
76
77 [[nodiscard]] bool getNextWorkflowPending() const;
78
79 [[nodiscard]] GlobalStatus::Code getStatusCode() const;
80 [[nodiscard]] QString getStatusCodeImage() const;
81
82
83 [[nodiscard]] QString getStatusHintText() const;
84 [[nodiscard]] QString getStatusHintActionText() const;
85 [[nodiscard]] Q_INVOKABLE bool invokeStatusHintAction();
86
87 [[nodiscard]] bool showRemoveCardFeedback() const;
88 void setRemoveCardFeedback(bool pEnabled);
89
90 Q_INVOKABLE void insertSmartCard();
91 Q_INVOKABLE void insertSimulator();
92 Q_INVOKABLE void cancelWorkflow();
93 Q_INVOKABLE void startScanExplicitly();
94 Q_INVOKABLE void continueWorkflow();
95 Q_INVOKABLE void setInitialPluginType();
96 [[nodiscard]] Q_INVOKABLE bool shouldSkipResultView() const;
97 [[nodiscard]] Q_INVOKABLE bool isCancellationByUser() const;
98 [[nodiscard]] Q_INVOKABLE QString getEmailHeader() const;
99 [[nodiscard]] Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
100 Q_INVOKABLE void sendResultMail() const;
101
102 [[nodiscard]] QString eidTypeMismatchError() const;
103
104 private Q_SLOTS:
105 void onApplicationStateChanged(bool pIsAppInForeground);
106
107 Q_SIGNALS:
109 void fireCurrentStateChanged(const QString& pState);
110 void fireStateEntered(const QString& pState);
112 void fireReaderPlugInTypeChanged(bool pExplicitStart = false);
121 void fireShowUiRequest(UiModule pModule);
123};
124
125
126} // namespace governikus
Code
Definition: GlobalStatus.h:28
Definition: WorkflowModel.h:26
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:48
~WorkflowModel() override=default
QString getStatusCodeImage() const
Definition: WorkflowModel.cpp:252
void fireReaderPlugInTypeChanged(bool pExplicitStart=false)
void fireIsCurrentSmartCardAllowedChanged()
bool isCurrentSmartCardAllowed
Definition: WorkflowModel.h:37
Q_INVOKABLE void insertSmartCard()
Definition: WorkflowModel.cpp:136
bool isError() const
Definition: WorkflowModel.cpp:88
Q_INVOKABLE void insertSimulator()
Definition: WorkflowModel.cpp:142
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:43
QString getCurrentState() const
Definition: WorkflowModel.cpp:76
bool isSmartSupported
Definition: WorkflowModel.h:33
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:436
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:325
QString eidTypeMismatchError
Definition: WorkflowModel.h:38
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:403
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:379
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:345
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:111
void fireCurrentStateChanged(const QString &pState)
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:246
Q_INVOKABLE void startScanExplicitly()
Definition: WorkflowModel.cpp:166
QList< ReaderManagerPlugInType > supportedPlugInTypes
Definition: WorkflowModel.h:34
QString currentState
Definition: WorkflowModel.h:28
void fireShowUiRequest(UiModule pModule)
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:148
void setRemoveCardFeedback(bool pEnabled)
Definition: WorkflowModel.cpp:370
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:448
QString statusCodeImage
Definition: WorkflowModel.h:42
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:425
QString getStatusHintText() const
Definition: WorkflowModel.cpp:302
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:415
bool hasNextWorkflowPending
Definition: WorkflowModel.h:39
bool isBasicReader
Definition: WorkflowModel.h:35
void fireStateEntered(const QString &pState)
bool isMaskedError() const
Definition: WorkflowModel.cpp:94
virtual QString getResultString() const
Definition: WorkflowModel.cpp:82
virtual QList< ReaderManagerPlugInType > getSupportedReaderPlugInTypes() const
Definition: WorkflowModel.cpp:223
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:100
friend class ::test_WorkflowModel
Definition: WorkflowModel.h:45
WorkflowModel(QObject *pParent=nullptr)
bool isRemoteReader
Definition: WorkflowModel.h:36
QString statusHintText
Definition: WorkflowModel.h:40
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:157
QString statusHintActionText
Definition: WorkflowModel.h:41
bool hasCard
Definition: WorkflowModel.h:44
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:240
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16