Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Re-enable unit tests
[xestiaab/.git] / source / tools / odthelpbrowser / odt.h
1 #ifndef __ODT_H__
2 #define __ODT_H__
4 #include <fstream>
5 #include <string>
6 #include <vector>
7 #include <map>
9 #include <libxml/parser.h>
10 #include <libxml/tree.h>
11 #include <libxml/xpath.h>
12 #include <libxml/xpathInternals.h>
14 #include <wx/bitmap.h>
16 namespace ODT
17 {
18         enum HelpTopicSectionFontSize
19         {
20                 FONTSIZE_NORMAL,
21                 FONTSIZE_SECTION,
22                 FONTSIZE_TITLE
23         };
24         
25         enum HelpTopicCurrentLevel
26         {
27                 TOPIC_LEVEL1,
28                 TOPIC_LEVEL2,
29                 TOPIC_LEVEL3,
30                 TOPIC_LEVEL4,
31                 TOPIC_LEVEL5,
32                 TOPIC_LEVEL6,
33                 TOPIC_LEVEL7,
34                 TOPIC_LEVEL8,
35                 TOPIC_LEVEL9
36         };
38         enum HelpTopicSectionStyle
39         {
40                 SECTIONSTYLE_NORMAL,
41         };
43         struct HelpTopicSection
44         {
45                 HelpTopicSectionFontSize sectionFontSize;
46                 HelpTopicSectionStyle sectionFontStyle;
47                 std::string sectionText;
48         };
50         struct FootnoteSection
51         {
52                 int footnoteID;
53                 std::string footnoteText;
54         };
56         struct HelpTopicData
57         {
58                 std::string helpTopicName;
59                 std::string helpTopicID;
60                 std::vector<HelpTopicSection> helpTopicSections;
61                 std::vector<FootnoteSection> helpTopicFootnotes;
62         };
63         
64         struct HelpTableOfContentsItem
65         {
66                 std::string tocItemName;
67                 std::string tocItemID;
68                 HelpTopicCurrentLevel tocItemLevel;
69                 void *tocItemData;
70         };
72         class ODT
73         {
74         private:
75                 std::map<std::string, std::string> styleList;
76         
77                 bool ProcessDocument(xmlDocPtr document);
78                 
79                 bool GenerateStyleList(xmlDocPtr document);
80                 bool GetTitle(xmlDocPtr document);
81                 bool GenerateTOC(xmlDocPtr document);
82                 bool ProcessLineBreaks(xmlDocPtr document);
83                 bool ProcessImages(xmlDocPtr document);
84                 bool GenerateHelpTopics(xmlDocPtr document);
85                         
86                 void TrimString(std::string *stringToProcess);
87                 void RemoveNewLines(std::string *stringToProcess);
88                         
89                 void ProcessNoteNode(xmlNodePtr nodePtr, HelpTopicData *helpTopic);
90                         
91                 HelpTopicCurrentLevel DetermineTopicLevel(std::string styleText);
92         
93         public:
94                 ODT();
95         
96                 std::string title;
97                 std::vector<HelpTableOfContentsItem> tocData;
98                 std::vector<HelpTopicData> helpTopicData;
99         
100                 bool LoadDocument(std::string document);
101         };
104 #endif
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy