AusweisApp2
WorkflowModel.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
11 
12 #include <QObject>
13 #include <QSharedPointer>
14 #include <QString>
15 
16 class test_WorkflowModel;
17 
18 namespace governikus
19 {
20 
22  : public QObject
23 {
24  Q_OBJECT
25  Q_PROPERTY(QString currentState READ getCurrentState NOTIFY fireCurrentStateChanged)
26  Q_PROPERTY(QString resultString READ getResultString NOTIFY fireResultChanged)
27  Q_PROPERTY(bool error READ isError NOTIFY fireResultChanged)
28  Q_PROPERTY(bool errorIsMasked READ isMaskedError NOTIFY fireResultChanged)
29  Q_PROPERTY(ReaderManagerPlugInType readerPlugInType READ getReaderPlugInType WRITE setReaderPlugInType NOTIFY fireReaderPlugInTypeChanged)
31  Q_PROPERTY(QVector<ReaderManagerPlugInType> supportedPlugInTypes READ getSupportedReaderPlugInTypes NOTIFY fireSupportedPlugInTypesChanged)
32  Q_PROPERTY(bool isBasicReader READ isBasicReader NOTIFY fireSelectedReaderChanged)
33  Q_PROPERTY(bool isRemoteReader READ isRemoteReader NOTIFY fireSelectedReaderChanged)
35  Q_PROPERTY(QString readerImage READ getReaderImage NOTIFY fireReaderImageChanged)
37  Q_PROPERTY(QString statusHintText READ getStatusHintText NOTIFY fireResultChanged)
38  Q_PROPERTY(QString statusHintActionText READ getStatusHintActionText NOTIFY fireResultChanged)
40  friend class ::test_WorkflowModel;
41 
42  private:
43  QSharedPointer<WorkflowContext> mContext;
44  QString mReaderImage;
45 #if defined(Q_OS_IOS)
46  bool mRemoteScanWasRunning;
47 #endif
48  void insertCard(ReaderManagerPlugInType pType);
49 
50  public:
51  explicit WorkflowModel(QObject* pParent = nullptr);
52  ~WorkflowModel() override = default;
53 
54  void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
55 
56  QString getCurrentState() const;
57  virtual QString getResultString() const;
58  bool isError() const;
59  bool isMaskedError() const;
60 
61  ReaderManagerPlugInType getReaderPlugInType() const;
62  void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
63 
64  bool isBasicReader() const;
65  bool isRemoteReader() const;
66 
67  bool isSmartCardAllowed() const;
68 
69  bool isSmartSupported() const;
70  virtual QVector<ReaderManagerPlugInType> getSupportedReaderPlugInTypes() const;
71 
72  bool getNextWorkflowPending() const;
73 
75  QString getReaderImage() const;
76 
77  QString getStatusHintText() const;
78  QString getStatusHintActionText() const;
79  Q_INVOKABLE bool invokeStatusHintAction();
80 
81  [[nodiscard]] bool showRemoveCardFeedback() const;
82  void setRemoveCardFeedback(bool pEnabled);
83 
84  Q_INVOKABLE void insertSmartCard();
85  Q_INVOKABLE void insertSimulator();
86  Q_INVOKABLE void cancelWorkflow();
87  Q_INVOKABLE void startScanIfNecessary();
88  Q_INVOKABLE void continueWorkflow();
89  Q_INVOKABLE void setInitialPluginType();
90  Q_INVOKABLE bool shouldSkipResultView() const;
91  Q_INVOKABLE bool isCancellationByUser() const;
92  Q_INVOKABLE QString getEmailHeader() const;
93  Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
94  Q_INVOKABLE void sendResultMail() const;
95 
96  private Q_SLOTS:
97  void onApplicationStateChanged(bool pIsAppInForeground);
98 
99  public Q_SLOTS:
100  void onReaderManagerSignal();
101 
102  Q_SIGNALS:
103  void fireCurrentStateChanged(const QString& pState);
112 };
113 
114 
115 } // namespace governikus
Code
Definition: GlobalStatus.h:26
Definition: WorkflowModel.h:23
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:50
~WorkflowModel() override=default
QVector< ReaderManagerPlugInType > supportedPlugInTypes
Definition: WorkflowModel.h:31
Q_INVOKABLE void insertSmartCard()
Definition: WorkflowModel.cpp:133
bool isSmartCardAllowed
Definition: WorkflowModel.h:34
bool isError() const
Definition: WorkflowModel.cpp:84
Q_INVOKABLE void insertSimulator()
Definition: WorkflowModel.cpp:139
bool error
Definition: WorkflowModel.h:27
QString resultString
Definition: WorkflowModel.h:26
bool errorIsMasked
Definition: WorkflowModel.h:28
ReaderManagerPlugInType readerPlugInType
Definition: WorkflowModel.h:29
bool showRemoveCardFeedback
Definition: WorkflowModel.h:39
QString getCurrentState() const
Definition: WorkflowModel.cpp:72
bool isSmartSupported
Definition: WorkflowModel.h:30
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:384
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:283
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:351
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:327
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:297
virtual QVector< ReaderManagerPlugInType > getSupportedReaderPlugInTypes() const
Definition: WorkflowModel.cpp:232
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:107
void fireCurrentStateChanged(const QString &pState)
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:255
QString currentState
Definition: WorkflowModel.h:25
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:145
void setRemoveCardFeedback(bool pEnabled)
Definition: WorkflowModel.cpp:318
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:396
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:373
QString getStatusHintText() const
Definition: WorkflowModel.cpp:267
QString readerImage
Definition: WorkflowModel.h:35
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:363
bool hasNextWorkflowPending
Definition: WorkflowModel.h:36
QString getReaderImage() const
Definition: WorkflowModel.cpp:261
bool isBasicReader
Definition: WorkflowModel.h:32
bool isMaskedError() const
Definition: WorkflowModel.cpp:90
virtual QString getResultString() const
Definition: WorkflowModel.cpp:78
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:96
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:437
WorkflowModel(QObject *pParent=nullptr)
bool isRemoteReader
Definition: WorkflowModel.h:33
QString statusHintText
Definition: WorkflowModel.h:37
Q_INVOKABLE void startScanIfNecessary()
Definition: WorkflowModel.cpp:163
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:154
QString statusHintActionText
Definition: WorkflowModel.h:38
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:249
A simple template renderer.
Definition: ActivationContext.h:15