AusweisApp2
Lade ...
Suche ...
Keine Treffer
IfdDispatcher.h
gehe zur Dokumentation dieser Datei
1
11#pragma once
12
13#include "DataChannel.h"
14#include "GlobalStatus.h"
15#include "messages/IfdMessage.h"
16#include "messages/IfdVersion.h"
17
18#include <QObject>
19#include <QSharedPointer>
20
21
22namespace governikus
23{
24
26 : public QObject
27{
28 Q_OBJECT
29
30 private:
31 const QSharedPointer<DataChannel> mDataChannel;
32 IfdVersion::Version mVersion;
33 QString mContextHandle;
34
35 virtual bool processContext(IfdMessageType pMsgType, const QJsonObject& pMsgObject) = 0;
36
37 private Q_SLOTS:
38 void onReceived(const QByteArray& pDataBlock);
39 void onClosed(GlobalStatus::Code pCloseCode);
40
41 protected:
42 void setContextHandle(const QString& pHandle);
43 void setVersion(IfdVersion::Version pVersion);
44
45 public:
46 explicit IfdDispatcher(IfdVersion::Version pVersion, const QSharedPointer<DataChannel>& pDataChannel);
47 ~IfdDispatcher() override;
48
49 [[nodiscard]] virtual bool isPairingConnection() const;
50 [[nodiscard]] virtual QString getId() const;
51 [[nodiscard]] virtual const QString& getContextHandle() const;
52 [[nodiscard]] IfdVersion::Version getVersion() const;
53 void saveRemoteNameInSettings(const QString& pName);
54
55 void close();
56 Q_INVOKABLE virtual void send(const QSharedPointer<const IfdMessage>& pMessage);
57
58 Q_SIGNALS:
59 void fireReceived(IfdMessageType pMessageType, const QJsonObject& pJsonObject, const QString& pId);
60 void fireClosed(GlobalStatus::Code pCloseCode, const QString& pId);
61};
62
63} // namespace governikus
Code
Definition: GlobalStatus.h:28
Definition: IfdDispatcher.h:27
void setVersion(IfdVersion::Version pVersion)
Definition: IfdDispatcher.cpp:86
void fireReceived(IfdMessageType pMessageType, const QJsonObject &pJsonObject, const QString &pId)
void fireClosed(GlobalStatus::Code pCloseCode, const QString &pId)
virtual bool isPairingConnection() const
Definition: IfdDispatcher.cpp:92
IfdVersion::Version getVersion() const
Definition: IfdDispatcher.cpp:120
virtual Q_INVOKABLE void send(const QSharedPointer< const IfdMessage > &pMessage)
Definition: IfdDispatcher.cpp:135
virtual const QString & getContextHandle() const
Definition: IfdDispatcher.cpp:114
~IfdDispatcher() override
Definition: IfdDispatcher.cpp:34
void setContextHandle(const QString &pHandle)
Definition: IfdDispatcher.cpp:80
void close()
Definition: IfdDispatcher.cpp:151
void saveRemoteNameInSettings(const QString &pName)
Definition: IfdDispatcher.cpp:126
virtual QString getId() const
Definition: IfdDispatcher.cpp:103
Version
Definition: IfdVersion.h:17
Implementation of GeneralAuthenticate response APDUs.
Definition: CommandApdu.h:16