LeechCraft Azoth 0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
Loading...
Searching...
No Matches
imessage.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <QString>
12#include <QDateTime>
13#include <QtPlugin>
14#include "messagebase.h"
15
16class QObject;
17
18namespace LC
19{
20namespace Azoth
21{
22 class ICLEntry;
23
39 class IMessage : public MessageBase
40 {
41 public:
42 virtual ~IMessage () {};
43
46 enum class Direction : uint8_t
47 {
51
55 };
56
59 enum class Type : uint8_t
60 {
64
73
80
89
93 };
94
157
158 enum class EscapePolicy : uint8_t
159 {
162 };
163
166 virtual QObject* GetQObject () = 0;
167
176 virtual void Store () = 0;
177
182 virtual Direction GetDirection () const = 0;
183
188 virtual Type GetMessageType () const = 0;
189
197 virtual SubType GetMessageSubType () const = 0;
198
213 virtual QObject* OtherPart () const = 0;
214
229 virtual QObject* ParentCLEntry () const
230 {
231 return OtherPart ();
232 }
233
240 virtual QString GetOtherVariant () const = 0;
241
249 virtual QString GetBody () const = 0;
250
257 virtual void SetBody (const QString& body) = 0;
258
269 {
271 }
272
277 virtual QDateTime GetDateTime () const = 0;
278
283 virtual void SetDateTime (const QDateTime& timestamp) = 0;
284 };
285}
286}
287
288Q_DECLARE_INTERFACE (LC::Azoth::IMessage,
289 "org.LeechCraft.Azoth.IMessage/1.0")
Represents a single entry in contact list.
Definition iclentry.h:57
This interface is used to represent a message.
Definition imessage.h:40
virtual Direction GetDirection() const =0
Returns the direction of this message.
virtual EscapePolicy GetEscapePolicy() const
Returns the escape policy of the body.
Definition imessage.h:268
virtual QDateTime GetDateTime() const =0
Returns the timestamp of the message.
Type
Represents possible message types.
Definition imessage.h:60
@ StatusMessage
Status changes in a chat.
Definition imessage.h:79
@ EventMessage
Various events in a chat.
Definition imessage.h:88
@ ChatMessage
Standard one-to-one message.
Definition imessage.h:63
@ MUCMessage
Message in a multiuser conference.
Definition imessage.h:72
virtual Type GetMessageType() const =0
Returns the type of this message.
virtual QString GetBody() const =0
Returns the body of the message.
virtual ~IMessage()
Definition imessage.h:42
virtual QString GetOtherVariant() const =0
The variant of the other part.
virtual void SetBody(const QString &body)=0
Updates the body of the message.
virtual void Store()=0
Stores the message.
virtual SubType GetMessageSubType() const =0
Returns the subtype of this message.
virtual void SetDateTime(const QDateTime &timestamp)=0
Updates the timestamp of the message.
virtual QObject * OtherPart() const =0
Returns the CL entry from which this message is.
SubType
This enum is used for more precise classification of chat types messages.
Definition imessage.h:103
@ ParticipantLeave
Notifies about participant leaving a MUC room.
Definition imessage.h:146
@ ParticipantNickChange
Notifies about participant in a MUC changing the nick.
Definition imessage.h:151
@ ParticipantJoin
Notifies about participant joining to a MUC room.
Definition imessage.h:142
@ RoomSubjectChange
Notifies about changing subject in a MUC room.
Definition imessage.h:155
@ ParticipantRoleAffiliationChange
Represents permission changes of a participant in a chat or MUC room.
Definition imessage.h:138
@ ParticipantStatusChange
Represents status change of a participant in a chat or MUC room.
Definition imessage.h:133
Direction
Represents the direction of the message.
Definition imessage.h:47
@ Out
The message is from us to the remote party.
Definition imessage.h:54
@ In
The message is from the remote party to us.
Definition imessage.h:50
virtual QObject * ParentCLEntry() const
Returns the parent CL entry of this message.
Definition imessage.h:229
virtual QObject * GetQObject()=0
Returns this message as a QObject.