factory.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KRESOURCES_FACTORY_H
00025 #define KRESOURCES_FACTORY_H
00026
00027 #include <qdict.h>
00028 #include <qstring.h>
00029
00030 #include <kconfig.h>
00031 #include <klibloader.h>
00032 #include <ktrader.h>
00033
00034 #include "resource.h"
00035 #include "configwidget.h"
00036
00037 namespace KRES {
00038
00062 class KRESOURCES_EXPORT Factory
00063 {
00064 public:
00065
00069 static Factory *self( const QString& resourceFamily );
00070
00071 ~Factory();
00072
00080 ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 );
00081
00090 Resource *resource( const QString& type, const KConfig *config );
00091
00095 QStringList typeNames() const;
00096
00100 QString typeName( const QString &type ) const;
00101
00105 QString typeDescription( const QString &type ) const;
00106
00107 protected:
00108 Factory( const QString& resourceFamily );
00109
00110 private:
00111 static QDict<Factory> *mSelves;
00112
00113 QString mResourceFamily;
00114 QMap<QString, KService::Ptr> mTypeMap;
00115 };
00116
00117 }
00118 #endif
|