1 /***************************************************************************
2 * Copyright (C) 2005-2010 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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
24 #include "networkevent.h"
26 class IrcEvent : public NetworkEvent {
28 explicit IrcEvent(EventManager::EventType type, Network *network, const QString &prefix, const QStringList ¶ms = QStringList())
29 : NetworkEvent(type, network),
34 inline QString prefix() const { return _prefix; }
35 inline void setPrefix(const QString &prefix) { _prefix = prefix; }
37 inline QStringList params() const { return _params; }
38 inline void setParams(const QStringList ¶ms) { _params = params; }
46 class IrcEventNumeric : public IrcEvent {
48 explicit IrcEventNumeric(uint number, Network *network, const QString &prefix, const QString &target, const QStringList ¶ms = QStringList())
49 : IrcEvent(EventManager::IrcEventNumeric, network, prefix, params),
54 inline uint number() const { return _number; }
56 inline QString target() const { return _target; }
57 inline void setTarget(const QString &target) { _target = target; }
65 class IrcEventRawMessage : public IrcEvent {
67 explicit IrcEventRawMessage(EventManager::EventType type, Network *network, const QString &prefix, const QString &target, const QByteArray &rawMessage)
68 : IrcEvent(type, network, prefix, QStringList() << target),
69 _rawMessage(rawMessage)
72 inline QString target() const { return params().at(0); }
73 inline void setTarget(const QString &target) { setParams(QStringList() << target); }
75 inline QByteArray rawMessage() const { return _rawMessage; }
76 inline void setRawMessage(const QByteArray &rawMessage) { _rawMessage = rawMessage; }
79 QByteArray _rawMessage;