Doxygen
docbookvisitor.h
浏览该文件的文档.
1 /******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
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 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15 
16 #ifndef DOCBOOKDOCVISITOR_H
17 #define DOCBOOKDOCVISITOR_H
18 
19 #include <iostream>
20 
21 #include "containers.h"
22 #include "docvisitor.h"
23 #include "docparser.h"
24 #include "qcstring.h"
25 
27 class QCString;
28 class TextStream;
29 
30 /*! @brief Concrete visitor implementation for Docbook output. */
32 {
33  public:
36  //--------------------------------------
37  // visitor functions for leaf nodes
38  //--------------------------------------
39  void visit(DocWord *);
40  void visit(DocLinkedWord *);
41  void visit(DocWhiteSpace *);
42  void visit(DocSymbol *);
43  void visit(DocEmoji *);
44  void visit(DocURL *);
45  void visit(DocLineBreak *);
46  void visit(DocHorRuler *);
47  void visit(DocStyleChange *);
48  void visit(DocVerbatim *);
49  void visit(DocAnchor *);
50  void visit(DocInclude *);
51  void visit(DocIncOperator *);
52  void visit(DocFormula *);
53  void visit(DocIndexEntry *);
54  void visit(DocSimpleSectSep *);
55  void visit(DocCite *);
56  //--------------------------------------
57  // visitor functions for compound nodes
58  //--------------------------------------
59  void visitPre(DocAutoList *);
60  void visitPost(DocAutoList *);
61  void visitPre(DocAutoListItem *);
62  void visitPost(DocAutoListItem *);
63  void visitPre(DocPara *) ;
64  void visitPost(DocPara *);
65  void visitPre(DocRoot *);
66  void visitPost(DocRoot *);
67  void visitPre(DocSimpleSect *);
68  void visitPost(DocSimpleSect *);
69  void visitPre(DocTitle *);
70  void visitPost(DocTitle *);
71  void visitPre(DocSimpleList *);
72  void visitPost(DocSimpleList *);
75  void visitPre(DocSection *);
76  void visitPost(DocSection *);
77  void visitPre(DocHtmlList *);
78  void visitPost(DocHtmlList *) ;
79  void visitPre(DocHtmlListItem *);
80  void visitPost(DocHtmlListItem *);
81  //void visitPre(DocHtmlPre *);
82  //void visitPost(DocHtmlPre *);
83  void visitPre(DocHtmlDescList *);
84  void visitPost(DocHtmlDescList *);
85  void visitPre(DocHtmlDescTitle *);
87  void visitPre(DocHtmlDescData *);
88  void visitPost(DocHtmlDescData *);
89  void visitPre(DocHtmlTable *);
90  void visitPost(DocHtmlTable *);
91  void visitPre(DocHtmlRow *);
92  void visitPost(DocHtmlRow *) ;
93  void visitPre(DocHtmlCell *);
94  void visitPost(DocHtmlCell *);
95  void visitPre(DocHtmlCaption *);
96  void visitPost(DocHtmlCaption *);
97  void visitPre(DocInternal *);
98  void visitPost(DocInternal *);
99  void visitPre(DocHRef *);
100  void visitPost(DocHRef *);
101  void visitPre(DocHtmlHeader *);
102  void visitPost(DocHtmlHeader *);
103  void visitPre(DocImage *);
104  void visitPost(DocImage *);
105  void visitPre(DocDotFile *);
106  void visitPost(DocDotFile *);
107  void visitPre(DocMscFile *);
108  void visitPost(DocMscFile *);
109  void visitPre(DocDiaFile *);
110  void visitPost(DocDiaFile *);
111  void visitPre(DocLink *);
112  void visitPost(DocLink *);
113  void visitPre(DocRef *);
114  void visitPost(DocRef *);
115  void visitPre(DocSecRefItem *);
116  void visitPost(DocSecRefItem *);
117  void visitPre(DocSecRefList *);
118  void visitPost(DocSecRefList *);
119  //void visitPre(DocLanguage *);
120  //void visitPost(DocLanguage *);
121  void visitPre(DocParamSect *);
122  void visitPost(DocParamSect *);
123  void visitPre(DocParamList *);
124  void visitPost(DocParamList *);
125  void visitPre(DocXRefItem *);
126  void visitPost(DocXRefItem *);
127  void visitPre(DocInternalRef *);
128  void visitPost(DocInternalRef *);
129  void visitPre(DocText *);
130  void visitPost(DocText *);
131  void visitPre(DocHtmlBlockQuote *);
133  void visitPre(DocVhdlFlow *);
134  void visitPost(DocVhdlFlow *);
135  void visitPre(DocParBlock *);
136  void visitPost(DocParBlock *);
137 
138  private:
139  //--------------------------------------
140  // helper functions
141  //--------------------------------------
142  void filter(const QCString &str);
143  void startLink(const QCString &file,
144  const QCString &anchor);
145  void endLink();
146  void startMscFile(const QCString &fileName,const QCString &width,
147  const QCString &height, bool hasCaption,const DocNodeList &children,
148  const QCString &srcFile, int srcLine);
149  void endMscFile(bool hasCaption);
150  void writeMscFile(const QCString &fileName, DocVerbatim *s);
151  void startDiaFile(const QCString &fileName,const QCString &width,
152  const QCString &height, bool hasCaption,const DocNodeList &children,
153  const QCString &srcFile, int srcLine);
154  void endDiaFile(bool hasCaption);
155  void writeDiaFile(const QCString &fileName, DocVerbatim *s);
156  void startDotFile(const QCString &fileName,const QCString &width,
157  const QCString &height, bool hasCaption,const DocNodeList &children,
158  const QCString &srcFile, int srcLine);
159  void endDotFile(bool hasCaption);
160  void writeDotFile(const QCString &fileName, DocVerbatim *s);
161  void writePlantUMLFile(const QCString &fileName, DocVerbatim *s);
162  void visitPreStart(TextStream &t,
163  const DocNodeList &children,
164  bool hasCaption,
165  const QCString &name,
166  const QCString &width,
167  const QCString &height,
168  bool inlineImage = FALSE);
169  void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE);
170  void visitCaption(const DocNodeList &children);
171  //--------------------------------------
172  // state variables
173  //--------------------------------------
176  bool m_insidePre = false;
177  bool m_hide = false;
180  int m_colCnt = 0;
181  BoolStack m_bodySet; // it is possible to have tables without a header, needs to be an array as we can have tables in tables
182 };
183 
184 #endif
DocHtmlBlockQuote
Node representing an HTML blockquote
Definition: docparser.h:1433
DocAutoListItem
Node representing an item of a auto list
Definition: docparser.h:720
DocHRef
Node representing a Hypertext reference
Definition: docparser.h:936
DocStyleChange
Node representing a style change
Definition: docparser.h:343
DocVerbatim
Node representing a verbatim, unparsed text fragment
Definition: docparser.h:510
DocTitle
Node representing a simple section title
Definition: docparser.h:736
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocDotFile
Node representing a dot file
Definition: docparser.h:830
DocHtmlTable
Node representing a HTML table
Definition: docparser.h:1405
DocbookDocVisitor::visitPost
void visitPost(DocAutoList *)
Definition: docbookvisitor.cpp:622
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
DocbookDocVisitor::startMscFile
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
Definition: docbookvisitor.cpp:1698
DocHtmlHeader
Node Html heading
Definition: docparser.h:957
DocbookDocVisitor::visitPostEnd
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
Definition: docbookvisitor.cpp:135
docvisitor.h
DocHtmlListItem
Node representing a HTML list item
Definition: docparser.h:1286
DocVhdlFlow
Node representing a VHDL flow chart
Definition: docparser.h:860
DocHtmlDescData
Node representing a HTML description data
Definition: docparser.h:1303
DocHtmlDescTitle
Node representing a Html description item
Definition: docparser.h:973
DocbookDocVisitor::m_t
TextStream & m_t
Definition: docbookvisitor.h:174
DocEmoji
Node representing a n emoji
Definition: docparser.h:469
DocMscFile
Node representing a msc file
Definition: docparser.h:840
DocbookDocVisitor::writePlantUMLFile
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s)
Definition: docbookvisitor.cpp:1682
DocSecRefItem
Node representing a reference to a section
Definition: docparser.h:1023
DocAnchor
Node representing an anchor
Definition: docparser.h:303
DocbookDocVisitor::DocbookDocVisitor
DocbookDocVisitor(TextStream &t, CodeOutputInterface &ci, const QCString &langExt)
Definition: docbookvisitor.cpp:153
DocbookDocVisitor::m_colCnt
int m_colCnt
Definition: docbookvisitor.h:180
DocbookDocVisitor::filter
void filter(const QCString &str)
Definition: docbookvisitor.cpp:1642
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DocText
Root node of a text fragment
Definition: docparser.h:1447
DocbookDocVisitor::endDiaFile
void endDiaFile(bool hasCaption)
Definition: docbookvisitor.cpp:1776
DocVisitor
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:92
qcstring.h
DocbookDocVisitor::~DocbookDocVisitor
~DocbookDocVisitor()
Definition: docbookvisitor.cpp:159
DocbookDocVisitor
Concrete visitor implementation for Docbook output.
Definition: docbookvisitor.h:31
DocFormula
Node representing an item of a cross-referenced list
Definition: docparser.h:658
DocHtmlDescList
Node representing a Html description list
Definition: docparser.h:987
DocIncOperator
Node representing a include/dontinclude operator block
Definition: docparser.h:606
DocIndexEntry
Node representing an entry in the index.
Definition: docparser.h:682
DocSecRefList
Node representing a list of section references
Definition: docparser.h:1048
DocbookDocVisitor::m_ci
CodeOutputInterface & m_ci
Definition: docbookvisitor.h:175
DocLineBreak
Node representing a line break
Definition: docparser.h:272
DocbookDocVisitor::visit
void visit(DocWord *)
Definition: docbookvisitor.cpp:169
DocWord
Node representing a word
Definition: docparser.h:217
DocSymbol
Node representing a special symbol
Definition: docparser.h:385
DocbookDocVisitor::endLink
void endLink()
Definition: docbookvisitor.cpp:1660
DocXRefItem
Node representing an item of a cross-referenced list
Definition: docparser.h:749
DocbookDocVisitor::m_hide
bool m_hide
Definition: docbookvisitor.h:177
DocImage
Node representing an image
Definition: docparser.h:771
DocbookDocVisitor::startLink
void startLink(const QCString &file, const QCString &anchor)
Definition: docbookvisitor.cpp:1648
DocNodeList
std::vector< std::unique_ptr< DocNode > > DocNodeList
Definition: docparser.h:190
DocURL
Node representing a URL (or email address)
Definition: docparser.h:256
DocHtmlCaption
Node representing a HTML table caption
Definition: docparser.h:1352
DocParamList
Node representing a parameter list.
Definition: docparser.h:1228
DocbookDocVisitor::m_insidePre
bool m_insidePre
Definition: docbookvisitor.h:176
DocbookDocVisitor::visitPre
void visitPre(DocAutoList *)
Definition: docbookvisitor.cpp:608
DocParBlock
Node representing an block of paragraphs
Definition: docparser.h:1070
DocSimpleSectSep
Node representing a separator between two simple sections of the same type.
Definition: docparser.h:1139
DocbookDocVisitor::startDiaFile
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
Definition: docbookvisitor.cpp:1749
DocCite
Node representing a citation of some bibliographic reference
Definition: docparser.h:321
DocRef
Node representing a reference to some item
Definition: docparser.h:891
DocbookDocVisitor::writeMscFile
void writeMscFile(const QCString &fileName, DocVerbatim *s)
Definition: docbookvisitor.cpp:1666
docparser.h
DocParamSect
Node representing a parameter section
Definition: docparser.h:1150
DocbookDocVisitor::writeDotFile
void writeDotFile(const QCString &fileName, DocVerbatim *s)
Definition: docbookvisitor.cpp:1784
DocbookDocVisitor::writeDiaFile
void writeDiaFile(const QCString &fileName, DocVerbatim *s)
Definition: docbookvisitor.cpp:1733
DocHtmlList
Node representing a Html list
Definition: docparser.h:1093
DocbookDocVisitor::m_bodySet
BoolStack m_bodySet
Definition: docbookvisitor.h:181
DocSimpleSect
Node representing a simple section
Definition: docparser.h:1111
DocbookDocVisitor::endDotFile
void endDotFile(bool hasCaption)
Definition: docbookvisitor.cpp:1828
DocSection
Node representing a normal section
Definition: docparser.h:1001
DocHorRuler
Node representing a horizontal ruler
Definition: docparser.h:288
DocInclude
Node representing an included text block from file
Definition: docparser.h:563
DocAutoList
Node representing an auto List
Definition: docparser.h:703
DocInternal
Node representing an internal section of documentation
Definition: docparser.h:1059
containers.h
DocLinkedWord
Node representing a word that can be linked to something
Definition: docparser.h:231
CodeOutputInterface
Output interface for code parser.
Definition: outputgen.h:61
DocDiaFile
Node representing a dia file
Definition: docparser.h:850
DocSimpleList
Node representing a simple list
Definition: docparser.h:1082
DocSimpleListItem
Node representing a simple list item
Definition: docparser.h:1266
DocbookDocVisitor::visitPreStart
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
Definition: docbookvisitor.cpp:92
DocWhiteSpace
Node representing some amount of white space
Definition: docparser.h:484
DocbookDocVisitor::m_langExt
QCString m_langExt
Definition: docbookvisitor.h:179
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
DocbookDocVisitor::m_enabled
BoolStack m_enabled
Definition: docbookvisitor.h:178
DocInternalRef
Node representing an internal reference to some item
Definition: docparser.h:919
BoolStack
std::stack< bool > BoolStack
Definition: containers.h:33
DocbookDocVisitor::startDotFile
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
Definition: docbookvisitor.cpp:1800
DocbookDocVisitor::visitCaption
void visitCaption(const DocNodeList &children)
Definition: docbookvisitor.cpp:87
DocHtmlRow
Node representing a HTML table row
Definition: docparser.h:1371
DocbookDocVisitor::endMscFile
void endMscFile(bool hasCaption)
Definition: docbookvisitor.cpp:1725
FALSE
#define FALSE
Definition: qcstring.h:33
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108