• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kresources

KRES::Factory

KRES::Factory Class Reference

A class for loading resource plugins. More...

#include <factory.h>

List of all members.


Public Member Functions

ConfigWidget * configWidget (const QString &type, QWidget *parent=0)
Resource * resource (const QString &type)
Resource * resource (const QString &type, const KConfigGroup &group)
QString typeDescription (const QString &type) const
QString typeName (const QString &type) const
QStringList typeNames () const

Static Public Member Functions

static Factory * self (const QString &resourceFamily)

Protected Member Functions

 Factory (const QString &resourceFamily)

Detailed Description

A 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:

  KRES::Factory *factory = KRES::Factory::self( "contact" );

  // to allow a transparent configuration of resources, we have
  // to use a kconfig object.
  KConfig config;
  KConfigGroup group( &config, "General" );
  group.writePathEntry( "FileName", "/home/foobar/test.vcf" );// resource dependent
  group.writeEntry( "FileFormat", "vcard" );                  // resource dependent

  KRES::Resource *res = factory->resource( "file", group );

  // do something with resource

Definition at line 73 of file factory.h.


Member Function Documentation

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 106 of file factory.cpp.

Resource * Factory::resource ( const QString &  type  ) 

Creates and returns a resource object with default values, or a null pointer if resource type doesn't exist.

Parameters:
type The type of the resource, returned by typeNames()

Definition at line 203 of file factory.cpp.

Resource * Factory::resource ( const QString &  type,
const KConfigGroup &  group 
)

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 configuration group where the resource should get its settings from.

Definition at line 198 of file factory.cpp.

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

Returns the global resource factory.

Definition at line 62 of file factory.cpp.

QString Factory::typeDescription ( const QString &  type  )  const

Returns the description for a special type.

Definition at line 146 of file factory.cpp.

QString Factory::typeName ( const QString &  type  )  const

Returns the name for a special type.

Definition at line 136 of file factory.cpp.

QStringList Factory::typeNames (  )  const

Returns a list of all available resource types.

Definition at line 101 of file factory.cpp.


The documentation for this class was generated from the following files:
  • factory.h
  • factory.cpp

kresources

Skip menu "kresources"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal