summaryrefslogtreecommitdiffstats
path: root/src/server/net/client.h
diff options
context:
space:
mode:
authorManuel Schneider2014-05-21 12:33:57 +0200
committerManuel Schneider2014-05-21 12:33:57 +0200
commitd4b565e226a842ba663e44417bc59ec87f8ebc7c (patch)
treed83e273b1394a1960c88d46e33c96661bb8761e4 /src/server/net/client.h
parentSeveral changes: (diff)
downloadpvs2-d4b565e226a842ba663e44417bc59ec87f8ebc7c.tar.gz
pvs2-d4b565e226a842ba663e44417bc59ec87f8ebc7c.tar.xz
pvs2-d4b565e226a842ba663e44417bc59ec87f8ebc7c.zip
[Client] Make setTutor inline and drop the communication stuff since the client does not handle it. Add a state stub t.b.c.
Diffstat (limited to 'src/server/net/client.h')
-rw-r--r--src/server/net/client.h41
1 files changed, 30 insertions, 11 deletions
diff --git a/src/server/net/client.h b/src/server/net/client.h
index 244411d..389d05c 100644
--- a/src/server/net/client.h
+++ b/src/server/net/client.h
@@ -24,33 +24,52 @@ class Client : public QObject
Q_OBJECT
public:
+
+ enum class State
+ {
+ Authenticating,
+ Idle,
+ VncClient,
+ VncServer,
+ Locked
+ };
+
explicit Client(QSslSocket* socket);
~Client();
- void requestThumb(const int width, const int height);
- const inline bool isAuthed() const { return _authed == 2; }
- const inline QString& name() const { return _name; }
- const inline QString& host() const { return _host; }
- const inline QString ip() const { return _socket->peerAddress().toString(); }
- const inline int id() const { return _id; }
+ // Getters
+ inline const State state() const { return _state; }
+ inline const bool isAuthed() const { return _authed == 2; }
+ inline const QString& name() const { return _name; }
+ inline const QString& host() const { return _host; }
+ inline const QString ip() const { return _socket->peerAddress().toString(); }
+ inline const int id() const { return _id; }
+ inline const int desiredProjectionSource() const { return _desiredProjectionSource; }
+ inline const int currentProjectionSource() const { return _currentProjectionSource; }
+
+ // Setters
+ inline void setProjectionSource(bool enable) { _isProjectionSource = enable; }
+ inline void setDesiredProjectionSource(int source) { _desiredProjectionSource = source; }
+ inline void setTutor(bool enable){ _isTutor = enable; }
+
+ // To be replaced by states
inline const bool isActiveVncClient() const { return _activeVncClient; }
inline const bool isActiveVncServer() const { return _vncPort > 0; }
- inline const int desiredProjectionSource() const { return _desiredProjectionSource; }
- inline void setDesiredProjectionSource(int source) { _desiredProjectionSource = source; }
inline const bool isProjectionSource() const { return _isProjectionSource; }
- inline void setProjectionSource(bool enable) { _isProjectionSource = enable; }
- inline const int currentProjectionSource() const { return _currentProjectionSource; }
- void setTutor(bool enable);
+
+
//Send message stuff
void startVncServer();
void stopVncServer();
void startVncClient(Client const * const to );
void stopVncClient();
void lockScreen(bool);
+ void requestThumb(const int width, const int height);
private:
QSslSocket * const _socket;
+ State _state;
static int _clientIdCounter;
int _authed; // 0 = challenge sent, awaiting reply 1 = challenge ok, client challenge replied, awaiting login, 2 = ESTABLISHED