#include "message.h"
class Identity;
-class NetworkConnection; // FIXME get rid of
+class NetworkConnection;
class Network;
+struct NetworkInfo;
class SignalProxy;
class QScriptEngine;
QVariant sessionState();
- //! Retrieve a piece of session-wide data.
- QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant());
-
SignalProxy *signalProxy() const;
void attachNetworkConnection(NetworkConnection *conn);
void restoreSessionState();
public slots:
- //! Store a piece session-wide data and distribute it to connected clients.
- void storeSessionData(const QString &key, const QVariant &data);
-
void networkStateRequested();
void addClient(QObject *socket);
void connectToNetwork(QString, const QVariant &previousState = QVariant());
void connectToNetwork(NetworkId, const QVariant &previousState = QVariant());
+ void disconnectFromNetwork(NetworkId id);
//void processSignal(ClientSignal, QVariant, QVariant, QVariant);
void sendBacklog(BufferInfo, QVariant, QVariant);
*/
void removeIdentity(IdentityId identity);
+ //! Create a network and propagate the changes to the clients.
+ /** \param info The network's settings.
+ */
+ void createNetwork(const NetworkInfo &info);
+
+ //! Update a network and propagate the changes to the clients.
+ /** \param info The updated network settings.
+ */
+ void updateNetwork(const NetworkInfo &info);
+
+ //! Remove identity and propagate that fact to the clients.
+ /** \param identity The identity to be removed.
+ */
+ void removeNetwork(NetworkId network);
+
signals:
void initialized();
void backlogData(BufferInfo, QVariantList, bool done);
void bufferInfoUpdated(BufferInfo);
- void sessionDataChanged(const QString &key);
- void sessionDataChanged(const QString &key, const QVariant &data);
void scriptResult(QString result);
*/
void identityRemoved(IdentityId identity);
+ void networkCreated(NetworkId);
+ void networkRemoved(NetworkId);
+
private slots:
void recvStatusMsgFromServer(QString msg);
void recvMessageFromServer(Message::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None);
void scriptRequest(QString script);
private:
+ void loadSettings();
void initScriptEngine();
UserId _user;
QHash<NetworkId, Network *> _networks;
QHash<IdentityId, Identity *> _identities;
- QVariantMap sessionData;
-
QScriptEngine *scriptEngine;
};