X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcoresession.h;h=009a2ef20ced28e8dbb2f8bd8738b2d75e05ae8f;hp=66e273546bc20f838947ff1ffb744d2c18321696;hb=902c95728306e5ba115de84800fc8d5d239c9d62;hpb=06a46322b6107fe4a38c310a6292cc1ef3330950 diff --git a/src/core/coresession.h b/src/core/coresession.h index 66e27354..009a2ef2 100644 --- a/src/core/coresession.h +++ b/src/core/coresession.h @@ -34,63 +34,65 @@ class Storage; class CoreSession : public QObject { Q_OBJECT - public: - CoreSession(UserId, Storage *, QObject *parent = 0); - ~CoreSession(); - - QList buffers() const; - UserId userId() const; - QVariant sessionState(); - - public slots: - //! Store a piece session-wide data and distribute it to connected clients. - void storeSessionData(const QString &key, const QVariant &data); - - void addClient(QIODevice *connection); - - public: - //! Retrieve a piece of session-wide data. - QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant()); - - SignalProxy *signalProxy() const; - - public slots: - void connectToNetwork(QString); - //void processSignal(ClientSignal, QVariant, QVariant, QVariant); - void sendBacklog(BufferId, QVariant, QVariant); - void msgFromGui(BufferId, QString message); - void sendServerStates(); - - signals: - void msgFromGui(QString net, QString buf, QString message); - void displayMsg(Message message); - void displayStatusMsg(QString, QString); - - void connectToIrc(QString net); - void disconnectFromIrc(QString net); - void serverStateRequested(); - - void backlogData(BufferId, QVariantList, bool done); - - void bufferIdUpdated(BufferId); - void sessionDataChanged(const QString &key); - void sessionDataChanged(const QString &key, const QVariant &data); - - private slots: - void recvStatusMsgFromServer(QString msg); - void recvMessageFromServer(Message::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None); - void serverConnected(QString net); - void serverDisconnected(QString net); - - private: - UserId user; - - SignalProxy *_signalProxy; - Storage *storage; - QHash servers; - - QVariantMap sessionData; - QMutex mutex; +public: + CoreSession(UserId, Storage *, QObject *parent = 0); + virtual ~CoreSession(); + + uint getNetworkId(const QString &network) const; + QList buffers() const; + UserId userId() const; + QVariant sessionState(); + + //! Retrieve a piece of session-wide data. + QVariant retrieveSessionData(const QString &key, const QVariant &def = QVariant()); + + SignalProxy *signalProxy() const; + + void attachServer(Server *server); + +public slots: + //! Store a piece session-wide data and distribute it to connected clients. + void storeSessionData(const QString &key, const QVariant &data); + + void serverStateRequested(); + + void addClient(QIODevice *connection); + + void connectToNetwork(QString); + + //void processSignal(ClientSignal, QVariant, QVariant, QVariant); + void sendBacklog(BufferInfo, QVariant, QVariant); + void msgFromGui(BufferInfo, QString message); + +signals: + void msgFromGui(uint netid, QString buf, QString message); + void displayMsg(Message message); + void displayStatusMsg(QString, QString); + + void connectToIrc(QString net); + void disconnectFromIrc(QString net); + + void backlogData(BufferInfo, QVariantList, bool done); + + void bufferInfoUpdated(BufferInfo); + void sessionDataChanged(const QString &key); + void sessionDataChanged(const QString &key, const QVariant &data); + +private slots: + void recvStatusMsgFromServer(QString msg); + void recvMessageFromServer(Message::Type, QString target, QString text, QString sender = "", quint8 flags = Message::None); + void serverConnected(uint networkid); + void serverDisconnected(uint networkid); + +private: + UserId user; + + SignalProxy *_signalProxy; + Storage *storage; + QHash servers; + + QVariantMap sessionData; + QMutex mutex; }; #endif