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