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 ***************************************************************************/
21 #ifndef MESSAGEEVENT_H
22 #define MESSAGEEVENT_H
25 #include "networkevent.h"
27 // this corresponds to CoreSession::RawMessage for now and should contain the information we need to convert events
28 // into messages for the legacy code to work with
30 class MessageEvent : public NetworkEvent {
33 explicit MessageEvent(Message::Type msgType,
36 const QString &target = QString(),
37 const QString &sender = QString(),
38 Message::Flags msgFlags = Message::None
41 inline Message::Type msgType() const { return _msgType; }
42 inline void setMsgType(Message::Type type) { _msgType = type; }
44 inline BufferInfo::Type bufferType() const { return _bufferType; }
45 inline void setBufferType(BufferInfo::Type type) { _bufferType = type; }
47 inline QString target() const { return _target; }
48 inline QString text() const { return _text; }
49 inline QString sender() const { return _sender; }
51 inline Message::Flags msgFlags() const { return _msgFlags; }
52 inline void setMsgFlag(Message::Flag flag) { _msgFlags |= flag; }
53 inline void setMsgFlags(Message::Flags flags) { _msgFlags = flags; }
56 BufferInfo::Type bufferTypeByTarget(const QString &target) const;
58 Message::Type _msgType;
59 BufferInfo::Type _bufferType;
60 QString _text, _target, _sender;
61 Message::Flags _msgFlags;