Home · Modules · All Classes · All Namespaces
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
Tp::ContactFactory Class Reference

The ContactFactory class is responsible for constructing Contact objects according to application-defined settings. More...

#include <TelepathyQt/ContactFactory>

Inherits Tp::RefCounted.

Public Member Functions

virtual ~ContactFactory ()
 
Features features () const
 
void addFeature (const Feature &feature)
 
void addFeatures (const Features &features)
 
- Public Member Functions inherited from Tp::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 

Static Public Member Functions

static ContactFactoryPtr create (const Features &features=Features())
 

Protected Member Functions

 ContactFactory (const Features &features)
 
virtual ContactPtr construct (ContactManager *manager, const ReferencedHandles &handle, const Features &features, const QVariantMap &attributes) const
 
virtual PendingOperationprepare (const ContactPtr &contact) const
 

Detailed Description

The ContactFactory class is responsible for constructing Contact objects according to application-defined settings.

Constructor & Destructor Documentation

◆ ~ContactFactory()

Tp::ContactFactory::~ContactFactory ( )
virtual

Class destructor.

◆ ContactFactory()

Tp::ContactFactory::ContactFactory ( const Features features)
protected

Class constructor.

Parameters
featuresThe features to make ready on constructed contacts.

Member Function Documentation

◆ create()

ContactFactoryPtr Tp::ContactFactory::create ( const Features features = Features())
static

Creates a new ContactFactory.

Parameters
featuresThe features to make ready on constructed contacts.
Returns
A pointer to the created factory.

◆ features()

Features Tp::ContactFactory::features ( ) const

Gets the features this factory will make ready on constructed contacts.

Returns
The set of features.

◆ addFeature()

void Tp::ContactFactory::addFeature ( const Feature feature)

Adds a single feature this factory will make ready on further constructed contacts.

No feature removal is provided, to guard against uncooperative modules removing features other modules have set and depend on.

Parameters
featureThe feature to add.

◆ addFeatures()

void Tp::ContactFactory::addFeatures ( const Features features)

Adds a set of features this factory will make ready on further constructed contacts.

No feature removal is provided, to guard against uncooperative modules removing features other modules have set and depend on.

Parameters
featuresThe features to add.

◆ construct()

ContactPtr Tp::ContactFactory::construct ( Tp::ContactManager manager,
const ReferencedHandles handle,
const Features features,
const QVariantMap &  attributes 
) const
protectedvirtual

Can be used by subclasses to override the Contact subclass constructed by the factory.

The default implementation constructs Tp::Contact objects.

Parameters
managerThe contact manager this contact belongs.
handleThe contact handle.
featuresThe desired contact features.
attributesThe desired contact attributes.
Returns
A pointer to the constructed contact.

◆ prepare()

PendingOperation * Tp::ContactFactory::prepare ( const ContactPtr &  contact) const
protectedvirtual

Can be used by subclasses to do arbitrary manipulation on constructed Contact objects.

The default implementation does nothing.

Parameters
contactThe contact to be prepared.
Returns
A PendingOperation used to prepare the contact or NULL if there is nothing to prepare.