Albert
Loading...
Searching...
No Matches
albert::ExtensionRegistry Class Reference

#include <albert/extensionregistry.h>

Inheritance diagram for albert::ExtensionRegistry:

Detailed Description

The common extension pool.

Clients can add their extensions, while services can track extensions by listening to the signals added/removed or any particular extension interface using ExtensionWatcher.

Use in the main thread only!

Signals

void added (Extension *)
 Emitted when an extension has been registered.
 
void removed (Extension *)
 Emitted when an extension has been deregistered.
 

Public Member Functions

bool registerExtension (Extension *)
 Add extension to the registry.
 
void deregisterExtension (Extension *)
 Remove extension from the registry.
 
const std::map< QString, Extension * > & extensions ()
 Get map of all registered extensions.
 
template<typename T >
std::map< QString, T * > extensions ()
 Get map of all extensions of type T.
 
template<typename T >
T * extension (const QString &id)
 Get extension by id implicitly dynamic_cast'ed to type T.
 

Member Function Documentation

◆ added

void albert::ExtensionRegistry::added ( Extension )
signal

Emitted when an extension has been registered.

◆ deregisterExtension()

void albert::ExtensionRegistry::deregisterExtension ( Extension )

Remove extension from the registry.

◆ extension()

template<typename T >
T * albert::ExtensionRegistry::extension ( const QString &  id)
inline

Get extension by id implicitly dynamic_cast'ed to type T.

◆ extensions() [1/2]

const std::map< QString, Extension * > & albert::ExtensionRegistry::extensions ( )

Get map of all registered extensions.

◆ extensions() [2/2]

template<typename T >
std::map< QString, T * > albert::ExtensionRegistry::extensions ( )
inline

Get map of all extensions of type T.

◆ registerExtension()

bool albert::ExtensionRegistry::registerExtension ( Extension )

Add extension to the registry.

◆ removed

void albert::ExtensionRegistry::removed ( Extension )
signal

Emitted when an extension has been deregistered.


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