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  Q_PROPERTY(QString statusHintText READ getStatusHintText NOTIFY fireResultChanged)
35 
36  private:
37  friend class ::test_WorkflowModel;
38 
39  QSharedPointer<WorkflowContext> mContext;
40  QString mReaderImage;
41 
42  public:
43  explicit WorkflowModel(QObject* pParent = nullptr);
44  ~WorkflowModel() override;
45 
46  void resetWorkflowContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
47 
48  QString getCurrentState() const;
49  virtual QString getResultString() const;
50  bool isError() const;
51  bool isMaskedError() const;
52 
53  ReaderManagerPlugInType getReaderPlugInType() const;
54  void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType);
55 
56  bool isBasicReader() const;
57 
58  bool getNextWorkflowPending() const;
59 
60  GlobalStatus::Code getStatusCode() const;
61  QString getReaderImage() const;
62 
63  QString getStatusHintText() const;
64  QString getStatusHintActionText() const;
65  Q_INVOKABLE bool invokeStatusHintAction();
66 
67  Q_INVOKABLE void cancelWorkflow();
68  Q_INVOKABLE void startScanIfNecessary();
69  Q_INVOKABLE void cancelWorkflowToChangePin();
70  Q_INVOKABLE void continueWorkflow();
71  Q_INVOKABLE void setInitialPluginType();
72  Q_INVOKABLE bool selectedReaderHasCard() const;
73  Q_INVOKABLE bool shouldSkipResultView() const;
74  Q_INVOKABLE bool isCancellationByUser() const;
75  Q_INVOKABLE QString getEmailHeader() const;
76  Q_INVOKABLE QString getEmailBody(bool pPercentEncoding = false, bool pAddLogNotice = false) const;
77  Q_INVOKABLE void sendResultMail() const;
78 
79  public Q_SLOTS:
80  void onReaderManagerSignal();
81 
82  Q_SIGNALS:
83  void fireCurrentStateChanged(const QString& pState);
84  void fireResultChanged();
89 };
90 
91 
92 } // namespace governikus
void resetWorkflowContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: WorkflowModel.cpp:41
QString getStatusHintText() const
Definition: WorkflowModel.cpp:176
Q_INVOKABLE void continueWorkflow()
Definition: WorkflowModel.cpp:110
QString getCurrentState() const
Definition: WorkflowModel.cpp:61
QString statusHintActionText
Definition: WorkflowModel.h:34
QString getStatusHintActionText() const
Definition: WorkflowModel.cpp:192
Q_INVOKABLE bool isCancellationByUser() const
Definition: WorkflowModel.cpp:267
Q_INVOKABLE void cancelWorkflow()
Definition: WorkflowModel.cpp:119
Q_INVOKABLE bool invokeStatusHintAction()
Definition: WorkflowModel.cpp:206
void fireCurrentStateChanged(const QString &pState)
bool getNextWorkflowPending() const
Definition: WorkflowModel.cpp:158
bool error
Definition: WorkflowModel.h:27
Q_INVOKABLE void startScanIfNecessary()
Definition: WorkflowModel.cpp:128
Definition: GlobalStatus.h:19
Q_INVOKABLE void cancelWorkflowToChangePin()
Definition: WorkflowModel.cpp:137
Q_INVOKABLE QString getEmailBody(bool pPercentEncoding=false, bool pAddLogNotice=false) const
Definition: WorkflowModel.cpp:288
Q_INVOKABLE void sendResultMail() const
Definition: WorkflowModel.cpp:300
Q_INVOKABLE bool shouldSkipResultView() const
Definition: WorkflowModel.cpp:255
bool errorIsMasked
Definition: WorkflowModel.h:28
Q_INVOKABLE QString getEmailHeader() const
Definition: WorkflowModel.cpp:277
GlobalStatus::Code getStatusCode() const
Definition: WorkflowModel.cpp:164
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14
ReaderManagerPlugInType getReaderPlugInType() const
Definition: WorkflowModel.cpp:85
bool hasNextWorkflowPending
Definition: WorkflowModel.h:32
bool isError() const
Definition: WorkflowModel.cpp:73
QString statusHintText
Definition: WorkflowModel.h:33
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:170
Q_INVOKABLE bool selectedReaderHasCard() const
Definition: WorkflowModel.cpp:245
bool isMaskedError() const
Definition: WorkflowModel.cpp:79
void onReaderManagerSignal()
Definition: WorkflowModel.cpp:311
virtual QString getResultString() const
Definition: WorkflowModel.cpp:67
QString readerImage
Definition: WorkflowModel.h:31
Q_INVOKABLE void setInitialPluginType()
Definition: WorkflowModel.cpp:221
void setReaderPlugInType(ReaderManagerPlugInType pReaderPlugInType)
Definition: WorkflowModel.cpp:96
Definition: WorkflowModel.h:21