factory.h
/*
This file is part of libkresources.
Copyright (c) 2002 Tobias Koenig <tokoe@kde.org>
Copyright (c) 2002 Jan-Pascal van Best <janpascal@vanbest.org>
Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KRESOURCES_FACTORY_H
#define KRESOURCES_FACTORY_H
#include <qdict.h>
#include <qstring.h>
#include <kconfig.h>
#include <klibloader.h>
#include <ktrader.h>
#include "resource.h"
#include "configwidget.h"
namespace KRES {
class KRESOURCES_EXPORT Factory
{
public:
static Factory *self( const QString& resourceFamily );
~Factory();
ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 );
Resource *resource( const QString& type, const KConfig *config );
QStringList typeNames() const;
QString typeName( const QString &type ) const;
QString typeDescription( const QString &type ) const;
protected:
Factory( const QString& resourceFamily );
private:
static QDict<Factory> *mSelves;
QString mResourceFamily;
QMap<QString, KService::Ptr> mTypeMap;
};
}
#endif
KRES::Resource
This class provides a resource which is managed in a general way.
Definition: resource.h:255
KRES::Factory
Class for loading resource plugins.
Definition: factory.h:62

KDE Home | KDE Accessibility Home | Description of Access Keys