AusweisApp2
UIPlugInWebSocket.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
9 #include "HttpRequest.h"
10 #include "HttpServer.h"
11 #include "UIPlugIn.h"
12 #include "UIPlugInJson.h"
13 
14 #include <QDir>
15 #include <QMap>
16 #include <QScopedPointer>
17 #include <QWebSocket>
18 #include <QWebSocketServer>
19 
20 namespace governikus
21 {
22 
24  : public UIPlugIn
25 {
26  Q_OBJECT
27  Q_PLUGIN_METADATA(IID "governikus.UIPlugIn" FILE "metadata.json")
28  Q_INTERFACES(governikus::UIPlugIn)
29 
30  private:
31  QSharedPointer<HttpServer> mHttpServer;
32  QWebSocketServer mServer;
33  QScopedPointer<QWebSocket, QScopedPointerDeleteLater> mConnection;
34  QSharedPointer<HttpRequest> mRequest;
35  QPointer<UIPlugInJson> mJson;
36  QSharedPointer<WorkflowContext> mContext;
37  bool mUiDomination;
38  bool mUiDominationPrevUsedAsSDK;
39 
40  private Q_SLOTS:
41  void doShutdown() override;
42  void onWorkflowStarted(QSharedPointer<WorkflowContext> pContext) override;
43  void onWorkflowFinished(QSharedPointer<WorkflowContext> pContext) override;
44  void onUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted) override;
45  void onUiDominationReleased() override;
46  void onNewWebSocketRequest(const QSharedPointer<HttpRequest>& pRequest);
47  void onNewConnection();
48  void onClientDisconnected();
49  void onTextMessageReceived(const QString& pMessage);
50  void onJsonMessage(const QByteArray& pMessage);
51 
52  public:
54  ~UIPlugInWebSocket() override = default;
55 
56  [[nodiscard]] bool initialize() override;
57 };
58 
59 } // namespace governikus
Definition: UIPlugInWebSocket.h:25
UIPlugInWebSocket()
Definition: UIPlugInWebSocket.cpp:26
~UIPlugInWebSocket() override=default
bool initialize() override
Definition: UIPlugInWebSocket.cpp:39
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16