Adding .desktop file to make packagers moar happy...
[quassel.git] / src / core / ircserverhandler.h
1 /***************************************************************************
2  *   Copyright (C) 2005-08 by the Quassel Project                          *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
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) version 3.                                           *
9  *                                                                         *
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.                          *
14  *                                                                         *
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  ***************************************************************************/
20
21 #ifndef _IRCSERVERHANDLER_H_
22 #define _IRCSERVERHANDLER_H_
23
24 #include "basichandler.h"
25
26 class IrcServerHandler : public BasicHandler {
27   Q_OBJECT
28
29 public:
30   IrcServerHandler(NetworkConnection *parent);
31   ~IrcServerHandler();
32
33   void handleServerMsg(QByteArray rawMsg);
34
35 public slots:
36   void handleJoin(const QString &prefix, const QList<QByteArray> &params);
37   void handleKick(const QString &prefix, const QList<QByteArray> &params);
38   void handleMode(const QString &prefix, const QList<QByteArray> &params);
39   void handleNick(const QString &prefix, const QList<QByteArray> &params);
40   void handleNotice(const QString &prefix, const QList<QByteArray> &params);
41   void handlePart(const QString &prefix, const QList<QByteArray> &params);
42   void handlePing(const QString &prefix, const QList<QByteArray> &params);
43   void handlePrivmsg(const QString &prefix, const QList<QByteArray> &params);
44   void handleQuit(const QString &prefix, const QList<QByteArray> &params);
45   void handleTopic(const QString &prefix, const QList<QByteArray> &params);
46
47   void handle001(const QString &prefix, const QList<QByteArray> &params);   // RPL_WELCOME
48   void handle005(const QString &prefix, const QList<QByteArray> &params);   // RPL_ISUPPORT
49   void handle301(const QString &prefix, const QList<QByteArray> &params);   // RPL_AWAY
50   void handle311(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOISUSER
51   void handle312(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOISSERVER
52   void handle313(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOISOPERATOR
53   void handle314(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOWASUSER
54   void handle315(const QString &prefix, const QList<QByteArray> &params);   // RPL_ENDOFWHO
55   void handle317(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOISIDLE
56   void handle318(const QString &prefix, const QList<QByteArray> &params);   // RPL_ENDOFWHOIS
57   void handle319(const QString &prefix, const QList<QByteArray> &params);   // RPL_WHOISCHANNELS
58   void handle331(const QString &prefix, const QList<QByteArray> &params);   // RPL_NOTOPIC
59   void handle332(const QString &prefix, const QList<QByteArray> &params);   // RPL_TOPIC
60   void handle333(const QString &prefix, const QList<QByteArray> &params);   // Topic set by...
61   void handle352(const QString &prefix, const QList<QByteArray> &params);   //  RPL_WHOREPLY
62   void handle353(const QString &prefix, const QList<QByteArray> &params);   // RPL_NAMREPLY
63   void handle369(const QString &prefix, const QList<QByteArray> &params);   // RPL_ENDOFWHOWAS
64   void handle432(const QString &prefix, const QList<QByteArray> &params);   // ERR_ERRONEUSNICKNAME
65   void handle433(const QString &prefix, const QList<QByteArray> &params);   // ERR_NICKNAMEINUSE
66
67   void defaultHandler(QString cmd, const QString &prefix, const QList<QByteArray> &params);
68
69 signals:
70   void nickChanged(const QString &newNick, const QString &oldNick); // this signal is inteded to rename query buffers in the storage backend
71   
72 private:
73   void tryNextNick(const QString &errnick);
74   bool _whois;
75 };
76
77
78 #endif