File indexing completed on 2024-12-22 04:17:59
0001 /*************************************************************************** 0002 * * 0003 * copyright : (C) 2007 The University of Toronto * 0004 * netterfield@astro.utoronto.ca * 0005 * * 0006 * This program is free software; you can redistribute it and/or modify * 0007 * it under the terms of the GNU General Public License as published by * 0008 * the Free Software Foundation; either version 2 of the License, or * 0009 * (at your option) any later version. * 0010 * * 0011 ***************************************************************************/ 0012 0013 #ifndef OBJECTFACTORY_H 0014 #define OBJECTFACTORY_H 0015 0016 #include <QXmlStreamReader> 0017 #include <QStringList> 0018 0019 #include "dataobject.h" 0020 #include "kstmath_export.h" 0021 0022 namespace Kst { 0023 0024 class ObjectStore; 0025 0026 class ObjectFactory { 0027 public: 0028 ObjectFactory(); 0029 virtual ~ObjectFactory(); 0030 0031 // This takes ownership 0032 static void registerFactory(const QString& node, ObjectFactory *factory); 0033 static void registerFactory(const QStringList& nodes, ObjectFactory *factory); 0034 KSTMATH_EXPORT static DataObjectPtr parse(ObjectStore *store, QXmlStreamReader& stream); 0035 virtual DataObjectPtr generateObject(ObjectStore *store, QXmlStreamReader& stream) = 0; 0036 }; 0037 0038 } 0039 0040 #endif 0041 0042 // vim: ts=2 sw=2 et