Imported Upstream version 1.9.2
[platform/upstream/doxygen.git] / src / xmldocvisitor.h
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18
19 #ifndef XMLDOCVISITOR_H
20 #define XMLDOCVISITOR_H
21
22 #include <iostream>
23
24 #include "qcstring.h"
25 #include "docvisitor.h"
26 #include "textstream.h"
27
28 class CodeOutputInterface;
29 class QCString;
30
31 /*! @brief Concrete visitor implementation for XML output. */
32 class XmlDocVisitor : public DocVisitor
33 {
34   public:
35     XmlDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
36
37     //--------------------------------------
38     // visitor functions for leaf nodes
39     //--------------------------------------
40
41     void visit(DocWord *);
42     void visit(DocLinkedWord *);
43     void visit(DocWhiteSpace *);
44     void visit(DocSymbol *);
45     void visit(DocEmoji *);
46     void visit(DocURL *);
47     void visit(DocLineBreak *);
48     void visit(DocHorRuler *);
49     void visit(DocStyleChange *);
50     void visit(DocVerbatim *);
51     void visit(DocAnchor *);
52     void visit(DocInclude *);
53     void visit(DocIncOperator *);
54     void visit(DocFormula *);
55     void visit(DocIndexEntry *);
56     void visit(DocSimpleSectSep *);
57     void visit(DocCite *);
58
59     //--------------------------------------
60     // visitor functions for compound nodes
61     //--------------------------------------
62
63     void visitPre(DocAutoList *);
64     void visitPost(DocAutoList *);
65     void visitPre(DocAutoListItem *);
66     void visitPost(DocAutoListItem *);
67     void visitPre(DocPara *) ;
68     void visitPost(DocPara *);
69     void visitPre(DocRoot *);
70     void visitPost(DocRoot *);
71     void visitPre(DocSimpleSect *);
72     void visitPost(DocSimpleSect *);
73     void visitPre(DocTitle *);
74     void visitPost(DocTitle *);
75     void visitPre(DocSimpleList *);
76     void visitPost(DocSimpleList *);
77     void visitPre(DocSimpleListItem *);
78     void visitPost(DocSimpleListItem *);
79     void visitPre(DocSection *);
80     void visitPost(DocSection *);
81     void visitPre(DocHtmlList *);
82     void visitPost(DocHtmlList *) ;
83     void visitPre(DocHtmlListItem *);
84     void visitPost(DocHtmlListItem *);
85     //void visitPre(DocHtmlPre *);
86     //void visitPost(DocHtmlPre *);
87     void visitPre(DocHtmlDescList *);
88     void visitPost(DocHtmlDescList *);
89     void visitPre(DocHtmlDescTitle *);
90     void visitPost(DocHtmlDescTitle *);
91     void visitPre(DocHtmlDescData *);
92     void visitPost(DocHtmlDescData *);
93     void visitPre(DocHtmlTable *);
94     void visitPost(DocHtmlTable *);
95     void visitPre(DocHtmlRow *);
96     void visitPost(DocHtmlRow *) ;
97     void visitPre(DocHtmlCell *);
98     void visitPost(DocHtmlCell *);
99     void visitPre(DocHtmlCaption *);
100     void visitPost(DocHtmlCaption *);
101     void visitPre(DocInternal *);
102     void visitPost(DocInternal *);
103     void visitPre(DocHRef *);
104     void visitPost(DocHRef *);
105     void visitPre(DocHtmlHeader *);
106     void visitPost(DocHtmlHeader *);
107     void visitPre(DocImage *);
108     void visitPost(DocImage *);
109     void visitPre(DocDotFile *);
110     void visitPost(DocDotFile *);
111
112     void visitPre(DocMscFile *);
113     void visitPost(DocMscFile *);
114     void visitPre(DocDiaFile *);
115     void visitPost(DocDiaFile *);
116     void visitPre(DocLink *);
117     void visitPost(DocLink *);
118     void visitPre(DocRef *);
119     void visitPost(DocRef *);
120     void visitPre(DocSecRefItem *);
121     void visitPost(DocSecRefItem *);
122     void visitPre(DocSecRefList *);
123     void visitPost(DocSecRefList *);
124     //void visitPre(DocLanguage *);
125     //void visitPost(DocLanguage *);
126     void visitPre(DocParamSect *);
127     void visitPost(DocParamSect *);
128     void visitPre(DocParamList *);
129     void visitPost(DocParamList *);
130     void visitPre(DocXRefItem *);
131     void visitPost(DocXRefItem *);
132     void visitPre(DocInternalRef *);
133     void visitPost(DocInternalRef *);
134     void visitPre(DocText *);
135     void visitPost(DocText *);
136     void visitPre(DocHtmlBlockQuote *);
137     void visitPost(DocHtmlBlockQuote *);
138     void visitPre(DocVhdlFlow *);
139     void visitPost(DocVhdlFlow *);
140     void visitPre(DocParBlock *);
141     void visitPost(DocParBlock *);
142
143   private:
144
145     //--------------------------------------
146     // helper functions
147     //--------------------------------------
148
149     void filter(const QCString &str);
150     void startLink(const QCString &ref,const QCString &file,
151                    const QCString &anchor);
152     void endLink();
153
154     //--------------------------------------
155     // state variables
156     //--------------------------------------
157
158     TextStream &m_t;
159     CodeOutputInterface &m_ci;
160     bool m_insidePre;
161     bool m_hide;
162     QCString m_langExt;
163 };
164
165 #endif