• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepimlibs API Reference
  • KDE Home
  • Contact Us
 

kresources

  • KRES
  • Factory
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KRES::Factory Class Reference

#include <factory.h>

Public Member Functions

ConfigWidget * configWidget (const QString &type, QWidget *parent=0)
 
void reloadConfig ()
 
Resource * resource (const QString &type, const KConfigGroup &group)
 
Resource * resource (const QString &type)
 
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
typeThe type of the resource, returned by typeNames()
parentThe parent widget

Definition at line 153 of file factory.cpp.

void Factory::reloadConfig ( )

Reload the configuration.

This reloads the plugin type map. Useful to call after resources have been added or removed.

Since
4.2

Definition at line 126 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
typeThe type of the resource, returned by typeNames()
configThe configuration group where the resource should get its settings from.

Definition at line 245 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
typeThe type of the resource, returned by typeNames()

Definition at line 250 of file factory.cpp.

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

Returns the global resource factory.

Definition at line 68 of file factory.cpp.

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

Returns the description for a special type.

Definition at line 193 of file factory.cpp.

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

Returns the name for a special type.

Definition at line 183 of file factory.cpp.

QStringList Factory::typeNames ( ) const

Returns a list of all available resource types.

Definition at line 148 of file factory.cpp.


The documentation for this class was generated from the following files:
  • factory.h
  • factory.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kresources

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

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal