lib
factory.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KPROPERTY_FACTORY_H
00023 #define KPROPERTY_FACTORY_H
00024
00025 #include "koproperty_global.h"
00026 #include <kstaticdeleter.h>
00027 #include <qobject.h>
00028
00029 template<class U> class QValueList;
00030
00031 namespace KoProperty {
00032
00033 class Widget;
00034 class CustomProperty;
00035 class Property;
00036 class FactoryManagerPrivate;
00037
00039
00040
00041
00043 class KOPROPERTY_EXPORT CustomPropertyFactory : public QObject
00044 {
00045 public:
00046 CustomPropertyFactory(QObject *parent);
00047 virtual ~CustomPropertyFactory();
00048
00052 virtual CustomProperty* createCustomProperty(Property *parent) = 0;
00053
00057 virtual Widget* createCustomWidget(Property *property) = 0;
00058 };
00059
00061
00097 class KOPROPERTY_EXPORT FactoryManager : public QObject
00098 {
00099 public:
00108 void registerFactoryForEditor(int editorType, CustomPropertyFactory *factory);
00109
00112 void registerFactoryForEditors(const QValueList<int> &editorTypes, CustomPropertyFactory *factory);
00113
00117 CustomPropertyFactory *factoryForEditorType(int type);
00118
00123 Widget* createWidgetForProperty(Property *property);
00124
00127 void registerFactoryForProperty(int propertyType, CustomPropertyFactory *factory);
00128
00131 void registerFactoryForProperties(const QValueList<int> &propertyTypes,
00132 CustomPropertyFactory *factory);
00133
00137 CustomProperty* createCustomProperty(Property *parent);
00138
00140 static FactoryManager* self();
00141
00142 private:
00143 FactoryManager();
00144 ~FactoryManager();
00145
00146 FactoryManagerPrivate *d;
00147 friend class KStaticDeleter<KoProperty::FactoryManager>;
00148 };
00149
00150 }
00151
00152 #endif
|