LeechCraft Azoth  %{LEECHCRAFT_VERSION}
Modular multiprotocol IM plugin for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
imessage.h
Go to the documentation of this file.
1 /**********************************************************************
2  * LeechCraft - modular cross-platform feature rich internet client.
3  * Copyright (C) 2006-2013 Georg Rudoy
4  *
5  * Boost Software License - Version 1.0 - August 17th, 2003
6  *
7  * Permission is hereby granted, free of charge, to any person or organization
8  * obtaining a copy of the software and accompanying documentation covered by
9  * this license (the "Software") to use, reproduce, display, distribute,
10  * execute, and transmit the Software, and to prepare derivative works of the
11  * Software, and to permit third-parties to whom the Software is furnished to
12  * do so, all subject to the following:
13  *
14  * The copyright notices in the Software and this entire statement, including
15  * the above license grant, this restriction and the following disclaimer,
16  * must be included in all copies of the Software, in whole or in part, and
17  * all derivative works of the Software, unless such copies or derivative
18  * works are solely in the form of machine-executable object code generated by
19  * a source language processor.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23  * FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
24  * SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
25  * FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27  * DEALINGS IN THE SOFTWARE.
28  **********************************************************************/
29 
30 #ifndef PLUGINS_AZOTH_INTERFACES_IMESSAGE_H
31 #define PLUGINS_AZOTH_INTERFACES_IMESSAGE_H
32 #include <QString>
33 #include <QDateTime>
34 #include <QtPlugin>
35 
36 class QObject;
37 
38 namespace LeechCraft
39 {
40 namespace Azoth
41 {
42  class ICLEntry;
43 
62  class IMessage
63  {
64  public:
65  virtual ~IMessage () {};
66 
69  enum Direction
70  {
73  DIn,
74 
78  };
79 
83  {
87 
96 
103 
112 
116  };
117 
126  {
131 
135 
139 
157 
162 
166 
170 
175 
179 
183  };
184 
187  virtual QObject* GetQObject () = 0;
188 
197  virtual void Send () = 0;
198 
207  virtual void Store () = 0;
208 
213  virtual Direction GetDirection () const = 0;
214 
219  virtual MessageType GetMessageType () const = 0;
220 
228  virtual MessageSubType GetMessageSubType () const = 0;
229 
244  virtual QObject* OtherPart () const = 0;
245 
260  virtual QObject* ParentCLEntry () const
261  {
262  return OtherPart ();
263  }
264 
271  virtual QString GetOtherVariant () const = 0;
272 
280  virtual QString GetBody () const = 0;
281 
288  virtual void SetBody (const QString& body) = 0;
289 
294  virtual QDateTime GetDateTime () const = 0;
295 
300  virtual void SetDateTime (const QDateTime& timestamp) = 0;
301  };
302 }
303 }
304 
306  "org.Deviant.LeechCraft.Azoth.IMessage/1.0");
307 
308 #endif
virtual void SetDateTime(const QDateTime &timestamp)=0
Updates the timestamp of the message.
Q_DECLARE_INTERFACE(LeechCraft::Azoth::IAccount,"org.Deviant.LeechCraft.Azoth.IAccount/1.0")
Notifies about participant joining to a MUC room.
Definition: imessage.h:165
virtual MessageType GetMessageType() const =0
Returns the type of this message.
virtual Direction GetDirection() const =0
Returns the direction of this message.
Notifies about participant leaving a MUC room.
Definition: imessage.h:169
virtual void SetBody(const QString &body)=0
Updates the body of the message.
The message is from us to the remote party.
Definition: imessage.h:77
Standard one-to-one message.
Definition: imessage.h:86
The participant has ended the conversation.
Definition: imessage.h:178
virtual QDateTime GetDateTime() const =0
Returns the timestamp of the message.
MessageSubType
This enum is used for more precise classification of chat types messages.
Definition: imessage.h:125
Message in a multiuser conference.
Definition: imessage.h:95
Represents permission changes of a participant in a chat or MUC room.
Definition: imessage.h:161
virtual QObject * GetQObject()=0
Returns this message as a QObject.
virtual QString GetOtherVariant() const =0
The variant of the other part.
virtual void Send()=0
Sends the message.
Notifies about changing subject in a MUC room.
Definition: imessage.h:182
virtual QString GetBody() const =0
Returns the body of the message.
Various events in a chat.
Definition: imessage.h:111
The message is from the remote party to us.
Definition: imessage.h:73
Direction
Represents the direction of the message.
Definition: imessage.h:69
virtual void Store()=0
Stores the message.
Represents status change of a participant in a chat or MUC room.
Definition: imessage.h:156
virtual MessageSubType GetMessageSubType() const =0
Returns the subtype of this message.
virtual QObject * OtherPart() const =0
Returns the CL entry from which this message is.
Notifies about participant in a MUC changing the nick.
Definition: imessage.h:174
MessageType
Represents possible message types.
Definition: imessage.h:82
This interface is used to represent a message.
Definition: imessage.h:62
virtual QObject * ParentCLEntry() const
Returns the parent CL entry of this message.
Definition: imessage.h:260