docvisitor.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #ifndef _DOCVISITOR_H
20 #define _DOCVISITOR_H
21 
22 // ids
23 const int DocVisitor_Html = 0;
24 const int DocVisitor_Latex = 1;
25 const int DocVisitor_XML = 2;
26 const int DocVisitor_RTF = 3;
27 const int DocVisitor_Man = 4;
28 const int DocVisitor_Text = 5;
29 const int DocVisitor_Other = 6;
30 const int DocVisitor_Docbook = 7;
31 
32 // forward declarations
33 class DocWord;
34 class DocWhiteSpace;
35 class DocAutoList;
36 class DocAutoListItem;
37 class DocPara;
38 class DocRoot;
39 class DocSymbol;
40 class DocURL;
41 class DocStyleChange;
42 class DocSimpleSect;
43 class DocTitle;
44 class DocSimpleList;
45 class DocSimpleListItem;
46 class DocSection;
47 class DocVerbatim;
48 class DocXRefItem;
49 class DocHtmlList;
50 class DocHtmlListItem;
51 class DocHtmlDescList;
52 class DocHtmlDescTitle;
53 class DocHtmlDescData;
54 class DocHtmlTable;
55 class DocHtmlRow;
56 class DocHtmlCell;
57 class DocHtmlCaption;
58 class DocLineBreak;
59 class DocHorRuler;
60 class DocAnchor;
61 class DocIndexEntry;
62 class DocInternal;
63 class DocHRef;
64 class DocInclude;
65 class DocIncOperator;
66 class DocHtmlHeader;
67 class DocImage;
68 class DocDotFile;
69 class DocMscFile;
70 class DocDiaFile;
71 class DocLink;
72 class DocCite;
73 class DocRef;
74 class DocFormula;
75 class DocSecRefItem;
76 class DocSecRefList;
77 class DocLinkedWord;
78 class DocParamSect;
79 class DocParamList;
80 class DocInternalRef;
81 class DocCopy; // TODO: no longer generated => remove
82 class DocText;
83 class DocSimpleSectSep;
84 class DocHtmlBlockQuote;
85 class DocVhdlFlow;
86 class DocParBlock;
87 
88 /*! @brief Abstract visitor that participates in the visitor pattern.
89  */
91 {
92  int m_id;
93  public:
94  DocVisitor(int id) : m_id(id) {}
95  virtual ~DocVisitor() {}
96  int id() const { return m_id; }
97 
98  /*! @name Visitor functions for leaf nodes
99  * @{
100  */
101  virtual void visit(DocWord *) = 0;
102  virtual void visit(DocWhiteSpace *) = 0;
103  virtual void visit(DocSymbol *) = 0;
104  virtual void visit(DocURL *) = 0;
105  virtual void visit(DocStyleChange *) = 0;
106  virtual void visit(DocVerbatim *) = 0;
107  virtual void visit(DocLineBreak *) = 0;
108  virtual void visit(DocHorRuler *) = 0;
109  virtual void visit(DocAnchor *) = 0;
110  virtual void visit(DocInclude *) = 0;
111  virtual void visit(DocIncOperator *) = 0;
112  virtual void visit(DocFormula *) = 0;
113  virtual void visit(DocLinkedWord *) = 0;
114  virtual void visit(DocIndexEntry *) = 0;
115  virtual void visit(DocSimpleSectSep *) = 0;
116  virtual void visit(DocCite *) = 0;
117  /*! @} */
118 
119  /*! @name Visitor functions for internal nodes
120  * @{
121  */
122  virtual void visitPre(DocAutoList *) = 0;
123  virtual void visitPost(DocAutoList *) = 0;
124  virtual void visitPre(DocAutoListItem *) = 0;
125  virtual void visitPost(DocAutoListItem *) = 0;
126  virtual void visitPre(DocPara *) = 0;
127  virtual void visitPost(DocPara *) = 0;
128  virtual void visitPre(DocRoot *) = 0;
129  virtual void visitPost(DocRoot *) = 0;
130  virtual void visitPre(DocSimpleSect *) = 0;
131  virtual void visitPost(DocSimpleSect *) = 0;
132  virtual void visitPre(DocTitle *) = 0;
133  virtual void visitPost(DocTitle *) = 0;
134  virtual void visitPre(DocSimpleList *) = 0;
135  virtual void visitPost(DocSimpleList *) = 0;
136  virtual void visitPre(DocSimpleListItem *) = 0;
137  virtual void visitPost(DocSimpleListItem *) = 0;
138  virtual void visitPre(DocSection *) = 0;
139  virtual void visitPost(DocSection *) = 0;
140  virtual void visitPre(DocHtmlList *) = 0;
141  virtual void visitPost(DocHtmlListItem *) = 0;
142  virtual void visitPre(DocHtmlListItem *) = 0;
143  virtual void visitPost(DocHtmlList *) = 0;
144  virtual void visitPre(DocHtmlDescList *) = 0;
145  virtual void visitPost(DocHtmlDescList *) = 0;
146  virtual void visitPre(DocHtmlDescTitle *) = 0;
147  virtual void visitPost(DocHtmlDescTitle *) = 0;
148  virtual void visitPre(DocHtmlDescData *) = 0;
149  virtual void visitPost(DocHtmlDescData *) = 0;
150  virtual void visitPre(DocHtmlTable *) = 0;
151  virtual void visitPost(DocHtmlRow *) = 0;
152  virtual void visitPre(DocHtmlCell *) = 0;
153  virtual void visitPost(DocHtmlCell *) = 0;
154  virtual void visitPre(DocHtmlRow *) = 0;
155  virtual void visitPost(DocHtmlTable *) = 0;
156  virtual void visitPre(DocHtmlCaption *) = 0;
157  virtual void visitPost(DocHtmlCaption *) = 0;
158  virtual void visitPre(DocInternal *) = 0;
159  virtual void visitPost(DocInternal *) = 0;
160  virtual void visitPre(DocHRef *) = 0;
161  virtual void visitPost(DocHRef *) = 0;
162  virtual void visitPre(DocHtmlHeader *) = 0;
163  virtual void visitPost(DocHtmlHeader *) = 0;
164  virtual void visitPre(DocImage *) = 0;
165  virtual void visitPost(DocImage *) = 0;
166  virtual void visitPre(DocDotFile *) = 0;
167  virtual void visitPost(DocDotFile *) = 0;
168  virtual void visitPre(DocMscFile *) = 0;
169  virtual void visitPost(DocMscFile *) = 0;
170  virtual void visitPre(DocDiaFile *) = 0;
171  virtual void visitPost(DocDiaFile *) = 0;
172  virtual void visitPre(DocLink *) = 0;
173  virtual void visitPost(DocLink *) = 0;
174  virtual void visitPre(DocRef *) = 0;
175  virtual void visitPost(DocRef *) = 0;
176  virtual void visitPre(DocSecRefItem *) = 0;
177  virtual void visitPost(DocSecRefItem *) = 0;
178  virtual void visitPre(DocSecRefList *) = 0;
179  virtual void visitPost(DocSecRefList *) = 0;
180  virtual void visitPre(DocParamSect *) = 0;
181  virtual void visitPost(DocParamSect *) = 0;
182  virtual void visitPre(DocParamList *) = 0;
183  virtual void visitPost(DocParamList *) = 0;
184  virtual void visitPre(DocXRefItem *) = 0;
185  virtual void visitPost(DocXRefItem *) = 0;
186  virtual void visitPre(DocInternalRef *) = 0;
187  virtual void visitPost(DocInternalRef *) = 0;
188  virtual void visitPre(DocCopy *) = 0;
189  virtual void visitPost(DocCopy *) = 0;
190  virtual void visitPre(DocText *) = 0;
191  virtual void visitPost(DocText *) = 0;
192  virtual void visitPre(DocHtmlBlockQuote *) = 0;
193  virtual void visitPost(DocHtmlBlockQuote *) = 0;
194  virtual void visitPre(DocVhdlFlow *) = 0;
195  virtual void visitPost(DocVhdlFlow *) = 0;
196  virtual void visitPre(DocParBlock *) = 0;
197  virtual void visitPost(DocParBlock *) = 0;
198  /*! @} */
199 };
200 
201 #endif
const int DocVisitor_Man
Definition: docvisitor.h:27
const int DocVisitor_RTF
Definition: docvisitor.h:26
const int DocVisitor_Html
Definition: docvisitor.h:23
const int DocVisitor_Other
Definition: docvisitor.h:29
virtual ~DocVisitor()
Definition: docvisitor.h:95
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:90
const int DocVisitor_Latex
Definition: docvisitor.h:24
const int DocVisitor_Text
Definition: docvisitor.h:28
int id() const
Definition: docvisitor.h:96
virtual void visitPre(DocAutoList *)=0
DocVisitor(int id)
Definition: docvisitor.h:94
virtual void visitPost(DocAutoList *)=0
virtual void visit(DocWord *)=0
const int DocVisitor_XML
Definition: docvisitor.h:25
const int DocVisitor_Docbook
Definition: docvisitor.h:30