AusweisApp2
 Alle Klassen Namensbereiche Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Propertys Freundbeziehungen Makrodefinitionen
RemoteServiceModel.h
gehe zur Dokumentation dieser Datei
1 
7 #pragma once
8 
10 #include "ReaderManager.h"
11 #include "RemoteDeviceModel.h"
12 #include "WifiInfo.h"
13 
14 #include <QObject>
15 
16 namespace governikus
17 {
18 
19 
21  : public QObject
22 {
23  Q_OBJECT
24 
25  Q_PROPERTY(QString currentState READ getCurrentState NOTIFY fireCurrentStateChanged)
26  Q_PROPERTY(bool running READ isRunning WRITE setRunning NOTIFY fireIsRunningChanged)
27  Q_PROPERTY(bool runnable MEMBER mRunnable NOTIFY fireEnvironmentChanged)
28  Q_PROPERTY(bool canEnableNfc MEMBER mCanEnableNfc NOTIFY fireEnvironmentChanged)
29  Q_PROPERTY(QString errorMessage MEMBER mErrorMessage NOTIFY fireEnvironmentChanged)
30  Q_PROPERTY(QByteArray psk MEMBER mPsk NOTIFY firePskChanged)
32  Q_PROPERTY(bool connected READ isConnected NOTIFY fireConnectedChanged)
33  Q_PROPERTY(QString connectedClientDeviceName MEMBER mConnectedClientDeviceName NOTIFY fireConnectedClientDeviceNameChanged)
34  Q_PROPERTY(QString connectedServerDeviceNames MEMBER mConnectedServerDeviceNames NOTIFY fireConnectedServerDeviceNamesChanged)
37  Q_PROPERTY(RemoteDeviceModel * knownDevices READ getKnownDevices CONSTANT)
39 
40  private:
41  QSharedPointer<RemoteServiceContext> mContext;
42  WifiInfo mWifiInfo;
43  bool mRunnable;
44  bool mCanEnableNfc;
45  QString mErrorMessage;
46  QByteArray mPsk;
47  RemoteDeviceModel mAvailableRemoteDevices;
48  RemoteDeviceModel mKnownDevices;
49  QString mConnectedClientDeviceName;
50  QString mConnectedServerDeviceNames;
51 
52  void onEnvironmentChanged();
53  QString getErrorMessage(bool pNfcPluginAvailable, bool pNfcPluginEnabled, bool pWifiEnabled) const;
54 
55  private Q_SLOTS:
56  void onEstablishConnectionDone(const QSharedPointer<RemoteDeviceListEntry>& pEntry, const GlobalStatus& pStatus);
57  void onClientConnectedChanged(bool pConnected);
58  void onConnectedDevicesChanged();
59 
60  public:
62 
63  QString getCurrentState() const;
64  bool isRunning() const;
65  void setRunning(bool pState);
66 
67  QString getReaderPlugInType() const;
68  void setReaderPlugInType(const QString& pReaderPlugInType);
69 
72  void setDetectRemoteDevices(bool pNewStatus);
73  bool detectRemoteDevices();
74  Q_INVOKABLE void connectToServer(const QString& pDeviceId, const QString& pServerPsk);
75 
76  void resetContext(const QSharedPointer<RemoteServiceContext>& pContext = QSharedPointer<RemoteServiceContext>());
77  Q_INVOKABLE void setPairing(bool pEnabled = true);
78  QString getCurrentFingerprint() const;
79  bool isConnected() const;
80  Q_INVOKABLE bool pinPadModeOn();
81  Q_INVOKABLE QString getPacePasswordId() const;
82  Q_INVOKABLE void forgetDevice(const QString& pId);
83  Q_INVOKABLE void cancelPasswordRequest();
84 
85  Q_SIGNALS:
86  void fireStartWorkflow();
87  void fireCurrentStateChanged(const QString& pState);
88  void fireIsRunningChanged();
90  void firePskChanged(const QByteArray& pPsk);
91  void fireConnectedChanged(bool pConnected);
93  void fireServerPskChanged();
94  void fireDetectionChanged();
95  void firePairingFailed();
98 };
99 
100 
101 } /* namespace governikus */
QString getCurrentFingerprint() const
Definition: RemoteServiceModel.cpp:235
bool connected
Definition: RemoteServiceModel.h:32
RemoteDeviceModel * getKnownDevices()
Definition: RemoteServiceModel.cpp:144
Q_INVOKABLE QString getPacePasswordId() const
Definition: RemoteServiceModel.cpp:263
Definition: RemoteDeviceList.h:18
RemoteDeviceModel availableRemoteDevices
Definition: RemoteServiceModel.h:36
QString currentState
Definition: RemoteServiceModel.h:25
void fireConnectedChanged(bool pConnected)
Q_INVOKABLE void setPairing(bool pEnabled=true)
Definition: RemoteServiceModel.cpp:226
QString readerPlugInType
Definition: RemoteServiceModel.h:35
void setDetectRemoteDevices(bool pNewStatus)
Definition: RemoteServiceModel.cpp:150
QString connectedServerDeviceNames
Definition: RemoteServiceModel.h:34
Q_INVOKABLE void connectToServer(const QString &pDeviceId, const QString &pServerPsk)
Definition: RemoteServiceModel.cpp:172
Definition: GlobalStatus.h:18
bool isRunning() const
Definition: RemoteServiceModel.cpp:86
Definition: RemoteDeviceModel.h:56
Definition: RemoteServiceContext.h:20
QByteArray psk
Definition: RemoteServiceModel.h:30
QString connectedClientDeviceName
Definition: RemoteServiceModel.h:33
void fireCurrentStateChanged(const QString &pState)
QString errorMessage
Definition: RemoteServiceModel.h:29
bool canEnableNfc
Definition: RemoteServiceModel.h:28
RemoteDeviceModel * getAvailableRemoteDevices()
Definition: RemoteServiceModel.cpp:138
QString getReaderPlugInType() const
Definition: RemoteServiceModel.cpp:118
void setRunning(bool pState)
Definition: RemoteServiceModel.cpp:98
bool isConnected() const
Definition: RemoteServiceModel.cpp:246
void resetContext(const QSharedPointer< RemoteServiceContext > &pContext=QSharedPointer< RemoteServiceContext >())
Definition: RemoteServiceModel.cpp:206
Q_INVOKABLE void forgetDevice(const QString &pId)
Definition: RemoteServiceModel.cpp:313
void setReaderPlugInType(const QString &pReaderPlugInType)
Definition: RemoteServiceModel.cpp:129
bool runnable
Definition: RemoteServiceModel.h:27
void firePskChanged(const QByteArray &pPsk)
QString getCurrentState() const
Definition: RemoteServiceModel.cpp:92
Definition: WifiInfo.h:18
Definition: RemoteServiceModel.h:20
QString currentFingerprint
Definition: RemoteServiceModel.h:31
Q_INVOKABLE bool pinPadModeOn()
Definition: RemoteServiceModel.cpp:257
bool running
Definition: RemoteServiceModel.h:26
RemoteDeviceModel knownDevices
Definition: RemoteServiceModel.h:37
Q_INVOKABLE void cancelPasswordRequest()
Definition: RemoteServiceModel.cpp:319