LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
ihaveconsole.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 #ifndef PLUGINS_AZOTH_INTERFACES_IHAVECONSOLE_H
10 #define PLUGINS_AZOTH_INTERFACES_IHAVECONSOLE_H
11 #include <QMetaType>
12 
13 namespace LC
14 {
15 namespace Azoth
16 {
31  class IHaveConsole
32  {
33  public:
34  virtual ~IHaveConsole () {}
35 
38  enum class PacketFormat
39  {
44  XML,
45 
51  PlainText,
52 
57  Binary
58  };
59 
62  enum class PacketDirection
63  {
66  In,
67 
70  Out
71  };
72 
77  virtual PacketFormat GetPacketFormat () const = 0;
78 
94  virtual void SetConsoleEnabled (bool enabled) = 0;
95  protected:
113  virtual void gotConsolePacket (const QByteArray& packet,
114  PacketDirection direction, const QString& hrEntryId) = 0;
115  };
116 }
117 }
118 
119 Q_DECLARE_INTERFACE (LC::Azoth::IHaveConsole,
120  "org.Deviant.LeechCraft.Azoth.IHaveConsole/1.0")
121 
122 #endif
LC::Azoth::IHaveConsole::SetConsoleEnabled
virtual void SetConsoleEnabled(bool enabled)=0
Enables or disables the console.
LC::Azoth::IHaveConsole::GetPacketFormat
virtual PacketFormat GetPacketFormat() const =0
Returns the packet format used in this account.
LC::Azoth::IHaveConsole::gotConsolePacket
virtual void gotConsolePacket(const QByteArray &packet, PacketDirection direction, const QString &hrEntryId)=0
Notifies about new packet.
LC::Azoth::IHaveConsole::PacketFormat
PacketFormat
Defines the format of the packets in this protocol.
Definition: ihaveconsole.h:56
LC::Azoth::IHaveConsole::PacketFormat::PlainText
@ PlainText
Plain text packets (like in IRC).
LC::Azoth::IHaveConsole
Interface for accounts that support protocol consoles.
Definition: ihaveconsole.h:43
LC::Azoth::IHaveConsole::~IHaveConsole
virtual ~IHaveConsole()
Definition: ihaveconsole.h:52
LC::Azoth::IHaveConsole::PacketDirection
PacketDirection
Defines the direction of a packet.
Definition: ihaveconsole.h:80
LC::Azoth::IHaveConsole::PacketFormat::XML
@ XML
XML packets (like in XMPP).
LC::Azoth::IHaveConsole::PacketDirection::In
@ In
Incoming packet.
LC
Definition: activityinfo.h:13
LC::Azoth::IHaveConsole::PacketDirection::Out
@ Out
Outgoing packet.
LC::Azoth::IHaveConsole::PacketFormat::Binary
@ Binary
Binary packets (like in Oscar).