summaryrefslogtreecommitdiffstats
path: root/src/docvisitor.h
blob: 924a562ee142a12f5d2ee54d3984c65abcbdc504 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/******************************************************************************
 *
 * 
 *
 *
 * Copyright (C) 1997-2004 by Dimitri van Heesch.
 *
 * Permission to use, copy, modify, and distribute this software and its
 * documentation under the terms of the GNU General Public License is hereby 
 * granted. No representations are made about the suitability of this software 
 * for any purpose. It is provided "as is" without express or implied warranty.
 * See the GNU General Public License for more details.
 *
 * Documents produced by Doxygen are derivative works derived from the
 * input used in their production; they are not affected by this license.
 *
 */

#ifndef _DOCVISITOR_H
#define _DOCVISITOR_H

// ids
const int DocVisitor_Html  = 0;
const int DocVisitor_Latex = 1;
const int DocVisitor_XML   = 2;
const int DocVisitor_RTF   = 3;
const int DocVisitor_Man   = 4;
const int DocVisitor_Other = 5;

// forward declarations
class DocWord;
class DocWhiteSpace;
class DocAutoList;
class DocAutoListItem;
class DocPara;
class DocRoot;
class DocSymbol;
class DocURL;
class DocStyleChange;
class DocSimpleSect;
class DocTitle;
class DocSimpleList;
class DocSimpleListItem;
class DocSection;
class DocVerbatim;
class DocXRefItem;
class DocHtmlList;
class DocHtmlListItem;
class DocHtmlDescList;
class DocHtmlDescTitle;
class DocHtmlDescData;
class DocHtmlTable;
class DocHtmlRow;
class DocHtmlCell;
class DocHtmlCaption;
class DocLineBreak;
class DocHorRuler;
class DocAnchor;
class DocIndexEntry;
class DocInternal;
class DocHRef;
class DocInclude;
class DocIncOperator;
class DocHtmlHeader;
class DocImage;
class DocDotFile;
class DocLink;
class DocRef;
class DocFormula;
class DocSecRefItem;
class DocSecRefList;
//class DocLanguage;
class DocLinkedWord;
class DocParamSect;
class DocParamList;
class DocInternalRef;
class DocCopy;
class DocText;

/*! @brief Abstract visitor that participates in the visitor pattern.
 */
class DocVisitor
{
    int m_id;
  public:
    DocVisitor(int id) : m_id(id) {}
    virtual ~DocVisitor() {}
    int id() const { return m_id; }

    /*! @name Visitor functions for leaf nodes 
     *  @{
     */
    virtual void visit(DocWord *) = 0;
    virtual void visit(DocWhiteSpace *) = 0;
    virtual void visit(DocSymbol *) = 0;
    virtual void visit(DocURL *) = 0;
    virtual void visit(DocStyleChange *) = 0;
    virtual void visit(DocVerbatim *) = 0;
    virtual void visit(DocLineBreak *) = 0;
    virtual void visit(DocHorRuler *) = 0;
    virtual void visit(DocAnchor *) = 0;
    virtual void visit(DocInclude *) = 0;
    virtual void visit(DocIncOperator *) = 0;
    virtual void visit(DocFormula *) = 0;
    virtual void visit(DocLinkedWord *) = 0;
    virtual void visit(DocIndexEntry *) = 0;
    /*! @} */

    /*! @name Visitor functions for internal nodes 
     *  @{
     */
    virtual void visitPre(DocAutoList *) = 0;
    virtual void visitPost(DocAutoList *) = 0;
    virtual void visitPre(DocAutoListItem *) = 0;
    virtual void visitPost(DocAutoListItem *) = 0;
    virtual void visitPre(DocPara *) = 0;
    virtual void visitPost(DocPara *) = 0;
    virtual void visitPre(DocRoot *) = 0;
    virtual void visitPost(DocRoot *) = 0;
    virtual void visitPre(DocSimpleSect *) = 0;
    virtual void visitPost(DocSimpleSect *) = 0;
    virtual void visitPre(DocTitle *) = 0;
    virtual void visitPost(DocTitle *) = 0;
    virtual void visitPre(DocSimpleList *) = 0;
    virtual void visitPost(DocSimpleList *) = 0;
    virtual void visitPre(DocSimpleListItem *) = 0;
    virtual void visitPost(DocSimpleListItem *) = 0;
    virtual void visitPre(DocSection *) = 0;
    virtual void visitPost(DocSection *) = 0;
    virtual void visitPre(DocHtmlList *) = 0;
    virtual void visitPost(DocHtmlListItem *) = 0;
    virtual void visitPre(DocHtmlListItem *) = 0;
    virtual void visitPost(DocHtmlList *) = 0;
    virtual void visitPre(DocHtmlDescList *) = 0;
    virtual void visitPost(DocHtmlDescList *) = 0;
    virtual void visitPre(DocHtmlDescTitle *) = 0;
    virtual void visitPost(DocHtmlDescTitle *) = 0;
    virtual void visitPre(DocHtmlDescData *) = 0;
    virtual void visitPost(DocHtmlDescData *) = 0;
    virtual void visitPre(DocHtmlTable *) = 0;
    virtual void visitPost(DocHtmlRow *) = 0;
    virtual void visitPre(DocHtmlCell *) = 0;
    virtual void visitPost(DocHtmlCell *) = 0;
    virtual void visitPre(DocHtmlRow *) = 0;
    virtual void visitPost(DocHtmlTable *) = 0;
    virtual void visitPre(DocHtmlCaption *) = 0;
    virtual void visitPost(DocHtmlCaption *) = 0;
    virtual void visitPre(DocInternal *) = 0;
    virtual void visitPost(DocInternal *) = 0;
    virtual void visitPre(DocHRef *) = 0;
    virtual void visitPost(DocHRef *) = 0;
    virtual void visitPre(DocHtmlHeader *) = 0;
    virtual void visitPost(DocHtmlHeader *) = 0;
    virtual void visitPre(DocImage *) = 0;
    virtual void visitPost(DocImage *) = 0;
    virtual void visitPre(DocDotFile *) = 0;
    virtual void visitPost(DocDotFile *) = 0;
    virtual void visitPre(DocLink *) = 0;
    virtual void visitPost(DocLink *) = 0;
    virtual void visitPre(DocRef *) = 0;
    virtual void visitPost(DocRef *) = 0;
    virtual void visitPre(DocSecRefItem *) = 0;
    virtual void visitPost(DocSecRefItem *) = 0;
    virtual void visitPre(DocSecRefList *) = 0;
    virtual void visitPost(DocSecRefList *) = 0;
    //virtual void visitPre(DocLanguage *) = 0;
    //virtual void visitPost(DocLanguage *) = 0;
    virtual void visitPre(DocParamSect *) = 0;
    virtual void visitPost(DocParamSect *) = 0;
    virtual void visitPre(DocParamList *) = 0;
    virtual void visitPost(DocParamList *) = 0;
    virtual void visitPre(DocXRefItem *) = 0;
    virtual void visitPost(DocXRefItem *) = 0;
    virtual void visitPre(DocInternalRef *) = 0;
    virtual void visitPost(DocInternalRef *) = 0;
    virtual void visitPre(DocCopy *) = 0;
    virtual void visitPost(DocCopy *) = 0;
    virtual void visitPre(DocText *) = 0;
    virtual void visitPost(DocText *) = 0;
    /*! @} */
};

#endif