#ifndef HWPDOCINFO_H #define HWPDOCINFO_H #include "HanType.h" #include "HWPStream.h" #include "HWPElements/HWPRecord.h" #include "Common/XMLReader.h" #include namespace HWP { enum class ECompatDoc { HWP, OLD_HWP, MS_WORD, UNKNOWN }; class CHWPFile; class CHWPXFile; class CHWPMLFile; class CHWPDocInfo { EHanType m_eHanType; CHWPXFile *m_pParentHWPX; CHWPFile *m_pParentHWP; CHWPMLFile *m_pParentHWPML; VECTOR m_arRecords; std::map m_mBinDatas; VECTOR m_arFaseNames; VECTOR m_arBorderFills; VECTOR m_arCharShapes; VECTOR m_arNumberings; VECTOR m_arBullets; VECTOR m_arParaShapes; VECTOR m_arStyles; VECTOR m_arTabDefs; ECompatDoc m_eCompatibleDoc; public: CHWPDocInfo(EHanType eHanType); CHWPDocInfo(CHWPXFile* pHWPXFile); CHWPDocInfo(CHWPFile* pHWPFile); CHWPDocInfo(CHWPMLFile* pHWPMLFile); ~CHWPDocInfo(); bool Parse(CHWPStream& oBuffer, int nVersion); bool ParseHWPX(CXMLReader& oReader); bool ParseHWPML(CXMLReader& oReader); bool ReadContentHpf(CXMLReader& oReader); const CHWPRecord* GetRecord(int nIndex) const; const CHWPRecord* GetFaceName(int nIndex) const; const CHWPRecord* GetBorderFill(int nIndex) const; const CHWPRecord* GetCharShape(int nIndex) const; const CHWPRecord* GetNumbering(int nIndex) const; const CHWPRecord* GetBullet(int nIndex) const; const CHWPRecord* GetParaShape(int nIndex) const; const CHWPRecord* GetStyle(int nIndex) const; const CHWPRecord* GetTabDef(int nIndex) const; CHWPFile* GetParentHWP(); const CHWPRecord* GetBinData(const HWP_STRING& sID) const; EHanType GetHanType() const; ECompatDoc GetCompatibleDoc() const; private: bool ReadRefList(CXMLReader& oReader); bool ReadRefListElement(CXMLReader& oReader, EHanType eType); }; } #endif // HWPDOCINFO_H