X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=src%2Fxml-vym.h;fp=src%2Fxml-vym.h;h=abab5c3974d6d5d71e2fd0908929ad0ad9f58f64;hb=d483bd8e6523c23c6f1d8908a2e0611c2bc9ff4f;hp=0000000000000000000000000000000000000000;hpb=7dfa3fe589d1722d49681f42cdb0bf1e6efb5223;p=sven%2Fvym.git diff --git a/src/xml-vym.h b/src/xml-vym.h new file mode 100644 index 0000000..abab5c3 --- /dev/null +++ b/src/xml-vym.h @@ -0,0 +1,95 @@ +#ifndef XML_H +#define XML_H + +#include "xml-base.h" + +#include "vymnote.h" + +class BranchItem; +class ImageItem; +class MapItem; +class SlideItem; +class Task; + +/*! \brief Parsing VYM maps from XML documents */ + +enum Content { + TreeContent = 0x0001, + SlideContent = 0x0002, + XLinkContent = 0x0004 +}; + +class parseVYMHandler : public parseBaseHandler { + public: + parseVYMHandler(); + void setContentFilter(const int &); + + private: + int contentFilter; + + public: + bool startDocument(); + bool startElement(const QString &, const QString &, const QString &eName, + const QXmlAttributes &atts); + bool endElement(const QString &, const QString &, const QString &); + bool characters(const QString &); + QString errorString(); + bool readMapAttr(const QXmlAttributes &); + bool readMapDesignCompatibleAttr(const QXmlAttributes &); + bool readBranchAttr(const QXmlAttributes &); + bool readFrameAttr(const QXmlAttributes &); + bool readOOAttr(const QXmlAttributes &); + bool readNoteAttr(const QXmlAttributes &); + bool readImageAttr(const QXmlAttributes &); + bool readXLinkAttr(const QXmlAttributes &); + bool readLinkNewAttr(const QXmlAttributes &); + bool readSettingAttr(const QXmlAttributes &); + bool readSlideAttr(const QXmlAttributes &); + bool readTaskAttr(const QXmlAttributes &); + bool readUserFlagDefAttr(const QXmlAttributes &); + bool readUserFlagAttr(const QXmlAttributes &); + + private: + enum State { + StateInit, + StateMap, + StateMapDesign, // Introduced 2.9.514 + StateMD, // Introduced 2.9.514 + StateMapSelect, + StateMapSetting, + StateMapSlide, + StateMapCenter, + StateBranch, + StateBranchXLink, // Obsolete + StateVymNote, + StateHtmlNote, // Obsolete >= 1.13.6 + StateHtml, + StateFrame, + StateStandardFlag, // New in 2.7.509 + StateUserFlagDef, // New in 2.7.509 + StateUserFlag, + StateNote, // Obsolete >= 1.4.6 + StateImage, + StateHeading, + StateLink, + StateAttribute, + StateTask + }; + + int branchesCounter; + int branchesTotal; + + State state; + QList stateStack; + VymText vymtext; + + BranchItem *lastBranch; + ImageItem *lastImage; + MapItem *lastMI; + SlideItem *lastSlide; + Task *lastTask; + QString lastSetting; + + bool useProgress; +}; +#endif