KRES::Manager< T > Class Template Reference
This class provides a manager for resources of a specified family.
More...
#include <manager.h>
List of all members.
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().
Definition at line 75 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. Definition at line 208 of file manager.h. |
Member Function Documentation
|
Return Iterator on first active resource.
If there is no active resource returns end(). Definition at line 176 of file manager.h. |
template<class T> |
bool KRES::Manager< T >::isEmpty |
( |
|
) |
const [inline] |
|
|
Return true, if manager doesn't hold any resources.
If there are resources return false. Definition at line 202 of file manager.h. |
template<class T> |
void KRES::Manager< T >::readConfig |
( |
KConfig * |
cfg = 0 |
) |
[inline] |
|
|
Recreate Resource objects from configuration file.
If cfg is 0, read standard configuration file determined by family name. Definition at line 226 of file manager.h. |
template<class T> |
void KRES::Manager< T >::writeConfig |
( |
KConfig * |
cfg = 0 |
) |
[inline] |
|
|
Write configuration of Resource objects to configuration file.
If cfg is 0, write to standard configuration file determined by family name. Definition at line 235 of file manager.h. |
|
Add resource to manager.
This passes ownership of the Resource object to the manager. Definition at line 244 of file manager.h. |
|
Remove resource from manager.
This deletes the Resource object. Definition at line 252 of file manager.h. |
template<class T> |
void KRES::Manager< T >::change |
( |
T * |
resource |
) |
[inline] |
|
|
Call this to notify manager about changes of the configuration of the given resource.
Definition at line 261 of file manager.h. |
template<class T> |
T* KRES::Manager< T >::standardResource |
( |
|
) |
[inline] |
|
|
Return standard resource.
Definition at line 269 of file manager.h. |
template<class T> |
void KRES::Manager< T >::setStandardResource |
( |
T * |
resource |
) |
[inline] |
|
|
Set standard resource.
Definition at line 277 of file manager.h. |
|
Set active state of resource.
Definition at line 285 of file manager.h. |
|
Returns a list of the names of the reources managed by the Manager for this family.
Definition at line 294 of file manager.h. |
|
Creates a new resource of type.
- Parameters:
-
| 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. |
| type | The type of the resource, one of those returned by resourceTypeNames() |
Definition at line 309 of file manager.h. |
|
Returns a list of the names of all available resource types.
Definition at line 317 of file manager.h. |
|
Return list of descriptions of all available resource types.
Definition at line 325 of file manager.h. |
|
Remove Observer for resource changes from manager.
See ManagerObserver. The Observer is not deleted by the Manager after being removed. Definition at line 355 of file manager.h. |
The documentation for this class was generated from the following file:
This file is part of the documentation for kresources Library Version 3.3.0.