krita

KisGenericRegistry< _T > Class Template Reference

#include <kis_generic_registry.h>

List of all members.


Detailed Description

template<typename _T>
class KisGenericRegistry< _T >

Base class for registry objects in Krita.

Krita registries contain resources such as filters, tools or colorspaces.

Items are mapped by KisID. A KisID is the combination of a non-localized string that can be used in files and a user-visible, translated string that can be used in the user interface.

Definition at line 39 of file kis_generic_registry.h.


Public Member Functions

 KisGenericRegistry ()
virtual ~KisGenericRegistry ()
void add (_T item)
void add (KisID id, _T item)
_T remove (const KisID &name)
_T remove (const QString &id)
_T get (const KisID &name) const
_T get (const QString &id) const
bool exists (const KisID &id) const
bool exists (const QString &id) const
bool search (const QString &t, KisID &result) const
KisIDList listKeys () const

Protected Types

typedef std::map< KisID, _T > storageMap

Protected Member Functions

 KisGenericRegistry (const KisGenericRegistry &)
KisGenericRegistry operator= (const KisGenericRegistry &)

Protected Attributes

storageMap m_storage

Member Function Documentation

template<typename _T>
void KisGenericRegistry< _T >::add KisID  id,
_T  item
[inline]
 

add an object to the registry

Parameters:
id the id of the object
item the item

Definition at line 60 of file kis_generic_registry.h.

template<typename _T>
void KisGenericRegistry< _T >::add _T  item  )  [inline]
 

add an object to the registry

Parameters:
item the item to add (NOTE: _T must have an KisID id() function)

Definition at line 51 of file kis_generic_registry.h.

template<typename _T>
bool KisGenericRegistry< _T >::exists const KisID id  )  const [inline]
 

Parameters:
id 
Returns:
true if there is an object corresponding to id

Definition at line 115 of file kis_generic_registry.h.

template<typename _T>
_T KisGenericRegistry< _T >::get const QString &  id  )  const [inline]
 

Get a single entry based on the identifying part of KisID, not the the descriptive part.

Definition at line 106 of file kis_generic_registry.h.

template<typename _T>
_T KisGenericRegistry< _T >::get const KisID name  )  const [inline]
 

This function allow to get an object from its KisID.

Parameters:
name the KisID of the object
Returns:
_T the object

Definition at line 92 of file kis_generic_registry.h.

template<typename _T>
KisIDList KisGenericRegistry< _T >::listKeys  )  const [inline]
 

This function return a list of all the keys.

Definition at line 147 of file kis_generic_registry.h.

template<typename _T>
_T KisGenericRegistry< _T >::remove const QString &  id  )  [inline]
 

This function remove an item from the registry.

Parameters:
id the identifiant of the object
Returns:
the object which have been remove from the registry and which can be safely delete

Definition at line 83 of file kis_generic_registry.h.

template<typename _T>
_T KisGenericRegistry< _T >::remove const KisID name  )  [inline]
 

This function remove an item from the registry.

Returns:
the object which have been remove from the registry and which can be safely delete

Definition at line 68 of file kis_generic_registry.h.

template<typename _T>
bool KisGenericRegistry< _T >::search const QString &  t,
KisID result
const [inline]
 

This function allow to search a KisID from the name.

Parameters:
t the name to search
result The result is filled in this variable
Returns:
true if the search has been successfull, false otherwise

Definition at line 131 of file kis_generic_registry.h.


The documentation for this class was generated from the following file:
KDE Home | KDE Accessibility Home | Description of Access Keys