00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 00002 /* 00003 * This file is part of the libvisio project. 00004 * 00005 * This Source Code Form is subject to the terms of the Mozilla Public 00006 * License, v. 2.0. If a copy of the MPL was not distributed with this 00007 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 */ 00009 00010 #ifndef __VDXPARSER_H__ 00011 #define __VDXPARSER_H__ 00012 00013 #include <librevenge/librevenge.h> 00014 #include "VSDXMLParserBase.h" 00015 00016 namespace libvisio 00017 { 00018 00019 class VSDCollector; 00020 00021 class VDXParser : public VSDXMLParserBase 00022 { 00023 using VSDXMLParserBase::readExtendedColourData; 00024 using VSDXMLParserBase::readDoubleData; 00025 using VSDXMLParserBase::readBoolData; 00026 using VSDXMLParserBase::readLongData; 00027 00028 public: 00029 explicit VDXParser(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter); 00030 virtual ~VDXParser(); 00031 bool parseMain(); 00032 bool extractStencils(); 00033 00034 private: 00035 VDXParser(); 00036 VDXParser(const VDXParser &); 00037 VDXParser &operator=(const VDXParser &); 00038 00039 // Helper functions 00040 00041 xmlChar *readStringData(xmlTextReaderPtr reader); 00042 00043 int getElementToken(xmlTextReaderPtr reader); 00044 int getElementDepth(xmlTextReaderPtr reader); 00045 00046 // Functions to read the DatadiagramML document structure 00047 00048 bool processXmlDocument(librevenge::RVNGInputStream *input); 00049 void processXmlNode(xmlTextReaderPtr reader); 00050 00051 // Functions reading the DiagramML document content 00052 00053 void readLine(xmlTextReaderPtr reader); 00054 void readFillAndShadow(xmlTextReaderPtr reader); 00055 void readXFormData(xmlTextReaderPtr reader); 00056 void readMisc(xmlTextReaderPtr reader); 00057 void readTxtXForm(xmlTextReaderPtr reader); 00058 void readXForm1D(xmlTextReaderPtr reader); 00059 void readPageProps(xmlTextReaderPtr reader); 00060 void readFonts(xmlTextReaderPtr reader); 00061 void readTextBlock(xmlTextReaderPtr reader); 00062 void readForeignInfo(xmlTextReaderPtr reader); 00063 00064 void getBinaryData(xmlTextReaderPtr reader); 00065 00066 // Private data 00067 00068 librevenge::RVNGInputStream *m_input; 00069 librevenge::RVNGDrawingInterface *m_painter; 00070 }; 00071 00072 } // namespace libvisio 00073 00074 #endif // __VDXPARSER_H__ 00075 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */