Event backend porting
[quassel.git] / src / core / coresessioneventprocessor.h
1 /***************************************************************************
2  *   Copyright (C) 2005-2010 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 CORESESSIONEVENTPROCESSOR_H
22 #define CORESESSIONEVENTPROCESSOR_H
23
24 #include "corenetwork.h"
25 #include "networkevent.h"
26
27 class CoreSession;
28 class IrcEvent;
29 class IrcEventNumeric;
30
31 class CoreSessionEventProcessor : public QObject {
32   Q_OBJECT
33
34 public:
35   CoreSessionEventProcessor(CoreSession *session);
36
37   inline CoreSession *coreSession() const { return _coreSession; }
38
39   Q_INVOKABLE void processIrcEventNumeric(IrcEventNumeric *event);
40
41   Q_INVOKABLE void processIrcEventAuthenticate(IrcEvent *event);   // SASL auth
42   Q_INVOKABLE void processIrcEventCap(IrcEvent *event);            // CAP framework
43   Q_INVOKABLE void processIrcEventInvite(IrcEvent *event);
44   Q_INVOKABLE void processIrcEventKick(IrcEvent *event);
45   Q_INVOKABLE void processIrcEventNick(IrcEvent *event);
46   Q_INVOKABLE void processIrcEventPart(IrcEvent *event);
47   Q_INVOKABLE void processIrcEventPong(IrcEvent *event);
48   Q_INVOKABLE void processIrcEventTopic(IrcEvent *event);
49
50   Q_INVOKABLE void processIrcEvent001(IrcEvent *event);            // RPL_WELCOME
51   Q_INVOKABLE void processIrcEvent005(IrcEvent *event);            // RPL_ISUPPORT
52   Q_INVOKABLE void processIrcEvent221(IrcEvent *event);            // RPL_UMODEIS
53   Q_INVOKABLE void processIrcEvent250(IrcEvent *event);            // RPL_STATSCONN
54   Q_INVOKABLE void processIrcEvent265(IrcEvent *event);            // RPL_LOCALUSERS
55   Q_INVOKABLE void processIrcEvent266(IrcEvent *event);            // RPL_GLOBALUSERS
56   Q_INVOKABLE void processIrcEvent301(IrcEvent *event);            // RPL_AWAY
57   Q_INVOKABLE void processIrcEvent305(IrcEvent *event);            // RPL_UNAWAY
58   Q_INVOKABLE void processIrcEvent306(IrcEvent *event);            // RPL_NOWAWAY
59   Q_INVOKABLE void processIrcEvent307(IrcEvent *event);            // RPL_WHOISSERVICE
60   Q_INVOKABLE void processIrcEvent310(IrcEvent *event);            // RPL_SUSERHOST
61   Q_INVOKABLE void processIrcEvent311(IrcEvent *event);            // RPL_WHOISUSER
62   Q_INVOKABLE void processIrcEvent312(IrcEvent *event);            // RPL_WHOISSERVER
63   Q_INVOKABLE void processIrcEvent313(IrcEvent *event);            // RPL_WHOISOPERATOR
64   Q_INVOKABLE void processIrcEvent315(IrcEvent *event);            // RPL_ENDOFWHO
65   Q_INVOKABLE void processIrcEvent317(IrcEvent *event);            // RPL_WHOISIDLE
66   Q_INVOKABLE void processIrcEvent322(IrcEvent *event);            // RPL_LIST
67   Q_INVOKABLE void processIrcEvent323(IrcEvent *event);            // RPL_LISTEND
68   Q_INVOKABLE void processIrcEvent331(IrcEvent *event);            // RPL_NOTOPIC
69   Q_INVOKABLE void processIrcEvent332(IrcEvent *event);            // RPL_TOPIC
70   Q_INVOKABLE void processIrcEvent352(IrcEvent *event);            // RPL_WHOREPLY
71   Q_INVOKABLE void processIrcEvent353(IrcEvent *event);            // RPL_NAMREPLY
72
73   // Q_INVOKABLE void processIrcEvent(IrcEvent *event);
74
75 protected:
76   bool checkParamCount(IrcEvent *event, int minParams);
77   inline CoreNetwork *coreNetwork(NetworkEvent *e) const { return qobject_cast<CoreNetwork *>(e->network()); }
78
79 private:
80   CoreSession *_coreSession;
81 };
82
83 #endif