Stellarium  0.16.1
SyncClientHandlers.hpp
1 /*
2  * Stellarium Remote Sync plugin
3  * Copyright (C) 2015 Florian Schaukowitsch
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
18  */
19 
20 #ifndef SYNCCLIENTHANDLERS_HPP_
21 #define SYNCCLIENTHANDLERS_HPP_
22 
23 #include "SyncProtocol.hpp"
24 
25 #include <QRegularExpression>
26 
27 class SyncClient;
28 class StelCore;
29 
30 class ClientHandler : public QObject, public SyncMessageHandler
31 {
32  Q_OBJECT
33  Q_INTERFACES(SyncMessageHandler)
34 
35 public:
36  ClientHandler();
37  ClientHandler(SyncClient *client);
38 protected:
39  SyncClient* client;
40  StelCore* core;
41 };
42 
44 {
45  Q_OBJECT
46 public:
48  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
49 };
50 
53 {
54  Q_OBJECT
55 public:
57  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
58 signals:
59  void authenticated();
60 };
61 
63 {
64 public:
65  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
66 };
67 
69 {
70 public:
71  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
72 };
73 
75 {
76 public:
77  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
78 };
79 
80 class StelObjectMgr;
82 {
83 public:
85  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
86 private:
87  StelObjectMgr* objMgr;
88 };
89 
90 class StelPropertyMgr;
92 {
93 public:
94  ClientStelPropertyUpdateHandler(bool skipGuiProps, const QStringList& excludeProps);
95  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
96 private:
97  StelPropertyMgr* propMgr;
98  QRegularExpression filter;
99 };
100 
101 class StelMovementMgr;
103 {
104 public:
106  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
107 private:
108  StelMovementMgr* mvMgr;
109 };
110 
112 {
113 public:
115  bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
116 private:
117  StelMovementMgr* mvMgr;
118 };
119 
120 #endif
A client which can connect to a SyncServer to receive state changes, and apply them.
Definition: SyncClient.hpp:33
virtual bool handleMessage(QDataStream &stream, SyncProtocol::tPayloadSize dataSize, SyncRemotePeer &peer)=0
Read a message directly from the stream.
Base interface for message handlers, i.e. reacting to messages.
Reacts to Server challenge and challenge OK on the client.
Handling the connection to a remote peer (i.e. all clients on the server, and the server on the clien...
Main class for Stellarium core processing.
Definition: StelCore.hpp:48
Manages the head movements and zoom operations.
Manages the registration of specific object properties with the StelProperty system.
Manage the selection and queries on one or more StelObjects.