1 /***************************************************************************
2 * Copyright (C) 2005-2014 by the Quassel Project *
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) version 3. *
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 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19 ***************************************************************************/
21 #ifndef COREUSERINPUTHANDLER_H
22 #define COREUSERINPUTHANDLER_H
24 #include "corebasichandler.h"
25 #include "corenetwork.h"
30 class CoreUserInputHandler : public CoreBasicHandler
35 CoreUserInputHandler(CoreNetwork *parent = 0);
36 inline CoreNetwork *coreNetwork() const { return qobject_cast<CoreNetwork *>(parent()); }
38 void handleUserInput(const BufferInfo &bufferInfo, const QString &text);
41 void handleAway(const BufferInfo &bufferInfo, const QString &text);
42 void handleBan(const BufferInfo &bufferInfo, const QString &text);
43 void handleUnban(const BufferInfo &bufferInfo, const QString &text);
44 void handleCtcp(const BufferInfo &bufferInfo, const QString &text);
45 void handleDelkey(const BufferInfo &bufferInfo, const QString &text);
46 void handleDeop(const BufferInfo& bufferInfo, const QString &nicks);
47 void handleDehalfop(const BufferInfo& bufferInfo, const QString &nicks);
48 void handleDevoice(const BufferInfo& bufferInfo, const QString &nicks);
49 void handleInvite(const BufferInfo &bufferInfo, const QString &text);
50 void handleJoin(const BufferInfo &bufferInfo, const QString &text);
51 void handleKeyx(const BufferInfo &bufferInfo, const QString &text);
52 void handleKick(const BufferInfo &bufferInfo, const QString &text);
53 void handleKill(const BufferInfo &bufferInfo, const QString &text);
54 void handleList(const BufferInfo &bufferInfo, const QString &text);
55 void handleMe(const BufferInfo &bufferInfo, const QString &text);
56 void handleMode(const BufferInfo &bufferInfo, const QString &text);
57 void handleMsg(const BufferInfo &bufferInfo, const QString &text);
58 void handleNick(const BufferInfo &bufferInfo, const QString &text);
59 void handleNotice(const BufferInfo &bufferInfo, const QString &text);
60 void handleOper(const BufferInfo &bufferInfo, const QString &text);
61 void handleOp(const BufferInfo& bufferInfo, const QString &nicks);
62 void handleHalfop(const BufferInfo& bufferInfo, const QString &nicks);
63 void handlePart(const BufferInfo &bufferInfo, const QString &text);
64 void handlePing(const BufferInfo &bufferInfo, const QString &text);
65 void handleQuery(const BufferInfo &bufferInfo, const QString &text);
66 void handleQuit(const BufferInfo &bufferInfo, const QString &text);
67 void handleQuote(const BufferInfo &bufferInfo, const QString &text);
68 void handleSay(const BufferInfo &bufferInfo, const QString &text);
69 void handleSetkey(const BufferInfo &bufferInfo, const QString &text);
70 void handleShowkey(const BufferInfo &bufferInfo, const QString &text);
71 void handleTopic(const BufferInfo &bufferInfo, const QString &text);
72 void handleVoice(const BufferInfo &bufferInfo, const QString &text);
73 void handleWait(const BufferInfo &bufferInfo, const QString &text);
74 void handleWho(const BufferInfo &bufferInfo, const QString &text);
75 void handleWhois(const BufferInfo &bufferInfo, const QString &text);
76 void handleWhowas(const BufferInfo &bufferInfo, const QString &text);
78 void defaultHandler(QString cmd, const BufferInfo &bufferInfo, const QString &text);
80 void issueQuit(const QString &reason);
81 void issueAway(const QString &msg, bool autoCheck = true);
84 void timerEvent(QTimerEvent *event);
87 void doMode(const BufferInfo& bufferInfo, const QChar &addOrRemove, const QChar &mode, const QString &nickList);
88 void banOrUnban(const BufferInfo &bufferInfo, const QString &text, bool ban);
89 void putPrivmsg(const QByteArray &target, const QByteArray &message, Cipher *cipher = 0);
90 int lastParamOverrun(const QString &cmd, const QList<QByteArray> ¶ms);
93 QByteArray encrypt(const QString &target, const QByteArray &message, bool *didEncrypt = 0) const;
97 BufferInfo bufferInfo;
99 Command(const BufferInfo &info, const QString &command) : bufferInfo(info), command(command) {}
103 QHash<int, Command> _delayedCommands;