AusweisApp2
StateGenericProviderCommunication.h
gehe zur Dokumentation dieser Datei
1 
5 #pragma once
6 
7 #include "AbstractState.h"
9 #include "GlobalStatus.h"
10 #include "context/AuthContext.h"
11 
12 #include <QByteArray>
13 #include <QList>
14 #include <QNetworkReply>
15 #include <QSharedPointer>
16 #include <QSslConfiguration>
17 #include <QSslError>
18 
19 
20 class test_StateGenericProviderCommunication;
21 class test_StateGetSelfAuthenticationData;
22 class test_StatePreparePersonalization;
23 class test_StateGetSessionId;
24 class test_StateGetChallenge;
25 
26 
27 namespace governikus
28 {
29 
31  : public AbstractState
32  , public GenericContextContainer<AuthContext>
33 {
34  Q_OBJECT
35  friend class ::test_StateGenericProviderCommunication;
36  friend class ::test_StateGetSelfAuthenticationData;
37  friend class ::test_StatePreparePersonalization;
38  friend class ::test_StateGetSessionId;
39  friend class ::test_StateGetChallenge;
40 
41  protected:
42  QSharedPointer<QNetworkReply> mReply;
43 
44  explicit StateGenericProviderCommunication(const QSharedPointer<WorkflowContext>& pContext);
45 
46  virtual void handleNetworkReply(const QByteArray& pContent) = 0;
47  virtual bool isLoggingAllowed();
48 
49  private:
50  virtual void setProgress() const;
51  [[nodiscard]] virtual QUrl getRequestUrl() const = 0;
52  [[nodiscard]] virtual QByteArray getPayload() const
53  {
54  return QByteArray();
55  }
56 
57 
58  void run() override;
59  void reportCommunicationError(const GlobalStatus& pStatus);
60  void checkSslConnectionAndSaveCertificate(const QSslConfiguration& pSslConfiguration);
61 
62  private Q_SLOTS:
63  void onSslErrors(const QList<QSslError>& pErrors);
64  void onSslHandshakeDone();
65  void onNetworkReply();
66 
67  public:
68  void onExit(QEvent* pEvent) override;
69 };
70 
71 } // namespace governikus
Definition: AbstractState.h:20
Definition: GenericContextContainer.h:20
Definition: GlobalStatus.h:20
Definition: StateGenericProviderCommunication.h:33
StateGenericProviderCommunication(const QSharedPointer< WorkflowContext > &pContext)
Definition: StateGenericProviderCommunication.cpp:20
virtual void handleNetworkReply(const QByteArray &pContent)=0
void onExit(QEvent *pEvent) override
Definition: StateGenericProviderCommunication.cpp:159
QSharedPointer< QNetworkReply > mReply
Definition: StateGenericProviderCommunication.h:42
virtual bool isLoggingAllowed()
Definition: StateGenericProviderCommunication.cpp:99
A simple template renderer.
Definition: ActivationContext.h:15