Doxygen
docvisitor.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 DOCVISITOR_H
17 #define DOCVISITOR_H
18 
19 #include <memory>
20 
21 #include "qcstring.h"
22 
23 // ids
24 const int DocVisitor_Html = 0;
25 const int DocVisitor_Latex = 1;
26 const int DocVisitor_XML = 2;
27 const int DocVisitor_RTF = 3;
28 const int DocVisitor_Man = 4;
29 const int DocVisitor_Text = 5;
30 const int DocVisitor_Other = 6;
31 const int DocVisitor_Docbook = 7;
32 
33 // forward declarations
34 class DocWord;
35 class DocWhiteSpace;
36 class DocAutoList;
37 class DocAutoListItem;
38 class DocPara;
39 class DocRoot;
40 class DocSymbol;
41 class DocEmoji;
42 class DocURL;
43 class DocStyleChange;
44 class DocSimpleSect;
45 class DocTitle;
46 class DocSimpleList;
47 class DocSimpleListItem;
48 class DocSection;
49 class DocVerbatim;
50 class DocXRefItem;
51 class DocHtmlList;
52 class DocHtmlListItem;
53 class DocHtmlDescList;
54 class DocHtmlDescTitle;
55 class DocHtmlDescData;
56 class DocHtmlTable;
57 class DocHtmlRow;
58 class DocHtmlCell;
59 class DocHtmlCaption;
60 class DocLineBreak;
61 class DocHorRuler;
62 class DocAnchor;
63 class DocIndexEntry;
64 class DocInternal;
65 class DocHRef;
66 class DocInclude;
67 class DocIncOperator;
68 class DocHtmlHeader;
69 class DocImage;
70 class DocDotFile;
71 class DocMscFile;
72 class DocDiaFile;
73 class DocLink;
74 class DocCite;
75 class DocRef;
76 class DocFormula;
77 class DocSecRefItem;
78 class DocSecRefList;
79 class DocLinkedWord;
80 class DocParamSect;
81 class DocParamList;
82 class DocInternalRef;
83 class DocText;
84 class DocSimpleSectSep;
85 class DocHtmlBlockQuote;
86 class DocVhdlFlow;
87 class DocParBlock;
89 
90 /*! @brief Abstract visitor that participates in the visitor pattern.
91  */
93 {
94  struct Private;
95  std::unique_ptr<Private> m_p;
96  public:
97  DocVisitor(int id);
98  virtual ~DocVisitor();
99  int id() const;
100  CodeParserInterface &getCodeParser(const QCString &langExt);
101  void pushHidden(bool hide);
102  bool popHidden();
103 
104  /*! @name Visitor functions for leaf nodes
105  * @{
106  */
107  virtual void visit(DocWord *) = 0;
108  virtual void visit(DocWhiteSpace *) = 0;
109  virtual void visit(DocSymbol *) = 0;
110  virtual void visit(DocEmoji *) = 0;
111  virtual void visit(DocURL *) = 0;
112  virtual void visit(DocStyleChange *) = 0;
113  virtual void visit(DocVerbatim *) = 0;
114  virtual void visit(DocLineBreak *) = 0;
115  virtual void visit(DocHorRuler *) = 0;
116  virtual void visit(DocAnchor *) = 0;
117  virtual void visit(DocInclude *) = 0;
118  virtual void visit(DocIncOperator *) = 0;
119  virtual void visit(DocFormula *) = 0;
120  virtual void visit(DocLinkedWord *) = 0;
121  virtual void visit(DocIndexEntry *) = 0;
122  virtual void visit(DocSimpleSectSep *) = 0;
123  virtual void visit(DocCite *) = 0;
124  /*! @} */
125 
126  /*! @name Visitor functions for internal nodes
127  * @{
128  */
129  virtual void visitPre(DocAutoList *) = 0;
130  virtual void visitPost(DocAutoList *) = 0;
131  virtual void visitPre(DocAutoListItem *) = 0;
132  virtual void visitPost(DocAutoListItem *) = 0;
133  virtual void visitPre(DocPara *) = 0;
134  virtual void visitPost(DocPara *) = 0;
135  virtual void visitPre(DocRoot *) = 0;
136  virtual void visitPost(DocRoot *) = 0;
137  virtual void visitPre(DocSimpleSect *) = 0;
138  virtual void visitPost(DocSimpleSect *) = 0;
139  virtual void visitPre(DocTitle *) = 0;
140  virtual void visitPost(DocTitle *) = 0;
141  virtual void visitPre(DocSimpleList *) = 0;
142  virtual void visitPost(DocSimpleList *) = 0;
143  virtual void visitPre(DocSimpleListItem *) = 0;
144  virtual void visitPost(DocSimpleListItem *) = 0;
145  virtual void visitPre(DocSection *) = 0;
146  virtual void visitPost(DocSection *) = 0;
147  virtual void visitPre(DocHtmlList *) = 0;
148  virtual void visitPost(DocHtmlListItem *) = 0;
149  virtual void visitPre(DocHtmlListItem *) = 0;
150  virtual void visitPost(DocHtmlList *) = 0;
151  virtual void visitPre(DocHtmlDescList *) = 0;
152  virtual void visitPost(DocHtmlDescList *) = 0;
153  virtual void visitPre(DocHtmlDescTitle *) = 0;
154  virtual void visitPost(DocHtmlDescTitle *) = 0;
155  virtual void visitPre(DocHtmlDescData *) = 0;
156  virtual void visitPost(DocHtmlDescData *) = 0;
157  virtual void visitPre(DocHtmlTable *) = 0;
158  virtual void visitPost(DocHtmlRow *) = 0;
159  virtual void visitPre(DocHtmlCell *) = 0;
160  virtual void visitPost(DocHtmlCell *) = 0;
161  virtual void visitPre(DocHtmlRow *) = 0;
162  virtual void visitPost(DocHtmlTable *) = 0;
163  virtual void visitPre(DocHtmlCaption *) = 0;
164  virtual void visitPost(DocHtmlCaption *) = 0;
165  virtual void visitPre(DocInternal *) = 0;
166  virtual void visitPost(DocInternal *) = 0;
167  virtual void visitPre(DocHRef *) = 0;
168  virtual void visitPost(DocHRef *) = 0;
169  virtual void visitPre(DocHtmlHeader *) = 0;
170  virtual void visitPost(DocHtmlHeader *) = 0;
171  virtual void visitPre(DocImage *) = 0;
172  virtual void visitPost(DocImage *) = 0;
173  virtual void visitPre(DocDotFile *) = 0;
174  virtual void visitPost(DocDotFile *) = 0;
175  virtual void visitPre(DocMscFile *) = 0;
176  virtual void visitPost(DocMscFile *) = 0;
177  virtual void visitPre(DocDiaFile *) = 0;
178  virtual void visitPost(DocDiaFile *) = 0;
179  virtual void visitPre(DocLink *) = 0;
180  virtual void visitPost(DocLink *) = 0;
181  virtual void visitPre(DocRef *) = 0;
182  virtual void visitPost(DocRef *) = 0;
183  virtual void visitPre(DocSecRefItem *) = 0;
184  virtual void visitPost(DocSecRefItem *) = 0;
185  virtual void visitPre(DocSecRefList *) = 0;
186  virtual void visitPost(DocSecRefList *) = 0;
187  virtual void visitPre(DocParamSect *) = 0;
188  virtual void visitPost(DocParamSect *) = 0;
189  virtual void visitPre(DocParamList *) = 0;
190  virtual void visitPost(DocParamList *) = 0;
191  virtual void visitPre(DocXRefItem *) = 0;
192  virtual void visitPost(DocXRefItem *) = 0;
193  virtual void visitPre(DocInternalRef *) = 0;
194  virtual void visitPost(DocInternalRef *) = 0;
195  virtual void visitPre(DocText *) = 0;
196  virtual void visitPost(DocText *) = 0;
197  virtual void visitPre(DocHtmlBlockQuote *) = 0;
198  virtual void visitPost(DocHtmlBlockQuote *) = 0;
199  virtual void visitPre(DocVhdlFlow *) = 0;
200  virtual void visitPost(DocVhdlFlow *) = 0;
201  virtual void visitPre(DocParBlock *) = 0;
202  virtual void visitPost(DocParBlock *) = 0;
203  /*! @} */
204 };
205 
206 #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
DocVisitor_Html
const int DocVisitor_Html
Definition: docvisitor.h:24
DocVerbatim
Node representing a verbatim, unparsed text fragment
Definition: docparser.h:510
DocVisitor_Text
const int DocVisitor_Text
Definition: docvisitor.h:29
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
DocVisitor::pushHidden
void pushHidden(bool hide)
Definition: docvisitor.cpp:62
DocHtmlTable
Node representing a HTML table
Definition: docparser.h:1405
DocVisitor::DocVisitor
DocVisitor(int id)
Definition: docvisitor.cpp:32
DocVisitor::id
int id() const
Definition: docvisitor.cpp:57
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
DocVisitor::visit
virtual void visit(DocWord *)=0
DocVisitor::popHidden
bool popHidden()
Definition: docvisitor.cpp:67
DocHtmlHeader
Node Html heading
Definition: docparser.h:957
DocHtmlListItem
Node representing a HTML list item
Definition: docparser.h:1286
DocVhdlFlow
Node representing a VHDL flow chart
Definition: docparser.h:860
CodeParserInterface
Abstract interface for code parsers.
Definition: parserintf.h:83
DocHtmlDescData
Node representing a HTML description data
Definition: docparser.h:1303
DocHtmlDescTitle
Node representing a Html description item
Definition: docparser.h:973
DocEmoji
Node representing a n emoji
Definition: docparser.h:469
DocMscFile
Node representing a msc file
Definition: docparser.h:840
DocSecRefItem
Node representing a reference to a section
Definition: docparser.h:1023
DocAnchor
Node representing an anchor
Definition: docparser.h:303
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
DocVisitor_RTF
const int DocVisitor_RTF
Definition: docvisitor.h:27
DocVisitor::m_p
std::unique_ptr< Private > m_p
Definition: docvisitor.h:94
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
DocVisitor::~DocVisitor
virtual ~DocVisitor()
Definition: docvisitor.cpp:37
DocVisitor::getCodeParser
CodeParserInterface & getCodeParser(const QCString &langExt)
Definition: docvisitor.cpp:41
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
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
DocXRefItem
Node representing an item of a cross-referenced list
Definition: docparser.h:749
DocImage
Node representing an image
Definition: docparser.h:771
DocVisitor::Private
Definition: docvisitor.cpp:25
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
DocVisitor_Docbook
const int DocVisitor_Docbook
Definition: docvisitor.h:31
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
DocVisitor_Latex
const int DocVisitor_Latex
Definition: docvisitor.h:25
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
DocVisitor_Other
const int DocVisitor_Other
Definition: docvisitor.h:30
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
DocVisitor_Man
const int DocVisitor_Man
Definition: docvisitor.h:28
DocAutoList
Node representing an auto List
Definition: docparser.h:703
DocVisitor_XML
const int DocVisitor_XML
Definition: docvisitor.h:26
DocInternal
Node representing an internal section of documentation
Definition: docparser.h:1059
DocLinkedWord
Node representing a word that can be linked to something
Definition: docparser.h:231
DocVisitor::visitPost
virtual void visitPost(DocAutoList *)=0
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
DocWhiteSpace
Node representing some amount of white space
Definition: docparser.h:484
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
DocInternalRef
Node representing an internal reference to some item
Definition: docparser.h:919
DocHtmlRow
Node representing a HTML table row
Definition: docparser.h:1371
DocVisitor::visitPre
virtual void visitPre(DocAutoList *)=0
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108