AusweisApp2
NumberModel.h
gehe zur Dokumentation dieser Datei
1 
8 #pragma once
9 
11 #include "Env.h"
12 
13 #include <QObject>
14 #include <QSharedPointer>
15 
16 namespace governikus
17 {
18 
20  : public QObject
21 {
22  Q_OBJECT
23  friend class Env;
24 
26  Q_PROPERTY(QString can READ getCan WRITE setCan NOTIFY fireCanChanged)
27  Q_PROPERTY(QString pin READ getPin WRITE setPin NOTIFY firePinChanged)
28  Q_PROPERTY(QString newPin READ getNewPin WRITE setNewPin NOTIFY fireNewPinChanged)
29  Q_PROPERTY(QString puk READ getPuk WRITE setPuk NOTIFY firePukChanged)
30  Q_PROPERTY(bool hasError READ hasError NOTIFY fireInputErrorChanged)
31  Q_PROPERTY(bool hasPasswordError READ hasPasswordError NOTIFY fireInputErrorChanged)
32  Q_PROPERTY(QString inputError READ getInputError NOTIFY fireInputErrorChanged)
33  Q_PROPERTY(int retryCounter READ getRetryCounter NOTIFY fireReaderInfoChanged)
34  Q_PROPERTY(bool pinDeactivated READ isPinDeactivated NOTIFY fireReaderInfoChanged)
37 
38  private:
39  QSharedPointer<WorkflowContext> mContext;
40  bool mRequestTransportPin;
41  bool mRequestNewPin;
42 
43  CardReturnCode getInputErrorCode() const;
44 
45  private Q_SLOTS:
46  void onCardConnectionChanged();
47 
48  protected:
50  ~NumberModel() override = default;
51  static NumberModel& getInstance();
52 
53  public:
54  enum class QmlPasswordType
55  {
57  };
58  Q_ENUM(QmlPasswordType)
59 
60  void resetContext(const QSharedPointer<WorkflowContext>& pContext = QSharedPointer<WorkflowContext>());
61 
63  Q_INVOKABLE void requestNewPin();
64 
65  QString getCan() const;
66  void setCan(const QString& pCan);
67 
68  QString getPin() const;
69  void setPin(const QString& pPin);
70 
71  QString getNewPin() const;
72  void setNewPin(const QString& pNewPin);
73 
74  QString getPuk() const;
75  void setPuk(const QString& pPuk);
76 
77  bool hasError() const;
78  bool hasPasswordError() const;
79  QString getInputError() const;
80 
81  int getRetryCounter() const;
82  bool isPinDeactivated() const;
84 
85  bool isRequestTransportPin() const;
86  void setRequestTransportPin(bool pEnabled);
87 
88  private Q_SLOTS:
89  void onReaderInfoChanged(const QString& pReaderName);
90 
91  Q_SIGNALS:
101 };
102 
103 
104 } // namespace governikus
Definition: Env.h:39
Definition: NumberModel.h:21
bool isCanAllowedMode
Definition: NumberModel.h:35
QString pin
Definition: NumberModel.h:27
int retryCounter
Definition: NumberModel.h:33
QString can
Definition: NumberModel.h:26
QString newPin
Definition: NumberModel.h:28
bool pinDeactivated
Definition: NumberModel.h:34
void setCan(const QString &pCan)
Definition: NumberModel.cpp:138
void setNewPin(const QString &pNewPin)
Definition: NumberModel.cpp:170
void setRequestTransportPin(bool pEnabled)
Definition: NumberModel.cpp:313
bool requestTransportPin
Definition: NumberModel.h:36
void fireRequestTransportPinChanged()
void resetContext(const QSharedPointer< WorkflowContext > &pContext=QSharedPointer< WorkflowContext >())
Definition: NumberModel.cpp:41
QmlPasswordType getPasswordType() const
Definition: NumberModel.cpp:91
~NumberModel() override=default
QString getNewPin() const
Definition: NumberModel.cpp:162
QString puk
Definition: NumberModel.h:29
bool hasPasswordError
Definition: NumberModel.h:31
void setPuk(const QString &pPuk)
Definition: NumberModel.cpp:195
QString getInputError() const
Definition: NumberModel.cpp:230
bool hasError
Definition: NumberModel.h:30
bool isRequestTransportPin() const
Definition: NumberModel.cpp:323
QmlPasswordType
Definition: NumberModel.h:55
static NumberModel & getInstance()
Definition: NumberModel.cpp:35
void setPin(const QString &pPin)
Definition: NumberModel.cpp:153
QString getPin() const
Definition: NumberModel.cpp:147
QString inputError
Definition: NumberModel.h:32
QString getPuk() const
Definition: NumberModel.cpp:189
bool isPinDeactivated() const
Definition: NumberModel.cpp:293
QmlPasswordType passwordType
Definition: NumberModel.h:25
int getRetryCounter() const
Definition: NumberModel.cpp:280
Q_INVOKABLE void requestNewPin()
Definition: NumberModel.cpp:122
QString getCan() const
Definition: NumberModel.cpp:132
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:15