| # kabc Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# KABC::ResourceFactory Class Reference

Class for loading resource plugins. More...

`#include <resourcefactory.h>`

Collaboration diagram for KABC::ResourceFactory:

[legend]
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, AddressBook *ab, 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
ResourceFactory * | self ()
| Returns the global resource factory.

## Detailed Description

Class for loading resource plugins.

Example:

     KABC::ResourceFactory *factory = KABC::ResourceFactory::self();

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

Definition at line 58 of file resourcefactory.h.

## Member Function Documentation

ResourceFactory * ResourceFactory::self | ( |  | ) | `[static]`

| Returns the global resource factory. Definition at line 37 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 97 of file resourcefactory.cpp. References QString::isEmpty(), and KLibrary::symbol().

Resource * ResourceFactory::resource | ( | const QString & | type,
|  | AddressBook * | ab,
|  | 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 133 of file resourcefactory.cpp. References QString::isEmpty(), resource(), and KLibrary::symbol(). Referenced by resource().

QStringList ResourceFactory::resources | ( |  | ) |

| Returns a list of all available resource types. Definition at line 82 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 125 of file resourcefactory.cpp. References QString::isEmpty().

The documentation for this class was generated from the following files:

- resourcefactory.h
- resourcefactory.cpp

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 13:29:49 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001