LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IEntityManager Class Referenceabstract

Proxy to core entity manager. More...

#include "ientitymanager.h"

Classes

struct  DelegationResult
 The result of delegating this entity to another plugin. More...
 

Public Member Functions

virtual ~IEntityManager ()
 
virtual DelegationResult DelegateEntity (LC::Entity entity, QObject *desired=nullptr)=0
 Delegates the given entity and returns the delegation result. More...
 
virtual bool HandleEntity (LC::Entity entity, QObject *desired=nullptr)=0
 Handles the given entity. More...
 
virtual bool CouldHandle (const LC::Entity &entity)=0
 Queries whether the given entity can be handled at all. More...
 
virtual QList< QObject * > GetPossibleHandlers (const LC::Entity &entity)=0
 Queries what plugins can handle the given entity. More...
 

Detailed Description

Proxy to core entity manager.

Core entity manager is that very thing that routes entities between different plugins and chooses which plugins will handle what entity.

This class can be used instead of the more or less deprecated IInfo::gotEntity() signal.

See also
Entity, IInfo

Definition at line 31 of file ientitymanager.h.

Constructor & Destructor Documentation

◆ ~IEntityManager()

virtual IEntityManager::~IEntityManager ( )
inlinevirtual

Definition at line 54 of file ientitymanager.h.

Member Function Documentation

◆ CouldHandle()

virtual bool IEntityManager::CouldHandle ( const LC::Entity entity)
pure virtual

Queries whether the given entity can be handled at all.

Parameters
[in]entityThe entity to test.
Returns
Whether there is at least one plugin to handle this entity.

◆ DelegateEntity()

virtual DelegationResult IEntityManager::DelegateEntity ( LC::Entity  entity,
QObject *  desired = nullptr 
)
pure virtual

Delegates the given entity and returns the delegation result.

Queries all plugins if they can handle the given entity, and chooses one of them. If the desired object is set, this method first tries to handle the entity with it. Returns a structure describing the delegation result.

This function shall only be called from the UI thread.

Parameters
[in]entityThe entity to handle.
[in]desiredThe object to try first.
Returns
A structure descripting the result of the delegation request.
See also
DelegationResult

◆ GetPossibleHandlers()

virtual QList<QObject*> IEntityManager::GetPossibleHandlers ( const LC::Entity entity)
pure virtual

Queries what plugins can handle the given entity.

Parameters
[in]entityThe entity to test.
Returns
The list of plugin instances that can handle the given entity.

Referenced by LC::Util::GetDataFilters().

+ Here is the caller graph for this function:

◆ HandleEntity()

virtual bool IEntityManager::HandleEntity ( LC::Entity  entity,
QObject *  desired = nullptr 
)
pure virtual

Handles the given entity.

Queries all plugins if they can handle the given entity, and chooses one of them (or all of them, according to entity flags and plugins' behavior). If the desired object is set, this method first tries to handle the entity with it.

It is safe to call this method from non-UI threads.

Parameters
[in]entityThe entity to handle.
[in]desiredThe object to try first.
Returns
If the entity has been handled successfully.

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