File indexing completed on 2024-12-22 04:17:32

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 GRAPHICSFACTORY_H
0014 #define GRAPHICSFACTORY_H
0015 
0016 #include <QXmlStreamReader>
0017 #include <QStringList>
0018 
0019 #include "dataobject.h"
0020 #include "kst_export.h"
0021 #include "view.h"
0022 
0023 namespace Kst {
0024 class ViewItem;
0025 class ObjectStore;
0026 
0027 class GraphicsFactory {
0028   public:
0029     GraphicsFactory();
0030     virtual ~GraphicsFactory();
0031 
0032     // This takes ownership
0033     static void registerFactory(const QString& node, GraphicsFactory *factory);
0034     static void registerFactory(const QStringList& nodes, GraphicsFactory *factory);
0035     static ViewItem *parse(QXmlStreamReader& stream, ObjectStore *store, View *view, ViewItem *parent = 0);
0036     virtual ViewItem *generateGraphics(QXmlStreamReader& stream, ObjectStore *store, View *view, ViewItem *parent = 0) = 0;
0037 };
0038 
0039 }
0040 
0041 #endif
0042 
0043 // vim: ts=2 sw=2 et