kresources
#include <manager.h>

Classes | |
class | ActiveIterator |
Iterator for iterations over only active resources managed by a manager. More... | |
class | Iterator |
Iterator for iterations over all resources managed by a manager. More... | |
Public Member Functions | |
Manager (const QString &family) | |
ActiveIterator | activeBegin () |
ActiveIterator | activeEnd () |
void | add (Resource *resource) |
void | addObserver (ManagerObserver< T > *observer) |
Iterator | begin () |
void | change (T *resource) |
T * | createResource (const QString &type) |
Iterator | end () |
bool | isEmpty () const |
void | readConfig (KConfig *cfg=0) |
void | remove (Resource *resource) |
void | removeObserver (ManagerObserver< T > *observer) |
QStringList | resourceNames () const |
QStringList | resourceTypeDescriptions () const |
QStringList | resourceTypeNames () const |
void | setActive (Resource *resource, bool active) |
void | setStandardResource (T *resource) |
T * | standardResource () |
void | writeConfig (KConfig *cfg=0) |
Detailed Description
template<class T>
class KRES::Manager< T >
This class provides a manager for resources of a specified family.
It takes care of loading and saving resource configurations and provides access to the resources and their attributes. External changes in the resource configuration are notified by the ManagerObserver interface. If your application needs to be notified about resource configuration changes, you have to subclass ManagerObserver and add it to the Manager by addObserver().
Since KDE 3.4 it's required to supply your application with a *.desktop file for each resource family you introduce. The ServiceType should be of KResources/Manager.
Constructor & Destructor Documentation
KRES::Manager< T >::Manager | ( | const QString & | family | ) | [inline] |
Member Function Documentation
ActiveIterator KRES::Manager< T >::activeBegin | ( | ) | [inline] |
ActiveIterator KRES::Manager< T >::activeEnd | ( | ) | [inline] |
void KRES::Manager< T >::add | ( | Resource * | resource | ) | [inline] |
void KRES::Manager< T >::addObserver | ( | ManagerObserver< T > * | observer | ) | [inline] |
Add observer for resource changes to manager.
See ManagerObserver. The Manager does not take ownership of the Observer object.
Iterator KRES::Manager< T >::begin | ( | ) | [inline] |
void KRES::Manager< T >::change | ( | T * | resource | ) | [inline] |
T* KRES::Manager< T >::createResource | ( | const QString & | type | ) | [inline] |
Creates a new resource of type type
with default settings.
The resource is not added to the manager, the application has to do that. Returns a pointer to a resource object or a null pointer if resource type doesn't exist.
- Parameters:
-
type The type of the resource, one of those returned by resourceTypeNames()
Iterator KRES::Manager< T >::end | ( | ) | [inline] |
bool KRES::Manager< T >::isEmpty | ( | ) | const [inline] |
void KRES::Manager< T >::readConfig | ( | KConfig * | cfg = 0 | ) | [inline] |
void KRES::Manager< T >::remove | ( | Resource * | resource | ) | [inline] |
void KRES::Manager< T >::removeObserver | ( | ManagerObserver< T > * | observer | ) | [inline] |
Remove Observer for resource changes from manager.
See ManagerObserver. The Observer is not deleted by the Manager after being removed.
QStringList KRES::Manager< T >::resourceNames | ( | ) | const [inline] |
QStringList KRES::Manager< T >::resourceTypeDescriptions | ( | ) | const [inline] |
QStringList KRES::Manager< T >::resourceTypeNames | ( | ) | const [inline] |
void KRES::Manager< T >::setActive | ( | Resource * | resource, |
bool | active | ||
) | [inline] |
void KRES::Manager< T >::setStandardResource | ( | T * | resource | ) | [inline] |
T* KRES::Manager< T >::standardResource | ( | ) | [inline] |
void KRES::Manager< T >::writeConfig | ( | KConfig * | cfg = 0 | ) | [inline] |
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:59:39 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.