Doxygen
Loading...
Searching...
No Matches
docbookvisitor.h
Go to the documentation of this file.
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 "docnode.h"
24#include "qcstring.h"
25
26class OutputCodeList;
27class QCString;
28class TextStream;
29
30/*! @brief Concrete visitor implementation for Docbook output. */
32{
33 public:
35 //-----------------------------------------
36 template<class T>
37 void visitChildren(const T &t)
38 {
39 for (const auto &child : t.children())
40 {
41 std::visit(*this, child);
42 }
43 }
44 //--------------------------------------
45 // visitor functions for leaf nodes
46 //--------------------------------------
47 void operator()(const DocWord &);
48 void operator()(const DocLinkedWord &);
49 void operator()(const DocWhiteSpace &);
50 void operator()(const DocSymbol &);
51 void operator()(const DocEmoji &);
52 void operator()(const DocURL &);
53 void operator()(const DocLineBreak &);
54 void operator()(const DocHorRuler &);
55 void operator()(const DocStyleChange &);
56 void operator()(const DocVerbatim &);
57 void operator()(const DocAnchor &);
58 void operator()(const DocInclude &);
59 void operator()(const DocIncOperator &);
60 void operator()(const DocFormula &);
61 void operator()(const DocIndexEntry &);
62 void operator()(const DocSimpleSectSep &);
63 void operator()(const DocCite &);
64 void operator()(const DocSeparator &);
65 //--------------------------------------
66 // visitor functions for compound nodes
67 //--------------------------------------
68 void operator()(const DocAutoList &);
69 void operator()(const DocAutoListItem &);
70 void operator()(const DocPara &) ;
71 void operator()(const DocRoot &);
72 void operator()(const DocSimpleSect &);
73 void operator()(const DocTitle &);
74 void operator()(const DocSimpleList &);
75 void operator()(const DocSimpleListItem &);
76 void operator()(const DocSection &);
77 void operator()(const DocHtmlList &);
78 void operator()(const DocHtmlListItem &);
79 void operator()(const DocHtmlDescList &);
80 void operator()(const DocHtmlDescTitle &);
81 void operator()(const DocHtmlDescData &);
82 void operator()(const DocHtmlTable &);
83 void operator()(const DocHtmlRow &);
84 void operator()(const DocHtmlCell &);
85 void operator()(const DocHtmlCaption &);
86 void operator()(const DocInternal &);
87 void operator()(const DocHRef &);
88 void operator()(const DocHtmlSummary &);
89 void operator()(const DocHtmlDetails &);
90 void operator()(const DocHtmlHeader &);
91 void operator()(const DocImage &);
92 void operator()(const DocDotFile &);
93 void operator()(const DocMscFile &);
94 void operator()(const DocDiaFile &);
95 void operator()(const DocPlantUmlFile &);
96 void operator()(const DocMermaidFile &);
97 void operator()(const DocLink &);
98 void operator()(const DocRef &);
99 void operator()(const DocSecRefItem &);
100 void operator()(const DocSecRefList &);
101 void operator()(const DocParamSect &);
102 void operator()(const DocParamList &);
103 void operator()(const DocXRefItem &);
104 void operator()(const DocInternalRef &);
105 void operator()(const DocText &);
106 void operator()(const DocHtmlBlockQuote &);
107 void operator()(const DocVhdlFlow &);
108 void operator()(const DocParBlock &);
109
110 private:
111 //--------------------------------------
112 // helper functions
113 //--------------------------------------
114 void filter(const QCString &str, const bool retainNewLine = false);
115 void startLink(const QCString &file,
116 const QCString &anchor);
117 void endLink();
118 void startMscFile(const QCString &fileName,const QCString &relPath, const QCString &width,
119 const QCString &height, bool hasCaption,const DocNodeList &children,
120 const QCString &srcFile, int srcLine, bool newFile = true);
121 void endMscFile(bool hasCaption);
122 void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile = true);
123 void startDiaFile(const QCString &fileName,const QCString &relPath, const QCString &width,
124 const QCString &height, bool hasCaption,const DocNodeList &children,
125 const QCString &srcFile, int srcLine, bool newFile = true);
126 void endDiaFile(bool hasCaption);
127 void writeDiaFile(const QCString &fileName, const DocVerbatim &s);
128 void startDotFile(const QCString &fileName,const QCString &relPath, const QCString &width,
129 const QCString &height, bool hasCaption,const DocNodeList &children,
130 const QCString &srcFile, int srcLine, bool newFile = true);
131 void endDotFile(bool hasCaption);
132 void writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile = true);
133 void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s);
134 void startPlantUmlFile(const QCString &fileName,const QCString &relPath, const QCString &width,
135 const QCString &height, bool hasCaption,const DocNodeList &children,
136 const QCString &srcFile, int srcLine);
137 void endPlantUmlFile(bool hasCaption);
138 void writeMermaidFile(const QCString &fileName, const DocVerbatim &s);
139 void startMermaidFile(const QCString &fileName,const QCString &relPath, const QCString &width,
140 const QCString &height, bool hasCaption,const DocNodeList &children,
141 const QCString &srcFile, int srcLine);
142 void endMermaidFile(bool hasCaption);
144 const DocNodeList &children,
145 bool hasCaption,
146 const QCString &name,
147 const QCString &width,
148 const QCString &height,
149 bool inlineImage = FALSE);
150 void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage = FALSE);
151 void visitCaption(const DocNodeList &children);
152 //--------------------------------------
153 // state variables
154 //--------------------------------------
157 bool m_insidePre = false;
158 bool m_hide = false;
161 int m_colCnt = 0;
162 BoolStack m_bodySet; // it is possible to have tables without a header, needs to be an array as we can have tables in tables
163};
164
165#endif
Node representing an anchor.
Definition docnode.h:229
Node representing an auto List.
Definition docnode.h:571
Node representing an item of a auto list.
Definition docnode.h:595
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
Node representing a dia file.
Definition docnode.h:731
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
Node representing an item of a cross-referenced list.
Definition docnode.h:529
Node representing a Hypertext reference.
Definition docnode.h:832
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1297
Node representing a HTML table caption.
Definition docnode.h:1234
Node representing a HTML table cell.
Definition docnode.h:1199
Node representing a HTML description data.
Definition docnode.h:1187
Node representing a Html description list.
Definition docnode.h:910
Node representing a Html description item.
Definition docnode.h:897
Node Html details.
Definition docnode.h:866
Node Html heading.
Definition docnode.h:882
Node representing a Html list.
Definition docnode.h:1009
Node representing a HTML list item.
Definition docnode.h:1171
Node representing a HTML table row.
Definition docnode.h:1252
Node Html summary.
Definition docnode.h:853
Node representing a HTML table.
Definition docnode.h:1275
Node representing an image.
Definition docnode.h:642
Node representing a include/dontinclude operator block.
Definition docnode.h:477
Node representing an included text block from file.
Definition docnode.h:435
Node representing an entry in the index.
Definition docnode.h:552
Node representing an internal section of documentation.
Definition docnode.h:978
Node representing an internal reference to some item.
Definition docnode.h:816
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
Node representing a mermaid file.
Definition docnode.h:749
Node representing a msc file.
Definition docnode.h:722
Node representing an block of paragraphs.
Definition docnode.h:988
Node representing a paragraph in the documentation tree.
Definition docnode.h:1089
Node representing a parameter list.
Definition docnode.h:1131
Node representing a parameter section.
Definition docnode.h:1062
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:787
Root node of documentation tree.
Definition docnode.h:1319
Node representing a reference to a section.
Definition docnode.h:944
Node representing a list of section references.
Definition docnode.h:968
Node representing a normal section.
Definition docnode.h:923
Node representing a separator.
Definition docnode.h:365
Node representing a simple list.
Definition docnode.h:999
Node representing a simple list item.
Definition docnode.h:1159
Node representing a simple section.
Definition docnode.h:1026
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1053
Node representing a style change.
Definition docnode.h:268
Node representing a special symbol.
Definition docnode.h:328
Root node of a text fragment.
Definition docnode.h:1310
Node representing a simple section title.
Definition docnode.h:608
Node representing a URL (or email address).
Definition docnode.h:188
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
Node representing a VHDL flow chart.
Definition docnode.h:758
Node representing some amount of white space.
Definition docnode.h:354
Node representing a word.
Definition docnode.h:153
Node representing an item of a cross-referenced list.
Definition docnode.h:621
void visitPreStart(TextStream &t, const DocNodeList &children, bool hasCaption, const QCString &name, const QCString &width, const QCString &height, bool inlineImage=FALSE)
void endDiaFile(bool hasCaption)
void operator()(const DocWord &)
void filter(const QCString &str, const bool retainNewLine=false)
void startDotFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void visitChildren(const T &t)
void startLink(const QCString &file, const QCString &anchor)
void endMermaidFile(bool hasCaption)
void startMscFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void startMermaidFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
OutputCodeList & m_ci
void writeMscFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
void endPlantUmlFile(bool hasCaption)
void visitCaption(const DocNodeList &children)
void writeDiaFile(const QCString &fileName, const DocVerbatim &s)
void endDotFile(bool hasCaption)
void visitPostEnd(TextStream &t, bool hasCaption, bool inlineImage=FALSE)
void writeMermaidFile(const QCString &fileName, const DocVerbatim &s)
void writePlantUMLFile(const QCString &fileName, const DocVerbatim &s)
void endMscFile(bool hasCaption)
DocbookDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt)
void startDiaFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine, bool newFile=true)
void startPlantUmlFile(const QCString &fileName, const QCString &relPath, const QCString &width, const QCString &height, bool hasCaption, const DocNodeList &children, const QCString &srcFile, int srcLine)
void writeDotFile(const QCString &fileName, const DocVerbatim &s, bool newFile=true)
Class representing a list of different code generators.
Definition outputlist.h:165
This is an alternative implementation of QCString.
Definition qcstring.h:101
Text streaming class that buffers data.
Definition textstream.h:36
std::stack< bool > BoolStack
Definition containers.h:35
#define FALSE
Definition qcstring.h:34