KRES::Manager< T > Class Template Reference
This class provides a manager for resources of a specified family. More...
#include <manager.h>
Inheritance diagram for KRES::Manager< T >:


Public Member Functions | |
Iterator | begin () |
Iterator | end () |
ActiveIterator | activeBegin () |
ActiveIterator | activeEnd () |
bool | isEmpty () const |
Manager (const QString &family) | |
virtual | ~Manager () |
void | readConfig (KConfig *cfg=0) |
void | writeConfig (KConfig *cfg=0) |
void | add (Resource *resource) |
void | remove (Resource *resource) |
void | change (T *resource) |
T * | standardResource () |
void | setStandardResource (T *resource) |
void | setActive (Resource *resource, bool active) |
QStringList | resourceNames () const |
T * | createResource (const QString &type) |
QStringList | resourceTypeNames () const |
QStringList | resourceTypeDescriptions () const |
void | addObserver (ManagerObserver< T > *observer) |
void | removeObserver (ManagerObserver< T > *observer) |
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... |
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.
Definition at line 79 of file manager.h.
Constructor & Destructor Documentation
|
Create manager for given resource family. The family argument is used as identifier for loading and saving resource configurations. |
Member Function Documentation
|
Return Iterator on first resource. If there is no resource returns end(). Definition at line 107 of file manager.h. Referenced by KRES::ConfigPage::slotFamilyChanged(). |
|
Return Iterator indicating end of resource list.
Definition at line 117 of file manager.h. Referenced by KRES::ConfigPage::slotFamilyChanged(). |
|
Return Iterator on first active resource. If there is no active resource returns end(). |
|
Return Iterator indicating end of active resource list.
|
|
Return true, if manager doesn't hold any resources. If there are resources return false. Definition at line 206 of file manager.h. Referenced by KRES::ConfigPage::slotFamilyChanged(). |
|
Recreate Resource objects from configuration file. If cfg is 0, read standard configuration file determined by family name. |
|
Write configuration of Resource objects to configuration file. If cfg is 0, write to standard configuration file determined by family name. Definition at line 239 of file manager.h. Referenced by KRES::ConfigPage::slotFamilyChanged(). |
|
Add resource to manager. This passes ownership of the Resource object to the manager. Definition at line 248 of file manager.h. Referenced by KRES::ConfigPage::slotAdd(). |
|
Remove resource from manager. This deletes the Resource object. Definition at line 256 of file manager.h. Referenced by KRES::ConfigPage::slotRemove(). |
|
Call this to notify manager about changes of the configuration of the given resource.
Definition at line 265 of file manager.h. Referenced by KRES::ConfigPage::slotEdit(). |
|
Return standard resource.
Definition at line 273 of file manager.h. Referenced by KRES::ConfigPage::slotFamilyChanged(). |
|
Set standard resource.
Definition at line 281 of file manager.h. Referenced by KRES::ConfigPage::slotStandard(). |
|
Set active state of resource.
|
|
Returns a list of the names of the resources managed by the Manager for this family.
|
|
Creates a new resource of type 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.
Definition at line 313 of file manager.h. Referenced by KRES::ConfigPage::slotAdd(). |
|
Returns a list of the names of all available resource types.
Definition at line 321 of file manager.h. Referenced by KRES::ConfigPage::slotAdd(). |
|
Return list of descriptions of all available resource types.
Definition at line 329 of file manager.h. Referenced by KRES::ConfigPage::slotAdd(). |
|
Add observer for resource changes to manager. See ManagerObserver. The Manager does not take ownership of the Observer object. |
|
Remove Observer for resource changes from manager. See ManagerObserver. The Observer is not deleted by the Manager after being removed. |
The documentation for this class was generated from the following file: