LeechCraft Azoth 0.6.70-18808-g3467692359
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
102 enum class SubType : uint8_t
103 {
108
113 };
114
115 enum class EscapePolicy : uint8_t
116 {
119 };
120
123 virtual QObject* GetQObject () = 0;
124
133 virtual void Store () = 0;
134
139 virtual Direction GetDirection () const = 0;
140
145 virtual Type GetMessageType () const = 0;
146
154 virtual SubType GetMessageSubType () const = 0;
155
170 virtual QObject* OtherPart () const = 0;
171
186 virtual QObject* ParentCLEntry () const
187 {
188 return OtherPart ();
189 }
190
197 virtual QString GetOtherVariant () const = 0;
198
206 virtual QString GetBody () const = 0;
207
214 virtual void SetBody (const QString& body) = 0;
215
226 {
228 }
229
234 virtual QDateTime GetDateTime () const = 0;
235
240 virtual void SetDateTime (const QDateTime& timestamp) = 0;
241 };
242}
243}
244
245Q_DECLARE_INTERFACE (LC::Azoth::IMessage,
246 "org.LeechCraft.Azoth.IMessage/1.0")
Represents a single entry in contact list.
Definition iclentry.h:49
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:225
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
@ ParticipantNickChange
Notifies about participant in a MUC changing the nick.
Definition imessage.h:112
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:186
virtual QObject * GetQObject()=0
Returns this message as a QObject.