LeechCraft Azoth  0.6.70-3565-g2d86529
Modular multiprotocol IM plugin for LeechCraft
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
LeechCraft::Azoth::IHistoryPlugin Class Referenceabstract

Interface for plugins storing chat history. More...

#include "ihistoryplugin.h"

Public Member Functions

virtual ~IHistoryPlugin ()
 
virtual bool IsHistoryEnabledFor (QObject *entry) const =0
 Whether history is enabled for the given entry. More...
 
virtual void RequestLastMessages (QObject *entry, int num)=0
 Requests last messages for the given entry. More...
 
virtual void AddRawMessage (const QVariantMap &rawMsg)=0
 Adds a raw message to the history. More...
 
virtual void gotLastMessages (QObject *entry, const QList< QObject * > &messages)=0
 Notifies about last messages for the given entry. More...
 

Detailed Description

Interface for plugins storing chat history.

This interface should be implemented by plugins that store chat history for Azoth to provide additional features using these plugins.

Definition at line 47 of file ihistoryplugin.h.

Constructor & Destructor Documentation

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

Definition at line 50 of file ihistoryplugin.h.

Member Function Documentation

virtual void LeechCraft::Azoth::IHistoryPlugin::AddRawMessage ( const QVariantMap &  rawMsg)
pure virtual

Adds a raw message to the history.

The raw message is stored in the rawMsg map. The map contains the following keys:

  • "EntryID" of type QString: the unique ID of the entry.
  • "AccountID" of type QString: the unique ID of the corresponding account.
  • "DateTime" of type QDateTime: the timestamp of the message.
  • "Direction" of type QString: either "in" or "out".
  • "Body" of type QString: the contents of the message.
  • "OtherVariant" of type QString: the variant of the entry that has sent the message.
  • "Type" of type int: the type of the message.
  • "VisibleName" of type QString: the human-readable name of the entry.
Parameters
[in]rawMsgThe variant map containing the raw message description.
virtual void LeechCraft::Azoth::IHistoryPlugin::gotLastMessages ( QObject *  entry,
const QList< QObject * > &  messages 
)
pure virtual

Notifies about last messages for the given entry.

This signal should be emitted when last chat messages with the given entry have been retrieved from the history as the result of the call to RequestLastMessages().

If there are no messages for the entry, the implementation may either emit this signal with empty messages list or choose to not emit any signals at all.

Note
This function is expected to be a signal.
See Also
RequestLastMessages()
virtual bool LeechCraft::Azoth::IHistoryPlugin::IsHistoryEnabledFor ( QObject *  entry) const
pure virtual

Whether history is enabled for the given entry.

This method checks if history logging is enabled for the given entry.

Parameters
[in]entryThe entry to check (implements ICLEntry).
Returns
Whether history logging is enabled for this entry.
virtual void LeechCraft::Azoth::IHistoryPlugin::RequestLastMessages ( QObject *  entry,
int  num 
)
pure virtual

Requests last messages for the given entry.

This method, when called, requests last num messages from the chat log with the entry.

This method is asynchronous: it is expected to return soon after being called, and the result is expected to be emitted via the gotLastMessages() signal.

Parameters
[in]entryThe entry for which to query the history (implements ICLEntry).
[in]numThe maximum number of messages to retrieve.
See Also
gotLastMessages()

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