#ifndef __ODT_H__ #define __ODT_H__ #include #include #include #include #include #include #include #include #include namespace ODT { enum HelpTopicSectionFontSize { FONTSIZE_NORMAL, FONTSIZE_SECTION, FONTSIZE_TITLE }; enum HelpTopicCurrentLevel { TOPIC_LEVEL1, TOPIC_LEVEL2, TOPIC_LEVEL3, TOPIC_LEVEL4, TOPIC_LEVEL5, TOPIC_LEVEL6, TOPIC_LEVEL7, TOPIC_LEVEL8, TOPIC_LEVEL9 }; enum HelpTopicSectionStyle { SECTIONSTYLE_NORMAL, }; struct HelpTopicSection { HelpTopicSectionFontSize sectionFontSize; HelpTopicSectionStyle sectionFontStyle; std::string sectionText; }; struct FootnoteSection { int footnoteID; std::string footnoteText; }; struct HelpTopicData { std::string helpTopicName; std::string helpTopicID; std::vector helpTopicSections; std::vector helpTopicFootnotes; }; struct HelpTableOfContentsItem { std::string tocItemName; std::string tocItemID; HelpTopicCurrentLevel tocItemLevel; void *tocItemData; }; class ODT { private: std::map styleList; bool ProcessDocument(xmlDocPtr document); bool GenerateStyleList(xmlDocPtr document); bool GetTitle(xmlDocPtr document); bool GenerateTOC(xmlDocPtr document); bool ProcessLineBreaks(xmlDocPtr document); bool ProcessImages(xmlDocPtr document); bool GenerateHelpTopics(xmlDocPtr document); void TrimString(std::string *stringToProcess); void RemoveNewLines(std::string *stringToProcess); void ProcessNoteNode(xmlNodePtr nodePtr, HelpTopicData *helpTopic); HelpTopicCurrentLevel DetermineTopicLevel(std::string styleText); public: ODT(); std::string title; std::vector tocData; std::vector helpTopicData; bool LoadDocument(std::string document); }; } #endif