• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tderesources
 

tderesources

  • KRES
  • Manager
Classes | Public Member Functions | List of all members
KRES::Manager< T > Class Template Reference

#include <manager.h>

Inherits KRES::ManagerNotifier.

Classes

class  ActiveIterator
 
class  Iterator
 

Public Member Functions

Iterator begin ()
 
Iterator end ()
 
ActiveIterator activeBegin ()
 
ActiveIterator activeEnd ()
 
bool isEmpty () const
 
 Manager (const TQString &family)
 
void readConfig (TDEConfig *cfg=0)
 
void writeConfig (TDEConfig *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)
 
TQStringList resourceNames () const
 
T * createResource (const TQString &type)
 
TQStringList resourceTypeNames () const
 
TQStringList resourceTypeDescriptions () const
 
void addObserver (ManagerObserver< T > *observer)
 
void removeObserver (ManagerObserver< T > *observer)
 

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 TDEResources/Manager.

Definition at line 79 of file manager.h.

Constructor & Destructor Documentation

◆ Manager()

template<class T >
KRES::Manager< T >::Manager ( const TQString &  family)
inline

Create manager for given resource family.

The family argument is used as identifier for loading and saving resource configurations.

Definition at line 212 of file manager.h.

◆ ~Manager()

template<class T >
virtual KRES::Manager< T >::~Manager ( )
inlinevirtual

Definition at line 221 of file manager.h.

Member Function Documentation

◆ activeBegin()

template<class T >
ActiveIterator KRES::Manager< T >::activeBegin ( )
inline

Return Iterator on first active resource.

If there is no active resource returns end().

Definition at line 180 of file manager.h.

◆ activeEnd()

template<class T >
ActiveIterator KRES::Manager< T >::activeEnd ( )
inline

Return Iterator indicating end of active resource list.

Definition at line 194 of file manager.h.

◆ add()

template<class T >
void KRES::Manager< T >::add ( Resource *  resource)
inline

Add resource to manager.

This passes ownership of the Resource object to the manager.

Definition at line 248 of file manager.h.

◆ addObserver()

template<class T >
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.

Definition at line 350 of file manager.h.

◆ begin()

template<class T >
Iterator KRES::Manager< T >::begin ( )
inline

Return Iterator on first resource.

If there is no resource returns end().

Definition at line 107 of file manager.h.

◆ change()

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 265 of file manager.h.

◆ createResource()

template<class T >
T * KRES::Manager< T >::createResource ( const TQString &  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
typeThe type of the resource, one of those returned by resourceTypeNames()

Definition at line 313 of file manager.h.

◆ end()

template<class T >
Iterator KRES::Manager< T >::end ( )
inline

Return Iterator indicating end of resource list.

Definition at line 117 of file manager.h.

◆ isEmpty()

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 206 of file manager.h.

◆ readConfig()

template<class T >
void KRES::Manager< T >::readConfig ( TDEConfig *  cfg = 0)
inline

Recreate Resource objects from configuration file.

If cfg is 0, read standard configuration file determined by family name.

Definition at line 230 of file manager.h.

◆ remove()

template<class T >
void KRES::Manager< T >::remove ( Resource *  resource)
inline

Remove resource from manager.

This deletes the Resource object.

Definition at line 256 of file manager.h.

◆ removeObserver()

template<class T >
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.

Definition at line 359 of file manager.h.

◆ resourceNames()

template<class T >
TQStringList KRES::Manager< T >::resourceNames ( ) const
inline

Returns a list of the names of the resources managed by the Manager for this family.

Definition at line 298 of file manager.h.

◆ resourceTypeDescriptions()

template<class T >
TQStringList KRES::Manager< T >::resourceTypeDescriptions ( ) const
inline

Return list of descriptions of all available resource types.

Definition at line 329 of file manager.h.

◆ resourceTypeNames()

template<class T >
TQStringList KRES::Manager< T >::resourceTypeNames ( ) const
inline

Returns a list of the names of all available resource types.

Definition at line 321 of file manager.h.

◆ setActive()

template<class T >
void KRES::Manager< T >::setActive ( Resource *  resource,
bool  active 
)
inline

Set active state of resource.

Definition at line 289 of file manager.h.

◆ setStandardResource()

template<class T >
void KRES::Manager< T >::setStandardResource ( T *  resource)
inline

Set standard resource.

Definition at line 281 of file manager.h.

◆ standardResource()

template<class T >
T * KRES::Manager< T >::standardResource ( )
inline

Return standard resource.

Definition at line 273 of file manager.h.

◆ writeConfig()

template<class T >
void KRES::Manager< T >::writeConfig ( TDEConfig *  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 239 of file manager.h.


The documentation for this class was generated from the following file:
  • manager.h

tderesources

Skip menu "tderesources"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

tderesources

Skip menu "tderesources"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tderesources by doxygen 1.9.4
This website is maintained by Timothy Pearson.