diff options
Diffstat (limited to 'src/data/tikzassembler.h')
-rw-r--r-- | src/data/tikzassembler.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/data/tikzassembler.h b/src/data/tikzassembler.h new file mode 100644 index 0000000..8dbbc9b --- /dev/null +++ b/src/data/tikzassembler.h @@ -0,0 +1,42 @@ +/** + * Convenience class to hold the parser state while loading tikz graphs or projects. + */ + +#ifndef TIKZASSEMBLER_H +#define TIKZASSEMBLER_H + +#include "node.h" +#include "graph.h" +#include "project.h" + +#include <QObject> +#include <QHash> + +class TikzAssembler : public QObject +{ + Q_OBJECT +public: + explicit TikzAssembler(Graph *graph, QObject *parent = 0); + explicit TikzAssembler(Project *project, QObject *parent = 0); + void addNodeToMap(Node *n); + Node *nodeWithName(QString name); + bool parse(const QString &tikz); + + Graph *graph() const; + Project *project() const; + bool isGraph() const; + bool isProject() const; + + +signals: + +public slots: + +private: + QHash<QString,Node*> _nodeMap; + Graph *_graph; + Project *_project; + void *scanner; +}; + +#endif // TIKZASSEMBLER_H |