1 /***************************************************************************
2 * Copyright (C) 2005/06 by The Quassel Team *
3 * devel@quassel-irc.org *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
27 #define DEFAULT_PORT 6667
30 * This is a server object, managing a single connection to an IRC server, handling the associated channels and so on.
31 * We have this run in its own thread mainly to not block other server objects or the core if something goes wrong,
32 * e.g. if some scripts starts running wild...
35 class Server : public QThread {
44 // serverState state();
47 // void setServerOptions();
48 void connectToIrc(const QString &host, quint16 port = DEFAULT_PORT);
49 void disconnectFromIrc();
51 void putRawLine(const QString &input /*, Buffer *source = 0 */);
54 //void outputLine(const QString & /*, Buffer *target = 0 */);
56 void recvLine(const QString&);
60 void socketError(QAbstractSocket::SocketError);
61 void socketConnected();
62 void socketDisconnected();
63 void socketStateChanged(QAbstractSocket::SocketState);
72 class TcpConnection : public QThread {
78 QAbstractSocket::SocketState state() const;
81 void connectToHost(const QString &host, quint16 port = DEFAULT_PORT);
82 void disconnectFromHost();
83 void sendLine(const QString &);
86 void recvLine(QString);
87 void error(QAbstractSocket::SocketError);
90 void stateChanged(QAbstractSocket::SocketState);