SyncClient.hpp   SyncClient.hpp 
skipping to change at line 23 skipping to change at line 23
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#ifndef SYNCCLIENT_HPP_ #ifndef SYNCCLIENT_HPP_
#define SYNCCLIENT_HPP_ #define SYNCCLIENT_HPP_
#include <QLoggingCategory>
#include <QObject> #include <QObject>
#include <QTcpSocket> #include <QTcpSocket>
Q_DECLARE_LOGGING_CATEGORY(syncClient)
class SyncMessageHandler; class SyncMessageHandler;
class SyncRemotePeer; class SyncRemotePeer;
//! A client which can connect to a SyncServer to receive state changes, an d apply them //! A client which can connect to a SyncServer to receive state changes, an d apply them
class SyncClient : public QObject class SyncClient : public QObject
{ {
Q_OBJECT Q_OBJECT
Q_FLAGS(SyncOptions)
public: public:
SyncClient(QObject* parent = 0); //! Bitflag-enum which determines the message types the client insta
nce reacts to,
//! and other boolean options
enum SyncOption
{
NONE = 0x0000,
SyncTime = 0x0001,
SyncLocation = 0x0002,
SyncSelection = 0x0004,
SyncStelProperty= 0x0008,
SyncView = 0x0010,
SyncFov = 0x0020,
SkipGUIProps = 0x0040,
ALL = 0xFFFF
};
Q_DECLARE_FLAGS(SyncOptions, SyncOption)
SyncClient(SyncOptions options, const QStringList& excludeProperties
, QObject* parent = Q_NULLPTR);
virtual ~SyncClient(); virtual ~SyncClient();
//! True if the connection has been established completely
bool isConnected() const;
QString errorString() const { return errorStr; } QString errorString() const { return errorStr; }
public slots: public slots:
void connectToServer(const QString& host, const int port); void connectToServer(const QString& host, const int port);
void disconnectFromServer(); void disconnectFromServer();
protected: protected:
void timerEvent(QTimerEvent* evt) Q_DECL_OVERRIDE; void timerEvent(QTimerEvent* evt) Q_DECL_OVERRIDE;
signals: signals:
void connected(); void connected();
void disconnected(); void disconnected(bool cleanExit);
void connectionError();
private slots: private slots:
void dataReceived(); void serverDisconnected(bool clean);
void socketConnected(); void socketConnected();
void socketDisconnected(); void emitServerError(const QString& errorStr);
void socketError(QAbstractSocket::SocketError err);
void emitError(const QString& msg);
private: private:
void checkTimeout(); void checkTimeout();
SyncOptions options;
QStringList stelPropFilter; // list of excluded properties
QString errorStr; QString errorStr;
bool isConnecting; bool isConnecting;
SyncRemotePeer* server; SyncRemotePeer* server;
int timeoutTimerId; int timeoutTimerId;
QVector<SyncMessageHandler*> handlerList; QVector<SyncMessageHandler*> handlerList;
friend class ClientErrorHandler; friend class ClientErrorHandler;
}; };
Q_DECLARE_OPERATORS_FOR_FLAGS(SyncClient::SyncOptions)
#endif #endif
 End of changes. 10 change blocks. 
9 lines changed or deleted 30 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/