![]() |
LeechCraft Azoth
0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
|
Interface for accounts that support protocol consoles. More...
#include "ihaveconsole.h"
Public Types | |
enum | PacketFormat { PacketFormat::XML, PacketFormat::PlainText, PacketFormat::Binary } |
Defines the format of the packets in this protocol. More... | |
enum | PacketDirection { PacketDirection::In, PacketDirection::Out } |
Defines the direction of a packet. More... | |
Public Member Functions | |
virtual | ~IHaveConsole () |
virtual PacketFormat | GetPacketFormat () const =0 |
Returns the packet format used in this account. More... | |
virtual void | SetConsoleEnabled (bool enabled)=0 |
Enables or disables the console. More... | |
Protected Member Functions | |
virtual void | gotConsolePacket (const QByteArray &packet, PacketDirection direction, const QString &hrEntryId)=0 |
Notifies about new packet. More... | |
Interface for accounts that support protocol consoles.
An example of a protocol console may be an XML console for XMPP protocol or just raw text console for IRC.
The account supporting console notifies about new packets (both incoming and outgoing) by the gotConsolePacket() signal.
Azoth core and other plugins may toggle the status of the console by the means of SetConsoleEnabled() function. By default, the console for each account should be disabled.
Definition at line 43 of file ihaveconsole.h.
|
strong |
Defines the direction of a packet.
Enumerator | |
---|---|
In | Incoming packet. |
Out | Outgoing packet. |
Definition at line 80 of file ihaveconsole.h.
|
strong |
Defines the format of the packets in this protocol.
Definition at line 56 of file ihaveconsole.h.
|
inlinevirtual |
Definition at line 52 of file ihaveconsole.h.
|
pure virtual |
Returns the packet format used in this account.
|
protectedpure virtual |
Notifies about new packet.
This signal is used by the console-supporting account to notify about new packets, both incoming and outgoing.
This signal should be emitted if and only if the console has been explicitly enabled for this account by calling the SetConsoleEnabled() function.
[out] | packet | The packet data. |
[out] | direction | The direction of the packet, member of the PacketDirection enum. |
[out] | hrEntryId | The human-readable ID of the related entry, or null string if not applicable. |
|
pure virtual |
Enables or disables the console.
This function toggles the status of the console for the corresponding account.
If the console is enabled, only this account's packets should be emitted by the gotConsolePacket() signal. If the console is disabled, gotConsolePacket() signal shouldn't be emitted at all.
By default, console for each account should be in disabled state, unless explicitly enabled by calling this function.
[in] | enabled | Whether the console should be enabled. |