libkdepim Library API Documentation

KPIM::ResourceFactory Class Reference

Class for loading resource plugins. More...

#include <resourcefactory.h>

List of all members.

Public Member Functions

ResourceConfigWidget * configWidget (const QString &type, QWidget *parent=0)
 Returns the config widget for the given resource type, or a null pointer if resource type doesn't exist.

Resource * resource (const QString &type, const KConfig *config)
 Returns a pointer to a resource object or a null pointer if resource type doesn't exist.

QStringList resources ()
 Returns a list of all available resource types.

ResourceInfo * info (const QString &type)
 Returns the info structure for a special type.


Static Public Member Functions

ResourceFactoryself (QString resourceType)
 Returns the global resource factory.


Protected Member Functions

 ResourceFactory (QString resourceType)

Protected Attributes

QString mResourceType


Detailed Description

Class for loading resource plugins.

Example:

KABC::ResourceFactory<Calendar> *factory = KABC::ResourceFactory<Calendar>::self();

QStringList list = factory->resources(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { Resource<Calendar> *resource = factory->resource( (*it), KABC::StdAddressBook::self(), 0 ); // do something with resource }

Definition at line 59 of file resourcefactory.h.


Member Function Documentation

ResourceFactory * ResourceFactory::self QString  resourceType  )  [static]
 

Returns the global resource factory.

Definition at line 35 of file resourcefactory.cpp.

ResourceConfigWidget * ResourceFactory::configWidget const QString type,
QWidget parent = 0
 

Returns the config widget for the given resource type, or a null pointer if resource type doesn't exist.

Parameters:
type The type of the resource, returned by resources()
parent The parent widget

Definition at line 89 of file resourcefactory.cpp.

References QString::isEmpty().

Resource * ResourceFactory::resource const QString type,
const KConfig *  config
 

Returns a pointer to a resource object or a null pointer if resource type doesn't exist.

Parameters:
type The type of the resource, returned by resources()
ab The address book, the resource should belong to
config The config object where the resource get it settings from

Definition at line 122 of file resourcefactory.cpp.

References QString::isEmpty(), and resource().

Referenced by resource().

QStringList ResourceFactory::resources  ) 
 

Returns a list of all available resource types.

Definition at line 78 of file resourcefactory.cpp.

References QDictIterator::current(), and QDictIterator::currentKey().

ResourceInfo * ResourceFactory::info const QString type  ) 
 

Returns the info structure for a special type.

Definition at line 114 of file resourcefactory.cpp.

References QString::isEmpty().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.4.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Sat Oct 18 02:47:00 2003 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001