kresources Library API Documentation

KRES::Factory Class Reference

Class for loading resource plugins. More...

#include <factory.h>

List of all members.

Public Member Functions

ConfigWidget * configWidget (const QString &type, QWidget *parent=0)
Resourceresource (const QString &type, const KConfig *config)
QStringList typeNames () const
QString typeName (const QString &type) const
QString typeDescription (const QString &type) const

Static Public Member Functions

Factoryself (const QString &resourceFamily)

Protected Member Functions

 Factory (const QString &resourceFamily)


Detailed Description

Class for loading resource plugins.

Use this class if you need resources with special settings, otherwise use KRES::Manager::createResource() to get resources with the default settings.

Example:

KABC::Factory *factory = KABC::Factory::self( "contact" ); // to allow a transparent configuration of resources, we have // to use a kconfig object. KConfig config( "tst" ); config.writeEntry( "FileName", "/home/foobar/test.vcf" ); // resource dependend config.writeEntry( "FileFormat", "vcard" ); // resource dependend KABC::Resource *res = factory->resource( "file", &config ); // do something with resource

Definition at line 62 of file factory.h.


Member Function Documentation

Factory * Factory::self const QString resourceFamily  )  [static]
 

Returns the global resource factory.

Definition at line 40 of file factory.cpp.

References QDict< Factory >::find(), and QDict< Factory >::insert().

Referenced by KRES::Manager< Resource >::Manager().

ConfigWidget * Factory::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 typeNames()
parent The parent widget

Definition at line 80 of file factory.cpp.

References QString::isEmpty().

Resource * Factory::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 typeNames()
config The config object where the resource get it settings from, or 0 if a resource with default values should be created.

Definition at line 129 of file factory.cpp.

References QString::isEmpty(), and KRES::Resource::setType().

Referenced by KRES::Manager< Resource >::createResource().

QStringList Factory::typeNames  )  const
 

Returns a list of all available resource types.

Definition at line 75 of file factory.cpp.

Referenced by KRES::Manager< Resource >::resourceTypeDescriptions(), and KRES::Manager< Resource >::resourceTypeNames().

QString Factory::typeName const QString type  )  const
 

Returns the name for a special type.

Definition at line 111 of file factory.cpp.

References QString::isEmpty().

Referenced by KRES::Manager< Resource >::resourceTypeDescriptions().

QString Factory::typeDescription const QString type  )  const
 

Returns the description for a special type.

Definition at line 120 of file factory.cpp.

References QString::isEmpty().

Referenced by KRES::Manager< Resource >::resourceTypeDescriptions().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kresources Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Apr 21 18:44:13 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003