Fixing BR #369 (handle onotice/omsg properly, add /notice command)
[quassel.git] / src / core / userinputhandler.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 USERINPUTHANDLER_H
22 #define USERINPUTHANDLER_H
23
24 #include "basichandler.h"
25
26 class Server;
27
28 class UserInputHandler : public BasicHandler {
29   Q_OBJECT
30
31 public:
32   UserInputHandler(NetworkConnection *parent = 0);
33
34   void handleUserInput(const BufferInfo &bufferInfo, const QString &text);
35   
36 public slots:
37   void handleAway(const BufferInfo &bufferInfo, const QString &text);
38   void handleBan(const BufferInfo &bufferInfo, const QString &text);
39   void handleUnban(const BufferInfo &bufferInfo, const QString &text);
40   void handleCtcp(const BufferInfo &bufferInfo, const QString &text);
41   void handleDeop(const BufferInfo &bufferInfo, const QString &text);
42   void handleDevoice(const BufferInfo &bufferInfo, const QString &text);
43   void handleInvite(const BufferInfo &bufferInfo, const QString &text);
44   void handleJoin(const BufferInfo &bufferInfo, const QString &text);
45   void handleKick(const BufferInfo &bufferInfo, const QString &text);
46   void handleKill(const BufferInfo &bufferInfo, const QString &text);
47   void handleList(const BufferInfo &bufferInfo, const QString &text);
48   void handleMe(const BufferInfo &bufferInfo, const QString &text);
49   void handleMode(const BufferInfo &bufferInfo, const QString &text);
50   void handleMsg(const BufferInfo &bufferInfo, const QString &text);
51   void handleNick(const BufferInfo &bufferInfo, const QString &text);
52   void handleNotice(const BufferInfo &bufferInfo, const QString &text);
53   void handleOper(const BufferInfo &bufferInfo, const QString &text);
54   void handleOp(const BufferInfo &bufferInfo, const QString &text);
55   void handlePart(const BufferInfo &bufferInfo, const QString &text);
56   void handlePing(const BufferInfo &bufferInfo, const QString &text);
57   void handleQuery(const BufferInfo &bufferInfo, const QString &text);
58   void handleQuit(const BufferInfo &bufferInfo, const QString &text);
59   void handleQuote(const BufferInfo &bufferInfo, const QString &text);
60   void handleSay(const BufferInfo &bufferInfo, const QString &text);
61   void handleTopic(const BufferInfo &bufferInfo, const QString &text);
62   void handleVoice(const BufferInfo &bufferInfo, const QString &text);
63   void handleWho(const BufferInfo &bufferInfo, const QString &text);
64   void handleWhois(const BufferInfo &bufferInfo, const QString &text);
65   void handleWhowas(const BufferInfo &bufferInfo, const QString &text);
66
67   void defaultHandler(QString cmd, const BufferInfo &bufferInfo, const QString &text);
68
69 private:
70   void expand(const QString &alias, const BufferInfo &bufferInfo, const QString &msg);
71   void banOrUnban(const BufferInfo &bufferInfo, const QString &text, bool ban);
72 };
73
74
75 #endif