AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
StepAuthenticationEac1Widget.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "context/AuthContext.h"
10 #include "generic/ButtonState.h"
11 
12 #include <QCheckBox>
13 
14 #ifdef Q_OS_WIN
15 #include <QWinTaskbarButton>
16 #endif
17 
18 class QLabel;
19 class QProgressBar;
20 
21 namespace Ui
22 {
23 class StepAuthenticationEac1Widget;
24 }
25 
26 
27 namespace governikus
28 {
29 
30 class PasswordEdit;
31 
33  : public QWidget
34 {
35  Q_OBJECT
36 
37  public:
38  enum class State
39  {
40  INITIAL,
41  EDIT_CHAT,
42  ENTER_PIN,
47  FINISHED,
48  };
49  Q_ENUM(State);
50 
51  StepAuthenticationEac1Widget(QWidget* pParent = nullptr);
52  virtual ~StepAuthenticationEac1Widget() override;
53 
54  void setContext(const QSharedPointer<AuthContext>& pContext);
55 
56  void setState(State pState);
57  void forwardStep();
58 
60 
61  Q_SIGNALS:
62  void setForwardButtonState(ButtonState pState, const QString& pText = QString());
63  void setCancelButtonState(ButtonState pState);
64 
65  void firePinUpdated(const QString& pPin);
66  void fireCanUpdated(const QString& pCan);
67 
68  private Q_SLOTS:
69  void focusWidget();
70  void onDetailsButtonClicked();
71  void checkBoxChanged(int pCheckState);
72  void canTextEdited(const QString& pText);
73  void pinTextEdited(const QString& pText);
74  void onRandomButtonClicked();
75  void onResultChanged();
76 
77  protected:
78  virtual void hideEvent(QHideEvent* pEvent) override;
79  virtual void showEvent(QShowEvent* pEvent) override;
80  virtual void changeEvent(QEvent* pEvent) override;
81 
82  private:
83  void setToolTip();
84  void updateWidget();
85  void setupChatView();
86  void prepareChatsForGui();
87  void updateProgressPanel(int pProgressValue = 0, const QString& pProgressText = QString());
88  void addChatRightToGui(AccessRight pRight, bool pOptional, int pListSize);
89  void clearPinWidgetLayout();
90  void createBasicReaderWidget();
91 
92  private:
93  QScopedPointer<Ui::StepAuthenticationEac1Widget> mUi;
94  QSharedPointer<AuthContext> mContext;
95  QMap<QCheckBox*, AccessRight> mMap;
96 
97  PasswordEdit* mCANField;
98  PasswordEdit* mPINField;
99 
100  State mState;
101  QProgressBar* mProgressBar;
102  QLabel* mProgressBarLabel;
103 
104  bool mCloseWindowWhenFinished;
105 
106  #ifdef Q_OS_WIN
107  QWinTaskbarButton* mTaskbarButton;
108  #endif
109 };
110 
111 
113 
114 } /* namespace governikus */
virtual ~StepAuthenticationEac1Widget() override
Definition: StepAuthenticationEac1Widget.cpp:56
void setState(State pState)
Definition: StepAuthenticationEac1Widget.cpp:74
void setCancelButtonState(ButtonState pState)
Definition: StepAuthenticationEac1Widget.h:32
ButtonState
Definition: ButtonState.h:12
virtual void showEvent(QShowEvent *pEvent) override
Definition: StepAuthenticationEac1Widget.cpp:560
void firePinUpdated(const QString &pPin)
State
Definition: StepAuthenticationEac1Widget.h:38
virtual void changeEvent(QEvent *pEvent) override
Definition: StepAuthenticationEac1Widget.cpp:636
StepAuthenticationEac1Widget(QWidget *pParent=nullptr)
Definition: StepAuthenticationEac1Widget.cpp:33
virtual void hideEvent(QHideEvent *pEvent) override
Definition: StepAuthenticationEac1Widget.cpp:548
#define defineEnumOperators(enumName)
Definition: EnumHelper.h:18
void fireCanUpdated(const QString &pCan)
Definition: PasswordEdit.h:22
void setForwardButtonState(ButtonState pState, const QString &pText=QString())
void forwardStep()
Definition: StepAuthenticationEac1Widget.cpp:84
void setContext(const QSharedPointer< AuthContext > &pContext)
Definition: StepAuthenticationEac1Widget.cpp:61
void updateButtonsAndPinWidget()
Definition: StepAuthenticationEac1Widget.cpp:119