Doxygen
htmldocvisitor.h
浏览该文件的文档.
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 "qcstring.h"
21 
22 class Definition;
23 class MemberDef;
24 class DocNode;
26 class TextStream;
27 
28 /*! @brief Concrete visitor implementation for HTML output. */
29 class HtmlDocVisitor : public DocVisitor
30 {
31  public:
33 
34  //--------------------------------------
35  // visitor functions for leaf nodes
36  //--------------------------------------
37 
38  void visit(DocWord *);
39  void visit(DocLinkedWord *);
40  void visit(DocWhiteSpace *);
41  void visit(DocSymbol *);
42  void visit(DocEmoji *);
43  void visit(DocURL *);
44  void visit(DocLineBreak *);
45  void visit(DocHorRuler *);
46  void visit(DocStyleChange *);
47  void visit(DocVerbatim *);
48  void visit(DocAnchor *);
49  void visit(DocInclude *);
50  void visit(DocIncOperator *);
51  void visit(DocFormula *);
52  void visit(DocIndexEntry *);
53  void visit(DocSimpleSectSep *);
54  void visit(DocCite *);
55 
56  //--------------------------------------
57  // visitor functions for compound nodes
58  //--------------------------------------
59 
60  void visitPre(DocAutoList *);
61  void visitPost(DocAutoList *);
62  void visitPre(DocAutoListItem *);
63  void visitPost(DocAutoListItem *);
64  void visitPre(DocPara *) ;
65  void visitPost(DocPara *);
66  void visitPre(DocRoot *);
67  void visitPost(DocRoot *);
68  void visitPre(DocSimpleSect *);
69  void visitPost(DocSimpleSect *);
70  void visitPre(DocTitle *);
71  void visitPost(DocTitle *);
72  void visitPre(DocSimpleList *);
73  void visitPost(DocSimpleList *);
76  void visitPre(DocSection *);
77  void visitPost(DocSection *);
78  void visitPre(DocHtmlList *);
79  void visitPost(DocHtmlList *) ;
80  void visitPre(DocHtmlListItem *);
81  void visitPost(DocHtmlListItem *);
82  void visitPre(DocHtmlDescList *);
83  void visitPost(DocHtmlDescList *);
84  void visitPre(DocHtmlDescTitle *);
86  void visitPre(DocHtmlDescData *);
87  void visitPost(DocHtmlDescData *);
88  void visitPre(DocHtmlTable *);
89  void visitPost(DocHtmlTable *);
90  void visitPre(DocHtmlRow *);
91  void visitPost(DocHtmlRow *) ;
92  void visitPre(DocHtmlCell *);
93  void visitPost(DocHtmlCell *);
94  void visitPre(DocHtmlCaption *);
95  void visitPost(DocHtmlCaption *);
96  void visitPre(DocInternal *);
97  void visitPost(DocInternal *);
98  void visitPre(DocHRef *);
99  void visitPost(DocHRef *);
100  void visitPre(DocHtmlHeader *);
101  void visitPost(DocHtmlHeader *);
102  void visitPre(DocImage *);
103  void visitPost(DocImage *);
104  void visitPre(DocDotFile *);
105  void visitPost(DocDotFile *);
106  void visitPre(DocMscFile *);
107  void visitPost(DocMscFile *);
108  void visitPre(DocDiaFile *);
109  void visitPost(DocDiaFile *);
110  void visitPre(DocLink *);
111  void visitPost(DocLink *);
112  void visitPre(DocRef *);
113  void visitPost(DocRef *);
114  void visitPre(DocSecRefItem *);
115  void visitPost(DocSecRefItem *);
116  void visitPre(DocSecRefList *);
117  void visitPost(DocSecRefList *);
118  void visitPre(DocParamSect *);
119  void visitPost(DocParamSect *);
120  void visitPre(DocParamList *);
121  void visitPost(DocParamList *);
122  void visitPre(DocXRefItem *);
123  void visitPost(DocXRefItem *);
124  void visitPre(DocInternalRef *);
125  void visitPost(DocInternalRef *);
126  void visitPre(DocText *);
127  void visitPost(DocText *);
128  void visitPre(DocHtmlBlockQuote *);
130  void visitPre(DocVhdlFlow *);
131  void visitPost(DocVhdlFlow *);
132  void visitPre(DocParBlock *);
133  void visitPost(DocParBlock *);
134 
135  private:
136 
137  //--------------------------------------
138  // helper functions
139  //--------------------------------------
140 
141  void writeObfuscatedMailAddress(const QCString &url);
142  void filter(const QCString &str);
143  void filterQuotedCdataAttr(const QCString &str);
144  void startLink(const QCString &ref,const QCString &file,
145  const QCString &relPath,const QCString &anchor,
146  const QCString &tooltip = "");
147  void endLink();
148  void writeDotFile(const QCString &fileName,const QCString &relPath,const QCString &context,
149  const QCString &srcFile,int srcLine);
150  void writeMscFile(const QCString &fileName,const QCString &relPath,const QCString &context,
151  const QCString &srcFile,int srcLine);
152  void writeDiaFile(const QCString &fileName,const QCString &relPath,const QCString &context,
153  const QCString &srcFile,int srcLine);
154  void writePlantUMLFile(const QCString &fileName,const QCString &relPath,const QCString &context,
155  const QCString &srcFile,int srcLine);
156 
157  void forceEndParagraph(DocNode *n);
158  void forceStartParagraph(DocNode *n);
159 
160  //--------------------------------------
161  // state variables
162  //--------------------------------------
163 
167  bool m_hide;
170 };
171 
172 #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
HtmlDocVisitor::writeDiaFile
void writeDiaFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Definition: htmldocvisitor.cpp:2297
HtmlDocVisitor::startLink
void startLink(const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
Definition: htmldocvisitor.cpp:2224
HtmlDocVisitor::visit
void visit(DocWord *)
Definition: htmldocvisitor.cpp:279
Definition
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
HtmlDocVisitor::visitPre
void visitPre(DocAutoList *)
Definition: htmldocvisitor.cpp:953
DocHtmlHeader
Node Html heading
Definition: docparser.h:957
docvisitor.h
DocHtmlListItem
Node representing a HTML list item
Definition: docparser.h:1286
HtmlDocVisitor::forceStartParagraph
void forceStartParagraph(DocNode *n)
Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the pa...
Definition: htmldocvisitor.cpp:2423
DocVhdlFlow
Node representing a VHDL flow chart
Definition: docparser.h:860
DocNode
Abstract node interface with type information.
Definition: docparser.h:96
DocHtmlDescData
Node representing a HTML description data
Definition: docparser.h:1303
DocHtmlDescTitle
Node representing a Html description item
Definition: docparser.h:973
HtmlDocVisitor::filterQuotedCdataAttr
void filterQuotedCdataAttr(const QCString &str)
Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be...
Definition: htmldocvisitor.cpp:2188
DocEmoji
Node representing a n emoji
Definition: docparser.h:469
DocMscFile
Node representing a msc file
Definition: docparser.h:840
HtmlDocVisitor::m_ci
CodeOutputInterface & m_ci
Definition: htmldocvisitor.h:165
DocSecRefItem
Node representing a reference to a section
Definition: docparser.h:1023
DocAnchor
Node representing an anchor
Definition: docparser.h:303
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DocText
Root node of a text fragment
Definition: docparser.h:1447
DocVisitor
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:92
qcstring.h
HtmlDocVisitor
Concrete visitor implementation for HTML output.
Definition: htmldocvisitor.h:29
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
HtmlDocVisitor::writeDotFile
void writeDotFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Definition: htmldocvisitor.cpp:2255
DocIndexEntry
Node representing an entry in the index.
Definition: docparser.h:682
HtmlDocVisitor::m_ctx
const Definition * m_ctx
Definition: htmldocvisitor.h:168
DocSecRefList
Node representing a list of section references
Definition: docparser.h:1048
DocLineBreak
Node representing a line break
Definition: docparser.h:272
DocWord
Node representing a word
Definition: docparser.h:217
DocSymbol
Node representing a special symbol
Definition: docparser.h:385
MemberDef
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
DocXRefItem
Node representing an item of a cross-referenced list
Definition: docparser.h:749
DocImage
Node representing an image
Definition: docparser.h:771
DocURL
Node representing a URL (or email address)
Definition: docparser.h:256
HtmlDocVisitor::visitPost
void visitPost(DocAutoList *)
Definition: htmldocvisitor.cpp:977
DocHtmlCaption
Node representing a HTML table caption
Definition: docparser.h:1352
HtmlDocVisitor::writeMscFile
void writeMscFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Definition: htmldocvisitor.cpp:2274
DocParamList
Node representing a parameter list.
Definition: docparser.h:1228
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
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
DocParamSect
Node representing a parameter section
Definition: docparser.h:1150
DocHtmlList
Node representing a Html list
Definition: docparser.h:1093
DocSimpleSect
Node representing a simple section
Definition: docparser.h:1111
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
HtmlDocVisitor::m_hide
bool m_hide
Definition: htmldocvisitor.h:167
DocLinkedWord
Node representing a word that can be linked to something
Definition: docparser.h:231
HtmlDocVisitor::endLink
void endLink()
Definition: htmldocvisitor.cpp:2250
HtmlDocVisitor::m_insidePre
bool m_insidePre
Definition: htmldocvisitor.h:166
CodeOutputInterface
Output interface for code parser.
Definition: outputgen.h:61
HtmlDocVisitor::writePlantUMLFile
void writePlantUMLFile(const QCString &fileName, const QCString &relPath, const QCString &context, const QCString &srcFile, int srcLine)
Definition: htmldocvisitor.cpp:2317
DocDiaFile
Node representing a dia file
Definition: docparser.h:850
HtmlDocVisitor::m_langExt
QCString m_langExt
Definition: htmldocvisitor.h:169
DocSimpleList
Node representing a simple list
Definition: docparser.h:1082
DocSimpleListItem
Node representing a simple list item
Definition: docparser.h:1266
DocWhiteSpace
Node representing some amount of white space
Definition: docparser.h:484
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
HtmlDocVisitor::filter
void filter(const QCString &str)
Definition: htmldocvisitor.cpp:2151
DocInternalRef
Node representing an internal reference to some item
Definition: docparser.h:919
HtmlDocVisitor::writeObfuscatedMailAddress
void writeObfuscatedMailAddress(const QCString &url)
Definition: htmldocvisitor.cpp:336
HtmlDocVisitor::HtmlDocVisitor
HtmlDocVisitor(TextStream &t, CodeOutputInterface &ci, const Definition *ctx)
Definition: htmldocvisitor.cpp:267
HtmlDocVisitor::forceEndParagraph
void forceEndParagraph(DocNode *n)
Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the pa...
Definition: htmldocvisitor.cpp:2387
DocHtmlRow
Node representing a HTML table row
Definition: docparser.h:1371
HtmlDocVisitor::m_t
TextStream & m_t
Definition: htmldocvisitor.h:164
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108