LeechCraft Azoth  0.6.70-18450-gabe19ee3b0
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 #pragma once
10 
11 #include <QMetaType>
12 #include <QtPlugin>
13 
14 namespace LC::Azoth
15 {
31  {
32  public:
33  virtual ~IHaveConsole () {}
34 
37  enum class PacketFormat
38  {
43  XML,
44 
50  PlainText,
51 
56  Binary
57  };
58 
61  enum class PacketDirection
62  {
65  In,
66 
69  Out
70  };
71 
76  virtual PacketFormat GetPacketFormat () const = 0;
77 
93  virtual void SetConsoleEnabled (bool enabled) = 0;
94  protected:
112  virtual void gotConsolePacket (const QByteArray& packet,
113  PacketDirection direction, const QString& hrEntryId) = 0;
114  };
115 }
116 
117 Q_DECLARE_INTERFACE (LC::Azoth::IHaveConsole,
118  "org.Deviant.LeechCraft.Azoth.IHaveConsole/1.0")
Interface for accounts that support protocol consoles.
Definition: ihaveconsole.h:30
PacketDirection
Defines the direction of a packet.
Definition: ihaveconsole.h:61
PacketFormat
Defines the format of the packets in this protocol.
Definition: ihaveconsole.h:37
XML packets (like in XMPP).
Binary packets (like in Oscar).
virtual PacketFormat GetPacketFormat() const =0
Returns the packet format used in this account.
virtual void gotConsolePacket(const QByteArray &packet, PacketDirection direction, const QString &hrEntryId)=0
Notifies about new packet.
virtual void SetConsoleEnabled(bool enabled)=0
Enables or disables the console.
Plain text packets (like in IRC).