1 /***************************************************************************
2  *                                                                         *
3  *   copyright : (C) 2007 The University of Toronto                        *
4  *                   netterfield@astro.utoronto.ca                         *
5  *                                                                         *
6  *   This program is free software; you can redistribute it and/or modify  *
7  *   it under the terms of the GNU General Public License as published by  *
8  *   the Free Software Foundation; either version 2 of the License, or     *
9  *   (at your option) any later version.                                   *
10  *                                                                         *
11  ***************************************************************************/
12 
13 #ifndef GRAPHICSFACTORY_H
14 #define GRAPHICSFACTORY_H
15 
16 #include <QXmlStreamReader>
17 #include <QStringList>
18 
19 #include "dataobject.h"
20 #include "kst_export.h"
21 #include "view.h"
22 
23 namespace Kst {
24 class ViewItem;
25 class ObjectStore;
26 
27 class GraphicsFactory {
28   public:
29     GraphicsFactory();
30     virtual ~GraphicsFactory();
31 
32     // This takes ownership
33     static void registerFactory(const QString& node, GraphicsFactory *factory);
34     static void registerFactory(const QStringList& nodes, GraphicsFactory *factory);
35     static ViewItem *parse(QXmlStreamReader& stream, ObjectStore *store, View *view, ViewItem *parent = 0);
36     virtual ViewItem *generateGraphics(QXmlStreamReader& stream, ObjectStore *store, View *view, ViewItem *parent = 0) = 0;
37 };
38 
39 }
40 
41 #endif
42 
43 // vim: ts=2 sw=2 et
44