20 #ifndef REMOTESYNC_HPP_ 21 #define REMOTESYNC_HPP_ 23 #include "StelModule.hpp" 24 #include "SyncClient.hpp" 25 #include "SyncServer.hpp" 29 #include <QLoggingCategory> 34 Q_DECLARE_LOGGING_CATEGORY(remoteSync)
42 Q_ENUMS(SyncState ClientBehaviour)
68 virtual void init() Q_DECL_OVERRIDE;
69 virtual void update(
double deltaTime) Q_DECL_OVERRIDE;
73 virtual bool configureGui(
bool show=
true) Q_DECL_OVERRIDE;
76 QString getClientServerHost()
const {
return clientServerHost; }
77 int getClientServerPort()
const {
return clientServerPort; }
78 int getServerPort()
const {
return serverPort; }
79 SyncClient::SyncOptions getClientSyncOptions()
const {
return syncOptions; }
80 QStringList getStelPropFilter()
const {
return stelPropFilter; }
81 ClientBehavior getConnectionLostBehavior()
const {
return connectionLostBehavior; }
84 SyncState getState()
const {
return state; }
87 void setClientServerHost(
const QString& clientServerHost);
88 void setClientServerPort(
const int port);
89 void setServerPort(
const int port);
90 void setClientSyncOptions(SyncClient::SyncOptions options);
91 void setStelPropFilter(
const QStringList& stelPropFilter);
105 void connectToServer();
109 void disconnectFromServer();
126 void restoreDefaultSettings();
129 void errorOccurred(
const QString& errorString);
130 void clientServerHostChanged(
const QString& clientServerHost);
131 void clientServerPortChanged(
const int port);
132 void serverPortChanged(
const int port);
133 void clientSyncOptionsChanged(
const SyncClient::SyncOptions options);
134 void stelPropFilterChanged(
const QStringList& stelPropFilter);
138 void stateChanged(RemoteSync::SyncState state);
141 void clientDisconnected(
bool clean);
142 void clientConnected();
144 void setState(RemoteSync::SyncState state);
145 void setError(
const QString& errorString);
149 static QString packStringList(
const QStringList props);
150 static QStringList unpackStringList(
const QString packedProps);
153 QString clientServerHost;
155 int clientServerPort;
158 SyncClient::SyncOptions syncOptions;
159 QStringList stelPropFilter;
163 QTimer reconnectTimer;
178 Q_DECLARE_METATYPE(RemoteSync::SyncState)
180 QDebug
operator<<(QDebug, RemoteSync::SyncState);
183 #include "StelPluginInterface.hpp" 189 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
A client which can connect to a SyncServer to receive state changes, and apply them.
Define the interface to implement when creating a plugin.
virtual StelPluginInfo getPluginInfo() const
Get information about the plugin.
Main class of the RemoteSync plug-in.
This class is used by Qt to manage a plug-in interface.
ClientBehavior
Defines behavior when client connection is lost/server quits.
QDataStream & operator<<(QDataStream &out, const SphericalRegionP ®ion)
Serialize the passed SphericalRegionP into a binary blob.
StelModuleActionName
Define the possible action for which an order is defined.
virtual StelModule * getStelModule() const
Get the instance of StelModule to include in the list of standard StelModule.
This is the common base class for all the main components of stellarium.
Contains information about a Stellarium plugin.
Implements a server to which SyncClients can connect and receive state changes.
virtual QObjectList getExtensionList() const
A mechanism to provide abitrary QObjects to the StelModuleMgr.