sessionworker.hh 1.29 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef RSM_RSMCORE_SESSIONWORKER_HH_
#define RSM_RSMCORE_SESSIONWORKER_HH_

#include <QObject>

#include "rsmcore/declspec.hh"

namespace rsm
{
class SessionWorkerImpl;
class RSM_PUBLIC SessionWorker : public QObject
{
  Q_OBJECT
 private:
  // Private implementation
  SessionWorkerImpl* p;

 public:
  enum class Verbosity
  {
    None,
    Warning,
    Protocal,
    Packet,
    Functions
  };

  SessionWorker(QObject* parent = nullptr);
  SessionWorker(QString host, QObject* parent = nullptr);
  ~SessionWorker();

 public slots:
  void setHost(QString host);
  void setLogVerbosity(Verbosity level);
  void setPort(int port);
  void setUser(QString name);
  void connect();
  void disconnect();
  void verifyKnownHost();
  void acceptHostPublicKeyUpdate();
  void authenticate();
  void authenticateWithPassword(QString pswd);

 signals:
  void getServerPublicKeyFailed();
  void hostUnknown(QString host_hash);
  void hostPublicKeyChanged(QString host_hash);
  void hostPublicKeyUnavailable();
  void knownHostError(QString message);
  void updateKnownHostsFailed();
  void authenticationError(QString message);
  void authenticationSucceeded();
  void passwordRequested();
  void loginBannerIssued(QString message);

};  // class SessionWorker
}  // namespace rsm
#endif /* RSM_RSMCORE_SESSIONWORKER_HH_*/