Stellarium 0.15.2
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 class SyncClient;
26 class StelCore;
27 
28 class ClientHandler : public QObject, public SyncMessageHandler
29 {
30  Q_OBJECT
31  Q_INTERFACES(SyncMessageHandler)
32 
33 public:
34  ClientHandler();
35  ClientHandler(SyncClient *client);
36 protected:
37  SyncClient* client;
38  StelCore* core;
39 };
40 
42 {
43  Q_OBJECT
44 public:
46  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
47 };
48 
51 {
52  Q_OBJECT
53 public:
55  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
56 signals:
57  void authenticated();
58 };
59 
61 {
62 public:
63  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
64 };
65 
67 {
68 public:
69  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
70 };
71 
73 {
74 public:
75  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
76 };
77 
78 class StelObjectMgr;
79 
81 {
82 public:
84  bool handleMessage(QDataStream &stream, SyncRemotePeer &peer) Q_DECL_OVERRIDE;
85 private:
86  StelObjectMgr* objMgr;
87 };
88 
89 #endif
A client which can connect to a SyncServer to receive state changes, and apply them.
Definition: SyncClient.hpp:30
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
virtual bool handleMessage(QDataStream &stream, SyncRemotePeer &peer)=0
Read a message directly from the stream.
Manage the selection and queries on one or more StelObjects.