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  UIPlugInJson* mJson;
36  QSharedPointer<WorkflowContext> mContext;
37  bool mUiDomination;
38 
39  private Q_SLOTS:
40  virtual void doShutdown() override;
41  virtual void onWorkflowStarted(QSharedPointer<WorkflowContext> pContext) override;
42  virtual void onWorkflowFinished(QSharedPointer<WorkflowContext> pContext) override;
43  virtual void onUiDomination(const UIPlugIn* pUi, const QString& pInformation, bool pAccepted) override;
44  virtual void onUiDominationReleased() override;
45  void onNewWebSocketRequest(const QSharedPointer<HttpRequest>& pRequest);
46  void onNewConnection();
47  void onClientDisconnected();
48  void onTextMessageReceived(const QString& pMessage);
49  void onJsonMessage(const QByteArray& pMessage);
50 
51  public:
53  virtual ~UIPlugInWebSocket() override;
54 };
55 
56 } // namespace governikus
Definition: UIPlugInJson.h:16
Definition: UIPlugInWebSocket.h:23
virtual ~UIPlugInWebSocket() override
Definition: UIPlugInWebSocket.cpp:54
UIPlugInWebSocket()
Definition: UIPlugInWebSocket.cpp:26
Implementation of ActivationContext for Intent based activation on Android systems.
Definition: ActivationContext.h:14