|
1 /****************************************************************************** |
|
2 * |
|
3 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * |
|
5 * Permission to use, copy, modify, and distribute this software and its |
|
6 * documentation under the terms of the GNU General Public License is hereby |
|
7 * granted. No representations are made about the suitability of this software |
|
8 * for any purpose. It is provided "as is" without express or implied warranty. |
|
9 * See the GNU General Public License for more details. |
|
10 * |
|
11 */ |
|
12 |
|
13 #ifndef XMLDITAXREFMAP_H |
|
14 #define XMLDITAXREFMAP_H |
|
15 |
|
16 #if USE_DOXYGEN_ID_AS_XML_ID ==0 |
|
17 #include <qmap.h> |
|
18 |
|
19 typedef QMap<Definition *, QString> XrefMapT; |
|
20 |
|
21 class XmlDitaXrefERemapDocVisitor : public DocVisitor |
|
22 { |
|
23 public: |
|
24 XmlDitaXrefERemapDocVisitor() : DocVisitor(DocVisitor_XML) {}; |
|
25 //-------------------------------------- |
|
26 // visitor functions for leaf nodes |
|
27 //-------------------------------------- |
|
28 void visit(DocWord *) {} |
|
29 void visit(DocLinkedWord *w) |
|
30 { |
|
31 Definition *d = w->getDefinition(); |
|
32 if (d) { |
|
33 m_XrefRemap.insert(d, QString("")); |
|
34 } |
|
35 } |
|
36 void visit(DocWhiteSpace *) {} |
|
37 void visit(DocSymbol *) {} |
|
38 void visit(DocURL *) {} |
|
39 void visit(DocLineBreak *) {} |
|
40 void visit(DocHorRuler *) {} |
|
41 void visit(DocStyleChange *) {} |
|
42 void visit(DocVerbatim *) {} |
|
43 void visit(DocAnchor *) {} |
|
44 void visit(DocInclude *) {} |
|
45 void visit(DocIncOperator *) {} |
|
46 void visit(DocFormula *) {} |
|
47 void visit(DocIndexEntry *) {} |
|
48 void visit(DocSimpleSectSep *) {} |
|
49 //-------------------------------------- |
|
50 // visitor functions for compound nodes |
|
51 //-------------------------------------- |
|
52 void visitPre(DocAutoList *) {} |
|
53 void visitPost(DocAutoList *) {} |
|
54 void visitPre(DocAutoListItem *) {} |
|
55 void visitPost(DocAutoListItem *) {} |
|
56 void visitPre(DocPara *) {} |
|
57 void visitPost(DocPara *) {} |
|
58 void visitPre(DocRoot *) {} |
|
59 void visitPost(DocRoot *) {} |
|
60 void visitPre(DocSimpleSect *) {} |
|
61 void visitPost(DocSimpleSect *) {} |
|
62 void visitPre(DocTitle *) {} |
|
63 void visitPost(DocTitle *) {} |
|
64 void visitPre(DocSimpleList *) {} |
|
65 void visitPost(DocSimpleList *) {} |
|
66 void visitPre(DocSimpleListItem *) {} |
|
67 void visitPost(DocSimpleListItem *) {} |
|
68 void visitPre(DocSection *) {} |
|
69 void visitPost(DocSection *) {} |
|
70 void visitPre(DocHtmlList *) {} |
|
71 void visitPost(DocHtmlList *) {} |
|
72 void visitPre(DocHtmlListItem *) {} |
|
73 void visitPost(DocHtmlListItem *) {} |
|
74 //void visitPre(DocHtmlPre *) {} |
|
75 //void visitPost(DocHtmlPre *) {} |
|
76 void visitPre(DocHtmlDescList *) {} |
|
77 void visitPost(DocHtmlDescList *) {} |
|
78 void visitPre(DocHtmlDescTitle *) {} |
|
79 void visitPost(DocHtmlDescTitle *) {} |
|
80 void visitPre(DocHtmlDescData *) {} |
|
81 void visitPost(DocHtmlDescData *) {} |
|
82 void visitPre(DocHtmlTable *) {} |
|
83 void visitPost(DocHtmlTable *) {} |
|
84 void visitPre(DocHtmlRow *) {} |
|
85 void visitPost(DocHtmlRow *) {} |
|
86 void visitPre(DocHtmlCell *) {} |
|
87 void visitPost(DocHtmlCell *) {} |
|
88 void visitPre(DocHtmlCaption *) {} |
|
89 void visitPost(DocHtmlCaption *) {} |
|
90 void visitPre(DocInternal *) {} |
|
91 void visitPost(DocInternal *) {} |
|
92 void visitPre(DocHRef *) {} |
|
93 void visitPost(DocHRef *) {} |
|
94 void visitPre(DocHtmlHeader *) {} |
|
95 void visitPost(DocHtmlHeader *) {} |
|
96 void visitPre(DocImage *) {} |
|
97 void visitPost(DocImage *) {} |
|
98 void visitPre(DocDotFile *) {} |
|
99 void visitPost(DocDotFile *) {} |
|
100 void visitPre(DocLink *w) |
|
101 { |
|
102 Definition *d = w->getDefinition(); |
|
103 if (d) { |
|
104 m_XrefRemap.insert(d, QString("")); |
|
105 } |
|
106 } |
|
107 void visitPost(DocLink *) {} |
|
108 void visitPre(DocRef *w) |
|
109 { |
|
110 Definition *d = w->getDefinition(); |
|
111 if (d) { |
|
112 m_XrefRemap.insert(d, QString("")); |
|
113 } |
|
114 } |
|
115 void visitPost(DocRef *) {} |
|
116 void visitPre(DocSecRefItem *) {} |
|
117 void visitPost(DocSecRefItem *) {} |
|
118 void visitPre(DocSecRefList *) {} |
|
119 void visitPost(DocSecRefList *) {} |
|
120 //void visitPre(DocLanguage *) {} |
|
121 //void visitPost(DocLanguage *) {} |
|
122 void visitPre(DocParamSect *) {} |
|
123 void visitPost(DocParamSect *) {} |
|
124 void visitPre(DocParamList *) {} |
|
125 void visitPost(DocParamList *) {} |
|
126 void visitPre(DocXRefItem *) {} |
|
127 void visitPost(DocXRefItem *) {} |
|
128 void visitPre(DocInternalRef *w) |
|
129 { |
|
130 Definition *d = w->getDefinition(); |
|
131 if (d) { |
|
132 m_XrefRemap.insert(d, QString("")); |
|
133 } |
|
134 } |
|
135 void visitPost(DocInternalRef *) {} |
|
136 void visitPre(DocCopy *) {} |
|
137 void visitPost(DocCopy *) {} |
|
138 void visitPre(DocText *) {} |
|
139 void visitPost(DocText *) {} |
|
140 |
|
141 virtual ~XmlDitaXrefERemapDocVisitor() {} |
|
142 // private: |
|
143 XrefMapT m_XrefRemap; |
|
144 }; |
|
145 |
|
146 #endif //USE_DOXYGEN_ID_AS_XML_ID ==0 |
|
147 |
|
148 #endif // XMLDITAXREFMAP_H |
|
149 |
|
150 |