AusweisApp2
Lade ...
Suche ...
Keine Treffer
WorkflowModel.h
gehe zur Dokumentation dieser Datei
9#pragma once
10
13
14#include <QObject>
15#include <QSharedPointer>
16#include <QString>
17
18class test_WorkflowModel;
19
20namespace governikus
21{
22
24 : public QObject
25{
26 Q_OBJECT
27 Q_PROPERTY(QString currentState READ getCurrentState NOTIFY fireCurrentStateChanged)
28 Q_PROPERTY(QString resultString READ getResultString NOTIFY fireResultChanged)
29 Q_PROPERTY(bool error READ isError NOTIFY fireResultChanged)
30 Q_PROPERTY(bool errorIsMasked READ isMaskedError NOTIFY fireResultChanged)
31 Q_PROPERTY(ReaderManagerPlugInType readerPlugInType READ getReaderPlugInType WRITE setReaderPlugInType NOTIFY fireReaderPlugInTypeChanged)
33 Q_PROPERTY(QVector<ReaderManagerPlugInType> supportedPlugInTypes READ getSupportedReaderPlugInTypes NOTIFY fireSupportedPlugInTypesChanged)
34 Q_PROPERTY(bool isBasicReader READ isBasicReader NOTIFY fireSelectedReaderChanged)
37 Q_PROPERTY(QString readerImage READ getReaderImage NOTIFY fireReaderImageChanged)
39 Q_PROPERTY(QString statusHintText READ getStatusHintText NOTIFY fireResultChanged)
42 Q_PROPERTY(bool hasCard READ hasCard NOTIFY fireHasCardChanged)
43 friend class ::test_WorkflowModel;
44
45 private:
46 QSharedPointer<WorkflowContext> mContext;
47 QString mReaderImage;
48#if defined(Q_OS_IOS)
49 bool mRemoteScanWasRunning;
50#endif
51 void insertCard(ReaderManagerPlugInType pType);
52
53 public:
54 explicit WorkflowModel(QObject* pParent = nullptr);
55 ~WorkflowModel() override = default;
56
57 void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
58
59 [[nodiscard]] QString getCurrentState() const;
60 [[nodiscard]] virtual QString getResultString() const;
61 [[nodiscard]] bool isError() const;
62 [[nodiscard]] bool isMaskedError() const;
63
64 [[nodiscard]] ReaderManagerPlugInType getReaderPlugInType() const;
65 void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
66
67 [[nodiscard]] bool isBasicReader() const;
68 [[nodiscard]] bool isRemoteReader() const;
69 [[nodiscard]] bool hasCard() const;
70
71 [[nodiscard]] bool isSmartCardAllowed() const;
72
73 [[nodiscard]] bool isSmartSupported() const;
74 [[nodiscard]] virtual QVector<ReaderManagerPlugInType> getSupportedReaderPlugInTypes() const;
75
76 [[nodiscard]] bool getNextWorkflowPending() const;
77
78 [[nodiscard]] GlobalStatus::Code getStatusCode() const;
79 [[nodiscard]] QString getReaderImage() const;
80
81 [[nodiscard]] QString getStatusHintText() const;
82 [[nodiscard]] QString getStatusHintActionText() const;
83 [[nodiscard]] Q_INVOKABLE bool invokeStatusHintAction();
84
85 [[nodiscard]] bool showRemoveCardFeedback() const;
86 void setRemoveCardFeedback(bool pEnabled);
87
88 Q_INVOKABLE void insertSmartCard();
89 Q_INVOKABLE void insertSimulator();
90 Q_INVOKABLE void cancelWorkflow();
91 Q_INVOKABLE void startScanExplicitly();
92 Q_INVOKABLE void continueWorkflow();
93 Q_INVOKABLE void setInitialPluginType();
94 [[nodiscard]] Q_INVOKABLE bool shouldSkipResultView() const;
95 [[nodiscard]] Q_INVOKABLE bool isCancellationByUser() const;
96 [[nodiscard]] Q_INVOKABLE QString getEmailHeader() const;
97 [[nodiscard]] Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
98 Q_INVOKABLE void sendResultMail() const;
99
100 private Q_SLOTS:
101 void onApplicationStateChanged(bool pIsAppInForeground);
102
103 public Q_SLOTS:
105
106 Q_SIGNALS:
107 void fireCurrentStateChanged(const QString& pState);
109 void fireReaderPlugInTypeChanged(bool pExplicitStart = false);
117};
118
119
120} // namespace governikus
Code
Definition: GlobalStatus.h:28
Definition: WorkflowModel.h:25
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:50
~WorkflowModel() override=default
void fireReaderPlugInTypeChanged(bool pExplicitStart=false)
QVector< ReaderManagerPlugInType > supportedPlugInTypes
Definition: WorkflowModel.h:33
Q_INVOKABLE void insertSmartCard()
Definition: WorkflowModel.cpp:133
bool isSmartCardAllowed
Definition: WorkflowModel.h:36
bool isError() const
Definition: WorkflowModel.cpp:85
Q_INVOKABLE void insertSimulator()
Definition: WorkflowModel.cpp:139
bool error
Definition: WorkflowModel.h:29
QString resultString
Definition: WorkflowModel.h:28
bool errorIsMasked
Definition: WorkflowModel.h:30
ReaderManagerPlugInType readerPlugInType
Definition: WorkflowModel.h:31
bool showRemoveCardFeedback
Definition: WorkflowModel.h:41
QString getCurrentState() const
Definition: WorkflowModel.cpp:73
bool isSmartSupported
Definition: WorkflowModel.h:32
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:402
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:299
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:369
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:345
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:315
virtual QVector< ReaderManagerPlugInType > getSupportedReaderPlugInTypes() const
Definition: WorkflowModel.cpp:245
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:108
void fireCurrentStateChanged(const QString &pState)
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:268
Q_INVOKABLE void startScanExplicitly()
Definition: WorkflowModel.cpp:163
QString currentState
Definition: WorkflowModel.h:27
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:145
void setRemoveCardFeedback(bool pEnabled)
Definition: WorkflowModel.cpp:336
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:414
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:391
QString getStatusHintText() const
Definition: WorkflowModel.cpp:280
QString readerImage
Definition: WorkflowModel.h:37
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:381
bool hasNextWorkflowPending
Definition: WorkflowModel.h:38
QString getReaderImage() const
Definition: WorkflowModel.cpp:274
bool isBasicReader
Definition: WorkflowModel.h:34
bool isMaskedError() const
Definition: WorkflowModel.cpp:91
virtual QString getResultString() const
Definition: WorkflowModel.cpp:79
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:97
friend class ::test_WorkflowModel
Definition: WorkflowModel.h:43
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:455
WorkflowModel(QObject *pParent=nullptr)
bool isRemoteReader
Definition: WorkflowModel.h:35
QString statusHintText
Definition: WorkflowModel.h:39
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:154
QString statusHintActionText
Definition: WorkflowModel.h:40
bool hasCard
Definition: WorkflowModel.h:42
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:262
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16