Doxygen
Loading...
Searching...
No Matches
htmldocvisitor.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2021 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 HTMLDOCVISITOR_H
17#define HTMLDOCVISITOR_H
18
19#include "docvisitor.h"
20#include "docnode.h"
21#include "qcstring.h"
22
23class Definition;
24class MemberDef;
25class OutputCodeList;
26class TextStream;
27
28/*! @brief Concrete visitor implementation for HTML output. */
30{
31 public:
32 HtmlDocVisitor(TextStream &t,OutputCodeList &ci,const Definition *ctx,const QCString &fn = QCString());
33
34 //--------------------------------------
35 // visitor functions for leaf nodes
36 //--------------------------------------
37
38 void operator()(const DocWord &);
39 void operator()(const DocLinkedWord &);
40 void operator()(const DocWhiteSpace &);
41 void operator()(const DocSymbol &);
42 void operator()(const DocEmoji &);
43 void operator()(const DocURL &);
44 void operator()(const DocLineBreak &);
45 void operator()(const DocHorRuler &);
46 void operator()(const DocStyleChange &);
47 void operator()(const DocVerbatim &);
48 void operator()(const DocAnchor &);
49 void operator()(const DocInclude &);
50 void operator()(const DocIncOperator &);
51 void operator()(const DocFormula &);
52 void operator()(const DocIndexEntry &);
53 void operator()(const DocSimpleSectSep &);
54 void operator()(const DocCite &);
55 void operator()(const DocSeparator &);
56
57 //--------------------------------------
58 // visitor functions for compound nodes
59 //--------------------------------------
60
61 void operator()(const DocAutoList &);
62 void operator()(const DocAutoListItem &);
63 void operator()(const DocPara &) ;
64 void operator()(const DocRoot &);
65 void operator()(const DocSimpleSect &);
66 void operator()(const DocTitle &);
67 void operator()(const DocSimpleList &);
68 void operator()(const DocSimpleListItem &);
69 void operator()(const DocSection &);
70 void operator()(const DocHtmlList &);
71 void operator()(const DocHtmlListItem &);
72 void operator()(const DocHtmlDescList &);
73 void operator()(const DocHtmlDescTitle &);
74 void operator()(const DocHtmlDescData &);
75 void operator()(const DocHtmlTable &);
76 void operator()(const DocHtmlRow &);
77 void operator()(const DocHtmlCell &);
78 void operator()(const DocHtmlCaption &);
79 void operator()(const DocInternal &);
80 void operator()(const DocHRef &);
81 void operator()(const DocHtmlSummary &);
82 void operator()(const DocHtmlDetails &);
83 void operator()(const DocHtmlHeader &);
84 void operator()(const DocImage &);
85 void operator()(const DocDotFile &);
86 void operator()(const DocMscFile &);
87 void operator()(const DocDiaFile &);
88 void operator()(const DocPlantUmlFile &);
89 void operator()(const DocLink &);
90 void operator()(const DocRef &);
91 void operator()(const DocSecRefItem &);
92 void operator()(const DocSecRefList &);
93 void operator()(const DocParamSect &);
94 void operator()(const DocParamList &);
95 void operator()(const DocXRefItem &);
96 void operator()(const DocInternalRef &);
97 void operator()(const DocText &);
98 void operator()(const DocHtmlBlockQuote &);
99 void operator()(const DocVhdlFlow &);
100 void operator()(const DocParBlock &);
101
102 private:
103
104 template<class T>
105 void visitChildren(const T &t)
106 {
107 for (const auto &child : t.children())
108 {
109 std::visit(*this, child);
110 }
111 }
112 template<class T>
113 void visitCaption(TextStream &t,const T &n);
114
115 //--------------------------------------
116 // helper functions
117 //--------------------------------------
118
119 void writeObfuscatedMailAddress(const QCString &url);
120 void filter(const QCString &str, const bool retainNewline = false);
121 QCString filterQuotedCdataAttr(const QCString &str);
122 void startLink(const QCString &ref,const QCString &file,
123 const QCString &relPath,const QCString &anchor,
124 const QCString &tooltip = "");
125 void endLink();
126 void writeDotFile(const QCString &fileName,const QCString &relPath,const QCString &context,
127 const QCString &srcFile,int srcLine);
128 void writeMscFile(const QCString &fileName,const QCString &relPath,const QCString &context,
129 const QCString &srcFile,int srcLine);
130 void writeDiaFile(const QCString &fileName,const QCString &relPath,const QCString &context,
131 const QCString &srcFile,int srcLine);
132 void writePlantUMLFile(const QCString &fileName,const QCString &relPath,const QCString &context,
133 const QCString &srcFile,int srcLine);
134
135 template<class DocNode>
136 void forceEndParagraph(const DocNode &n);
137 template<class DocNode>
138 void forceStartParagraph(const DocNode &n);
139
140 //--------------------------------------
141 // state variables
142 //--------------------------------------
143
144 TextStream &m_t;
145 OutputCodeList &m_ci;
146 bool m_insidePre = false;
147 bool m_hide = false;
148 bool m_insideTitle = false;
149 const Definition *m_ctx;
150 QCString m_fileName;
151 QCString m_langExt;
152};
153
154#endif
The common base class of all entity definitions found in the sources.
Definition definition.h:76
HtmlDocVisitor(TextStream &t, OutputCodeList &ci, const Definition *ctx, const QCString &fn=QCString())
TextStream & m_t
void writePlantUMLFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
QCString filterQuotedCdataAttr(const QCString &str)
Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be...
void writeDotFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
void forceStartParagraph(const DocNode &n)
void operator()(const DocWord &)
void startLink(const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
void visitCaption(TextStream &t, const T &n)
OutputCodeList & m_ci
void writeDiaFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
void writeMscFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
void visitChildren(const T &t)
void filter(const QCString &str, const bool retainNewline=false)
void forceEndParagraph(const DocNode &n)
const Definition * m_ctx
void writeObfuscatedMailAddress(const QCString &url)
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
Class representing a list of different code generators.
Definition outputlist.h:164
Text streaming class that buffers data.
Definition textstream.h:36