X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcorenetwork.h;h=005b309ef5c58ccc6c1272257d38c70ed0b8a7ec;hp=f4744d9236c0e227b07407ce47b3cd0a81086f4a;hb=11cecc112915cd9940e7612c05091f9b5bb18b00;hpb=ddeaf866099f56f42bf86b2bfc72a92763c733aa diff --git a/src/core/corenetwork.h b/src/core/corenetwork.h index f4744d92..005b309e 100644 --- a/src/core/corenetwork.h +++ b/src/core/corenetwork.h @@ -26,6 +26,7 @@ #include "coreircuser.h" #include +#include #ifdef HAVE_SSL # include @@ -33,6 +34,7 @@ #else # include #endif +#include #ifdef HAVE_QCA2 # include "cipher.h" @@ -43,6 +45,7 @@ class CoreIdentity; class CoreUserInputHandler; class CoreIgnoreListManager; +class Event; class CoreNetwork : public Network { SYNCABLE_OBJECT @@ -84,6 +87,13 @@ public: inline UserId userId() const { return _coreSession->user(); } + inline QAbstractSocket::SocketState socketState() { return socket.state(); } + inline bool socketConnected() { return socket.state() == QAbstractSocket::ConnectedState; } + inline QHostAddress localAddress() { return socket.localAddress(); } + inline QHostAddress peerAddress() { return socket.peerAddress(); } + inline quint16 localPort() { return socket.localPort(); } + inline quint16 peerPort() { return socket.peerPort(); } + public slots: virtual void setMyNick(const QString &mynick); @@ -144,6 +154,10 @@ signals: void quitRequested(NetworkId networkId); void sslErrors(const QVariant &errorData); + void newEvent(Event *event); + void socketInitialized(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); + void socketDisconnected(const CoreIdentity *identity, const QHostAddress &localAddress, quint16 localPort, const QHostAddress &peerAddress, quint16 peerPort); + protected: inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new CoreIrcChannel(channelname, this); } inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new CoreIrcUser(hostmask, this); }