00001 #ifndef XMLPARSER_H
00002 #define XMLPARSER_H
00003 #include <qxml.h>
00004 #include <qstack.h>
00005 #include "Score.h"
00006 #include "ErrorHandler.h"
00007 #include "Score.h"
00008 #include "../marker/XMLMarker.h"
00009 #include "../marker/XMLMarkerFactory.h"
00010 #include "../marker/Score_partwise.h"
00011
00015 class MusicXMLHandler:public QXmlContentHandler
00016 {
00017 int state;
00018 QString error;
00019 QStack < XMLMarker > pile;
00020 XMLMarker *marker;
00021 QXmlLocator *locator;
00022
00023
00024
00025 public:
00026 ScoreMusic * getScore ();
00027 MusicXMLHandler ();
00028 bool startDocument ();
00029 void setDocumentLocator (QXmlLocator *);
00030 bool endDocument ();
00031 bool startElement (const QString &, const QString &, const QString &,
00032 const QXmlAttributes &);
00033 bool endElement (const QString &, const QString &, const QString &);
00034 bool characters (const QString &);
00035 bool startPrefixMapping (const QString &, const QString &);
00036 bool endPrefixMapping (const QString &);
00037 bool ignorableWhitespace (const QString &);
00038 bool processingInstruction (const QString &, const QString &);
00039 bool skippedEntity (const QString &);
00040 QString errorString ();
00041
00042 };
00046 class MusicXMLParser:public QXmlSimpleReader
00047 {
00048 MusicXMLHandler contentHandler;
00049 MusicXMLErrorHandler errorHandler;
00050 bool parsingDone;
00051 public:
00052 ScoreMusic * getScore ();
00053 MusicXMLParser ();
00054
00055
00056 };
00057 #endif