1 /***************************************************************************
2 * Copyright (C) 2005-2018 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 ***************************************************************************/
28 class CtcpEvent : public IrcEvent
36 explicit CtcpEvent(EventManager::EventType type, Network *network, const QString &prefix, const QString &target,
37 CtcpType ctcpType, const QString &ctcpCmd, const QString ¶m,
38 const QDateTime ×tamp = QDateTime(), const QUuid &uuid = QUuid())
39 : IrcEvent(type, network, prefix),
46 setTimestamp(timestamp);
50 inline CtcpType ctcpType() const { return _ctcpType; }
51 inline void setCtcpType(CtcpType type) { _ctcpType = type; }
53 inline QString ctcpCmd() const { return _ctcpCmd; }
54 inline void setCtcpCmd(const QString &ctcpCmd) { _ctcpCmd = ctcpCmd; }
56 inline QString target() const { return _target; }
57 inline void setTarget(const QString &target) { _target = target; }
59 inline QString param() const { return _param; }
60 inline void setParam(const QString ¶m) { _param = param; }
62 inline QString reply() const { return _reply; }
63 inline void setReply(const QString &reply) { _reply = reply; }
65 inline QUuid uuid() const { return _uuid; }
66 inline void setUuid(const QUuid &uuid) { _uuid = uuid; }
68 static Event *create(EventManager::EventType type, QVariantMap &map, Network *network);
71 explicit CtcpEvent(EventManager::EventType type, QVariantMap &map, Network *network);
72 void toVariantMap(QVariantMap &map) const;
74 virtual inline QString className() const { return "CtcpEvent"; }
75 virtual inline void debugInfo(QDebug &dbg) const
77 NetworkEvent::debugInfo(dbg);
78 dbg << ", prefix = " << qPrintable(prefix())
79 << ", target = " << qPrintable(target())
80 << ", ctcptype = " << (ctcpType() == Query ? "query" : "reply")
81 << ", cmd = " << qPrintable(ctcpCmd())
82 << ", param = " << qPrintable(param())
83 << ", reply = " << qPrintable(reply());
90 QString _target, _param, _reply;