LeechCraft Azoth  0.6.70-18450-gabe19ee3b0
Modular multiprotocol IM plugin for LeechCraft
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 
16 class QObject;
17 
18 namespace LC
19 {
20 namespace 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  {
50  In,
51 
54  Out
55  };
56 
59  enum class Type : uint8_t
60  {
64 
72  MUCMessage,
73 
80 
89 
93  };
94 
102  enum class SubType : uint8_t
103  {
107  Other,
108 
112 
116 
134 
139 
143 
147 
152 
156  };
157 
158  enum class EscapePolicy : uint8_t
159  {
160  Escape,
161  NoEscape
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 
268  virtual EscapePolicy GetEscapePolicy () const
269  {
270  return EscapePolicy::Escape;
271  }
272 
277  virtual QDateTime GetDateTime () const = 0;
278 
283  virtual void SetDateTime (const QDateTime& timestamp) = 0;
284  };
285 }
286 }
287 
288 Q_DECLARE_INTERFACE (LC::Azoth::IMessage,
289  "org.LeechCraft.Azoth.IMessage/1.0")
Message in a multiuser conference.
Notifies about changing subject in a MUC room.
virtual QObject * ParentCLEntry() const
Returns the parent CL entry of this message.
Definition: imessage.h:229
virtual Type GetMessageType() const =0
Returns the type of this message.
virtual void Store()=0
Stores the message.
Notifies about participant leaving a MUC room.
virtual QDateTime GetDateTime() const =0
Returns the timestamp of the message.
virtual ~IMessage()
Definition: imessage.h:42
virtual QString GetOtherVariant() const =0
The variant of the other part.
Standard one-to-one message.
virtual EscapePolicy GetEscapePolicy() const
Returns the escape policy of the body.
Definition: imessage.h:268
virtual Direction GetDirection() const =0
Returns the direction of this message.
virtual void SetBody(const QString &body)=0
Updates the body of the message.
virtual QString GetBody() const =0
Returns the body of the message.
SubType
This enum is used for more precise classification of chat types messages.
Definition: imessage.h:102
virtual void SetDateTime(const QDateTime &timestamp)=0
Updates the timestamp of the message.
Represents status change of a participant in a chat or MUC room.
Represents permission changes of a participant in a chat or MUC room.
This interface is used to represent a message.
Definition: imessage.h:39
Various events in a chat.
Notifies about participant joining to a MUC room.
virtual QObject * OtherPart() const =0
Returns the CL entry from which this message is.
Type
Represents possible message types.
Definition: imessage.h:59
Notifies about participant in a MUC changing the nick.
virtual QObject * GetQObject()=0
Returns this message as a QObject.
The message is from the remote party to us.
Direction
Represents the direction of the message.
Definition: imessage.h:46
The message is from us to the remote party.
virtual SubType GetMessageSubType() const =0
Returns the subtype of this message.