kresources
KRES::Factory Class Reference
#include <factory.h>
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.
Public Member Functions | |
ConfigWidget * | configWidget (const QString &type, QWidget *parent=0) |
void | reloadConfig () |
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) |
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 147 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 120 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 244 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 239 of file factory.cpp.
Factory * Factory::self | ( | const QString & | resourceFamily | ) | [static] |
QString Factory::typeDescription | ( | const QString & | type | ) | const |
QString Factory::typeName | ( | const QString & | type | ) | const |
QStringList Factory::typeNames | ( | ) | const |
The documentation for this class was generated from the following files: