20 #ifndef REMOTESYNC_HPP_ 21 #define REMOTESYNC_HPP_ 26 #include "StelModule.hpp" 54 virtual void init() Q_DECL_OVERRIDE;
55 virtual void update(
double deltaTime) Q_DECL_OVERRIDE;
59 virtual bool configureGui(
bool show=
true) Q_DECL_OVERRIDE;
62 QString getClientServerHost()
const {
return clientServerHost; }
63 int getClientServerPort()
const {
return clientServerPort; }
64 int getServerPort()
const {
return serverPort; }
65 SyncState getState()
const {
return state; }
68 void setClientServerHost(
const QString& clientServerHost);
69 void setClientServerPort(
const int port);
70 void setServerPort(
const int port);
106 void errorOccurred(
const QString errorString);
107 void clientServerHostChanged(
const QString clientServerHost);
108 void clientServerPortChanged(
const int port);
109 void serverPortChanged(
const int port);
110 void stateChanged(RemoteSync::SyncState state);
113 void clientDisconnected();
114 void clientConnected();
115 void clientConnectionFailed();
117 void setState(RemoteSync::SyncState state);
118 void setError(
const QString& errorString);
121 QString clientServerHost;
123 int clientServerPort;
140 Q_DECLARE_METATYPE(RemoteSync::SyncState)
142 QDebug
operator<<(QDebug, RemoteSync::SyncState);
145 #include "StelPluginInterface.hpp" 151 Q_PLUGIN_METADATA(IID StelPluginInterface_iid)
virtual double getCallOrder(StelModuleActionName actionName) const Q_DECL_OVERRIDE
Return the value defining the order of call for the given action For example if stars.callOrder[ActionDraw] == 10 and constellation.callOrder[ActionDraw] == 11, the stars module will be drawn before the constellations.
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 void update(double deltaTime) Q_DECL_OVERRIDE
Update the module with respect to the time.
void restoreDefaultSettings()
Restore the plug-in's settings to the default state.
virtual bool configureGui(bool show=true) Q_DECL_OVERRIDE
Detect or show the configuration GUI elements for the module.
virtual void init() Q_DECL_OVERRIDE
Initialize itself.
Main class of the RemoteSync plug-in.
This class is used by Qt to manage a plug-in interface.
void loadSettings()
Load the plug-in's settings from the configuration file.
void startServer()
Starts the plugin in server mode, on the port specified by the serverPort property.
QDataStream & operator<<(QDataStream &out, const SphericalRegionP ®ion)
Serialize the passed SphericalRegionP into a binary blob.
void stopServer()
Tries to disconnect all current clients and stops the server, returning to the IDLE state...
void disconnectFromServer()
Disconnects from the server and returns to the IDLE state.
StelModuleActionName
Define the possible action for which an order is defined.
This is the common base class for all the main components of stellarium.
void connectToServer()
Connects the plugin to the server specified by the clientServerHost and clientServerPort properties...
Contains information about a Stellarium plugin.
Implements a server to which SyncClients can connect and receive state changes.
void saveSettings()
Save the plug-in's settings to the configuration file.