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 friend class ::test_WorkflowModel;
43
44 private:
45 QSharedPointer<WorkflowContext> mContext;
46 QString mReaderImage;
47#if defined(Q_OS_IOS)
48 bool mRemoteScanWasRunning;
49#endif
50 void insertCard(ReaderManagerPlugInType pType);
51
52 public:
53 explicit WorkflowModel(QObject* pParent = nullptr);
54 ~WorkflowModel() override = default;
55
56 void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
57
58 [[nodiscard]] QString getCurrentState() const;
59 [[nodiscard]] virtual QString getResultString() const;
60 [[nodiscard]] bool isError() const;
61 [[nodiscard]] bool isMaskedError() const;
62
63 [[nodiscard]] ReaderManagerPlugInType getReaderPlugInType() const;
64 void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
65
66 [[nodiscard]] bool isBasicReader() const;
67 [[nodiscard]] bool isRemoteReader() const;
68
69 [[nodiscard]] bool isSmartCardAllowed() const;
70
71 [[nodiscard]] bool isSmartSupported() const;
72 [[nodiscard]] virtual QVector<ReaderManagerPlugInType> getSupportedReaderPlugInTypes() const;
73
74 [[nodiscard]] bool getNextWorkflowPending() const;
75
76 [[nodiscard]] GlobalStatus::Code getStatusCode() const;
77 [[nodiscard]] QString getReaderImage() const;
78
79 [[nodiscard]] QString getStatusHintText() const;
80 [[nodiscard]] QString getStatusHintActionText() const;
81 [[nodiscard]] Q_INVOKABLE bool invokeStatusHintAction();
82
83 [[nodiscard]] bool showRemoveCardFeedback() const;
84 void setRemoveCardFeedback(bool pEnabled);
85
86 Q_INVOKABLE void insertSmartCard();
87 Q_INVOKABLE void insertSimulator();
88 Q_INVOKABLE void cancelWorkflow();
89 Q_INVOKABLE void startScanIfNecessary();
90 Q_INVOKABLE void continueWorkflow();
91 Q_INVOKABLE void setInitialPluginType();
92 [[nodiscard]] Q_INVOKABLE bool shouldSkipResultView() const;
93 [[nodiscard]] Q_INVOKABLE bool isCancellationByUser() const;
94 [[nodiscard]] Q_INVOKABLE QString getEmailHeader() const;
95 [[nodiscard]] Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
96 Q_INVOKABLE void sendResultMail() const;
97
98 private Q_SLOTS:
99 void onApplicationStateChanged(bool pIsAppInForeground);
100
101 public Q_SLOTS:
103
104 Q_SIGNALS:
105 void fireCurrentStateChanged(const QString& pState);
114};
115
116
117} // 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
QVector< ReaderManagerPlugInType > supportedPlugInTypes
Definition: WorkflowModel.h:33
Q_INVOKABLE void insertSmartCard()
Definition: WorkflowModel.cpp:132
bool isSmartCardAllowed
Definition: WorkflowModel.h:36
bool isError() const
Definition: WorkflowModel.cpp:84
Q_INVOKABLE void insertSimulator()
Definition: WorkflowModel.cpp:138
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:72
bool isSmartSupported
Definition: WorkflowModel.h:32
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:388
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:285
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:355
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:331
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:301
virtual QVector< ReaderManagerPlugInType > getSupportedReaderPlugInTypes() const
Definition: WorkflowModel.cpp:231
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:107
void fireCurrentStateChanged(const QString &pState)
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:254
QString currentState
Definition: WorkflowModel.h:27
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:144
void setRemoveCardFeedback(bool pEnabled)
Definition: WorkflowModel.cpp:322
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:400
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:377
QString getStatusHintText() const
Definition: WorkflowModel.cpp:266
QString readerImage
Definition: WorkflowModel.h:37
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:367
bool hasNextWorkflowPending
Definition: WorkflowModel.h:38
QString getReaderImage() const
Definition: WorkflowModel.cpp:260
bool isBasicReader
Definition: WorkflowModel.h:34
bool isMaskedError() const
Definition: WorkflowModel.cpp:90
virtual QString getResultString() const
Definition: WorkflowModel.cpp:78
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:96
friend class ::test_WorkflowModel
Definition: WorkflowModel.h:42
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:441
WorkflowModel(QObject *pParent=nullptr)
bool isRemoteReader
Definition: WorkflowModel.h:35
QString statusHintText
Definition: WorkflowModel.h:39
Q_INVOKABLE void startScanIfNecessary()
Definition: WorkflowModel.cpp:162
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:153
QString statusHintActionText
Definition: WorkflowModel.h:40
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:248
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16