00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef QXMLHANDLER_H
00020 #define QXMLHANDLER_H
00021
00022
00023 #include <qobject.h>
00024 #include <qxml.h>
00025 #include <qmap.h>
00026
00027 #include "GState.h"
00028 #include "GTransition.h"
00029
00030 class Project;
00031 class Machine;
00032 class GState;
00033 class GTransition;
00034 class GITransition;
00035 class Selection;
00036
00041 class XMLHandler : public QObject, public QXmlDefaultHandler
00042 {
00043 Q_OBJECT
00044 public:
00045 XMLHandler::XMLHandler(Project* newProject, Selection* sel=NULL,bool keepquiet=TRUE, bool
00046 createnewmachine=TRUE);
00047 bool startDocument();
00048 bool startElement ( const QString & namespaceURI, const QString & localName, const
00049 QString & qName, const QXmlAttributes & atts );
00050 bool endElement( const QString&, const QString&, const QString& );
00051 bool characters ( const QString & ch );
00052
00053 private:
00055 Project* project;
00057 Machine* machine;
00059 bool quiet;
00061 bool create_new_machine;
00063 Selection* selection;
00064
00066 GState* state;
00068 GTransition* transition;
00070 GITransition* itransition;
00072 int saveinitialstate;
00074 QString inames;
00076 QString onames;
00078 QString monames;
00080 QString sname;
00082 bool inamescont;
00084 bool onamescont;
00086 bool monamescont;
00088 bool snamecont;
00090 bool hascode;
00092 int ttype;
00094 QString iinfo;
00096 QString oinfo;
00098 bool fromcont;
00100 bool tocont;
00102 bool tincont;
00104 bool toutcont;
00106 bool hasfrom;
00108 bool hasto;
00110 QString from;
00112 QString to;
00114 QValueList<int> rstatelist;
00116 QMap<int, int> codemap;
00118 bool addstate;
00120 bool hasinitialstate;
00122 QList<GState> undostatelist;
00124 QList<GTransition> undotranslist;
00126 GState *oldinitialstate;
00128 GState *newinitialstate;
00130 GITransition *oldinitialtrans;
00132 GITransition *newinitialtrans;
00134 int oldnumbits;
00136 int oldnumin;
00138 int oldnumout;
00139 };
00140
00141 #endif
00142