LeechCraft Azoth  0.6.70-15082-g543737046d
Modular multiprotocol IM plugin for LeechCraft
LC::Azoth::IHaveServiceDiscovery Class Referenceabstract

Interface for accounts supporting service discovery. More...

#include "ihaveservicediscovery.h"

Public Member Functions

virtual ~IHaveServiceDiscovery ()
 
virtual QObject * CreateSDSession ()=0
 Creates a new service discovery session. More...
 
virtual QString GetDefaultQuery () const =0
 Returns the default query for this account. More...
 
virtual void gotSDSession (QObject *session)=0
 Notifies about a new service discovery session. More...
 

Detailed Description

Interface for accounts supporting service discovery.

Service discovery is a mechanism that allows one to discover the capabilities and items of remote contacts and other entities. For example, through service discovery it may be possible to fetch the list of MUC participants without joining the MUC, to register on a gateway into another protocol, and such.

The list of features, capabilities and such is represented via a model (as by Qt's MVC), and each capability (an index in that model) may have an action, like viewing information, registering on a gateway, and such.

Since there may be several service discovery sessions active at a time, the account implementing IHaveServiceDiscovery serves merely as service discovery session factory.

Whenever a service discovery session is needed by the core or other plugins, CreateSDSession() is called and it is expected to return an object representing a service discovery session and implementing ISDSession.

Service discovery session may also be created by the plugin itself. For that, the plugin should create an object representing a service discovery session and emit the gotSDSession() signal.

Azoth architecture and implementation is done with the XMPP protocol in mind.

See also
IAccount, ISDSession

Definition at line 157 of file ihaveservicediscovery.h.

Constructor & Destructor Documentation

◆ ~IHaveServiceDiscovery()

virtual LC::Azoth::IHaveServiceDiscovery::~IHaveServiceDiscovery ( )
inlinevirtual

Definition at line 160 of file ihaveservicediscovery.h.

Member Function Documentation

◆ CreateSDSession()

virtual QObject* LC::Azoth::IHaveServiceDiscovery::CreateSDSession ( )
pure virtual

Creates a new service discovery session.

This function is called by Azoth core or other plugins whenever a new service discovery session is required. This function is expected to return an object implementing ISDSession.

The ownership of the returned object is passed to the caller.

Returns
An object implementing ISDSession.
See also
ISDSession, gotSDSession()

◆ GetDefaultQuery()

virtual QString LC::Azoth::IHaveServiceDiscovery::GetDefaultQuery ( ) const
pure virtual

Returns the default query for this account.

The returned query (if non-empty) will be used to initiate service discovery upon opening the service discovery tab for this account.

For example, an XMPP account would wish to return the user's server as default query.

Returns
The default query.

◆ gotSDSession()

virtual void LC::Azoth::IHaveServiceDiscovery::gotSDSession ( QObject *  session)
pure virtual

Notifies about a new service discovery session.

This signal should be emitted when the account itself has created a service discovery session and wants to notify the rest of Azoth about it.

The ownership of session is passed to the Azoth core.

Parameters
[out]sessionThe newly created SD session implementing ISDSession.
See also
CreateSDSession()

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