kabc Library API Documentation

KABC::FormatFactory Class Reference

Class for loading format plugins. More...

#include <formatfactory.h>

List of all members.

Public Member Functions

 ~FormatFactory ()
FormatPluginformat (const QString &type)
QStringList formats ()
FormatInfoinfo (const QString &type)

Static Public Member Functions

static FormatFactoryself ()

Protected Member Functions

 FormatFactory ()


Detailed Description

Class for loading format plugins.

Example:

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

 QStringList list = factory->formats();
 QStringList::Iterator it;
 for ( it = list.begin(); it != list.end(); ++it ) {
   KABC::FormatPlugin *format = factory->format( (*it) );
   // do something with format
 }

Definition at line 57 of file formatfactory.h.


Constructor & Destructor Documentation

FormatFactory::~FormatFactory  ) 
 

Destructor.

Definition at line 81 of file formatfactory.cpp.

References QDict::clear().


Member Function Documentation

FormatFactory * FormatFactory::self  )  [static]
 

Returns the global format factory.

Definition at line 38 of file formatfactory.cpp.

References endl(), kdDebug(), and KStaticDeleter< type >::setObject().

Referenced by KABC::ResourceDir::init(), KABC::ResourceDirConfig::ResourceDirConfig(), KABC::ResourceFileConfig::ResourceFileConfig(), KABC::ResourceNetConfig::ResourceNetConfig(), and KABC::ResourceDir::setFormat().

FormatPlugin * FormatFactory::format const QString type  ) 
 

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

Parameters:
type The type of the format, returned by formats()

Definition at line 109 of file formatfactory.cpp.

References KABC::FormatInfo::descriptionLabel, endl(), QString::isEmpty(), kdDebug(), KABC::FormatInfo::library, KABC::FormatInfo::nameLabel, KABC::Plugin::setDescriptionLabel(), KABC::Plugin::setNameLabel(), KABC::Plugin::setType(), and KLibrary::symbol().

Referenced by KABC::ResourceDir::init(), and KABC::ResourceDir::setFormat().

QStringList FormatFactory::formats  ) 
 

Returns a list of all available format types.

Definition at line 86 of file formatfactory.cpp.

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

Referenced by KABC::ResourceDirConfig::ResourceDirConfig(), KABC::ResourceFileConfig::ResourceFileConfig(), and KABC::ResourceNetConfig::ResourceNetConfig().

FormatInfo * FormatFactory::info const QString type  ) 
 

Returns the info structure for a special type.

Definition at line 101 of file formatfactory.cpp.

References QString::isEmpty().

Referenced by FormatFactory(), KABC::ResourceDirConfig::ResourceDirConfig(), KABC::ResourceFileConfig::ResourceFileConfig(), and KABC::ResourceNetConfig::ResourceNetConfig().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kabc Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Feb 8 06:25:02 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003