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(QString readerImage READ getReaderImage NOTIFY fireReaderImageChanged)
33 
34  private:
35  friend class ::test_WorkflowModel;
36 
37  QSharedPointer<WorkflowContext> mContext;
38  QString mReaderImage;
39 
40  public:
41  explicit WorkflowModel(QObject* pParent = nullptr);
42  ~WorkflowModel() override;
43 
44  void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
45 
46  QString getCurrentState() const;
47  virtual QString getResultString() const;
48  bool isError() const;
49  bool isMaskedError() const;
50 
51  ReaderManagerPlugInType getReaderPlugInType() const;
52  void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
53 
54  bool isBasicReader() const;
55 
56  bool getNextWorkflowPending() const;
57 
58  QString getReaderImage() const;
59 
60  Q_INVOKABLE void cancelWorkflow();
61  Q_INVOKABLE void startScanIfNecessary();
62  Q_INVOKABLE void cancelWorkflowToChangePin();
63  Q_INVOKABLE void continueWorkflow();
64  Q_INVOKABLE void setInitialPluginType();
65  Q_INVOKABLE bool selectedReaderHasCard() const;
66  Q_INVOKABLE bool shouldSkipResultView() const;
67  Q_INVOKABLE bool isCancellationByUser() const;
68  Q_INVOKABLE QString getEmailHeader() const;
69  Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
70  Q_INVOKABLE void sendResultMail() const;
71 
72  public Q_SLOTS:
73  void onReaderManagerSignal();
74 
75  Q_SIGNALS:
76  void fireCurrentStateChanged(const QString& pState);
77  void fireResultChanged();
82 };
83 
84 
85 } // namespace governikus
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:39
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:108
QString getCurrentState() const
Definition: WorkflowModel.cpp:59
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:214
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:117
void fireCurrentStateChanged(const QString &pState)
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:156
bool error
Definition: WorkflowModel.h:27
Q_INVOKABLE void startScanIfNecessary()
Definition: WorkflowModel.cpp:126
Q_INVOKABLE void cancelWorkflowToChangePin()
Definition: WorkflowModel.cpp:135
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:235
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:247
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:202
bool errorIsMasked
Definition: WorkflowModel.h:28
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:224
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:83
bool hasNextWorkflowPending
Definition: WorkflowModel.h:32
bool isError() const
Definition: WorkflowModel.cpp:71
Definition: WorkflowContext.h:22
QString currentState
Definition: WorkflowModel.h:25
QString resultString
Definition: WorkflowModel.h:26
ReaderManagerPlugInType readerPlugInType
Definition: WorkflowModel.h:29
QString getReaderImage() const
Definition: WorkflowModel.cpp:162
Q_INVOKABLE bool selectedReaderHasCard() const
Definition: WorkflowModel.cpp:192
bool isMaskedError() const
Definition: WorkflowModel.cpp:77
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:258
virtual QString getResultString() const
Definition: WorkflowModel.cpp:65
QString readerImage
Definition: WorkflowModel.h:31
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:168
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:94
Definition: WorkflowModel.h:21