F:/KPlato/koffice/libs/koproperty/factory.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003    Copyright (C) 2004 Alexander Dymo <cloudtemple@mskat.net>
00004    Copyright (C) 2005 Jaroslaw Staniek <js@iidea.pl>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
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>
00028 
00029 namespace KoProperty {
00030 
00031 class Widget;
00032 class CustomProperty;
00033 class Property;
00034 class FactoryManagerPrivate;
00035 
00037 //typedef Widget *(*createWidget) (Property*);
00038 //typedef CustomProperty *(*createCustomProperty) (Property*);
00039 
00041 class KOPROPERTY_EXPORT CustomPropertyFactory : public QObject
00042 {
00043         public:
00044                 CustomPropertyFactory(QObject *parent);
00045                 virtual ~CustomPropertyFactory();
00046 
00050                 virtual CustomProperty* createCustomProperty(Property *parent) = 0;
00051 
00055                 virtual Widget* createCustomWidget(Property *property) = 0;
00056 };
00057 
00059 
00111 class KOPROPERTY_EXPORT FactoryManager : public QObject
00112 {
00113         public:
00122                 void registerFactoryForEditor(int editorType, CustomPropertyFactory *factory);
00123 
00126                 void registerFactoryForEditors(const QList<int> &editorTypes, CustomPropertyFactory *factory);
00127 
00131                 CustomPropertyFactory *factoryForEditorType(int type);
00132 
00137                 Widget* createWidgetForProperty(Property *property);
00138 
00141                 void registerFactoryForProperty(int propertyType, CustomPropertyFactory *factory);
00142 
00145                 void registerFactoryForProperties(const QList<int> &propertyTypes,
00146                         CustomPropertyFactory *factory);
00147 
00151                 CustomProperty* createCustomProperty(Property *parent);
00152 
00154                 static FactoryManager* self();
00155 
00156         private:
00157                 FactoryManager();
00158                 ~FactoryManager();
00159 
00160                 FactoryManagerPrivate *d;
00161                 friend class KStaticDeleter<KoProperty::FactoryManager>;
00162 };
00163 
00164 }
00165 
00166 #endif

Généré le Wed Nov 22 23:41:06 2006 pour KPlato par  doxygen 1.5.1-p1