LeechCraft Azoth  %{LEECHCRAFT_VERSION}
Modular multiprotocol IM plugin for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
LeechCraft::Azoth::IHaveConsole Class Referenceabstract

Interface for accounts that support protocol consoles. More...

#include "ihaveconsole.h"

Public Types

enum  PacketFormat { PFXML, PFPlainText, PFBinary }
 Defines the format of the packets in this protocol. More...
 
enum  PacketDirection { PDIn, PDOut }
 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...
 
virtual void gotConsolePacket (const QByteArray &packet, int direction, const QString &hrEntryId)=0
 Notifies about new packet. More...
 

Detailed Description

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.

See Also
IAccount

Definition at line 52 of file ihaveconsole.h.

Member Enumeration Documentation

Defines the direction of a packet.

Enumerator
PDIn 

Incoming packet.

PDOut 

Outgoing packet.

Definition at line 83 of file ihaveconsole.h.

Defines the format of the packets in this protocol.

Enumerator
PFXML 

XML packets (like in XMPP).

The packets would be represented as formatted XML text.

PFPlainText 

Plain text packets (like in IRC).

The packets would be represented as unformatted plain text.

PFBinary 

Binary packets (like in Oscar).

The packets would be converted to Base64 or Hex-encoding.

Definition at line 59 of file ihaveconsole.h.

Constructor & Destructor Documentation

virtual LeechCraft::Azoth::IHaveConsole::~IHaveConsole ( )
inlinevirtual

Definition at line 55 of file ihaveconsole.h.

Member Function Documentation

virtual PacketFormat LeechCraft::Azoth::IHaveConsole::GetPacketFormat ( ) const
pure virtual

Returns the packet format used in this account.

Returns
The packet format.
virtual void LeechCraft::Azoth::IHaveConsole::gotConsolePacket ( const QByteArray &  packet,
int  direction,
const QString &  hrEntryId 
)
pure 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.

Note
This function is expected to be a signal.
Parameters
[out]packetThe packet data.
[out]directionThe direction of the packet, member of the PacketDirection enum.
[out]hrEntryIdThe human-readable ID of the related entry, or null string if not applicable.
virtual void LeechCraft::Azoth::IHaveConsole::SetConsoleEnabled ( bool  enabled)
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.

Parameters
[in]enabledWhether the console should be enabled.

The documentation for this class was generated from the following file: