Doxygen
Loading...
Searching...
No Matches
rtfdocvisitor.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 RTFDOCVISITOR_H
20#define RTFDOCVISITOR_H
21
22#include <iostream>
23
24#include "docvisitor.h"
25#include "docnode.h"
26
27class OutputCodeList;
28class TextStream;
29
30/*! @brief Concrete visitor implementation for RTF output. */
32{
33 public:
34 RTFDocVisitor(TextStream &t,OutputCodeList &ci,const QCString &langExt, int hierarchyLevel = 0);
35
36 //--------------------------------------
37 // visitor functions for leaf nodes
38 //--------------------------------------
39
40 void operator()(const DocWord &);
41 void operator()(const DocLinkedWord &);
42 void operator()(const DocWhiteSpace &);
43 void operator()(const DocSymbol &);
44 void operator()(const DocEmoji &);
45 void operator()(const DocURL &);
46 void operator()(const DocLineBreak &);
47 void operator()(const DocHorRuler &);
48 void operator()(const DocStyleChange &);
49 void operator()(const DocVerbatim &);
50 void operator()(const DocAnchor &);
51 void operator()(const DocInclude &);
52 void operator()(const DocIncOperator &);
53 void operator()(const DocFormula &);
54 void operator()(const DocIndexEntry &);
55 void operator()(const DocSimpleSectSep &);
56 void operator()(const DocCite &);
57 void operator()(const DocSeparator &);
58
59 //--------------------------------------
60 // visitor functions for compound nodes
61 //--------------------------------------
62
63 void operator()(const DocAutoList &);
64 void operator()(const DocAutoListItem &);
65 void operator()(const DocPara &);
66 void operator()(const DocRoot &);
67 void operator()(const DocSimpleSect &);
68 void operator()(const DocTitle &);
69 void operator()(const DocSimpleList &);
70 void operator()(const DocSimpleListItem &);
71 void operator()(const DocSection &s);
72 void operator()(const DocHtmlList &s);
73 void operator()(const DocHtmlListItem &);
74 void operator()(const DocHtmlDescList &);
75 void operator()(const DocHtmlDescTitle &);
76 void operator()(const DocHtmlDescData &);
77 void operator()(const DocHtmlTable &t);
78 void operator()(const DocHtmlCaption &);
79 void operator()(const DocHtmlRow &);
80 void operator()(const DocHtmlCell &);
81 void operator()(const DocInternal &);
82 void operator()(const DocHRef &);
83 void operator()(const DocHtmlSummary &);
84 void operator()(const DocHtmlDetails &);
85 void operator()(const DocHtmlHeader &);
86 void operator()(const DocImage &);
87 void operator()(const DocDotFile &);
88 void operator()(const DocMscFile &);
89 void operator()(const DocDiaFile &);
90 void operator()(const DocPlantUmlFile &);
91 void operator()(const DocLink &);
92 void operator()(const DocRef &ref);
93 void operator()(const DocSecRefItem &);
94 void operator()(const DocSecRefList &);
95 void operator()(const DocParamSect &);
96 void operator()(const DocParamList &);
97 void operator()(const DocXRefItem &);
98 void operator()(const DocInternalRef &);
99 void operator()(const DocText &);
100 void operator()(const DocHtmlBlockQuote &);
101 void operator()(const DocVhdlFlow &);
102 void operator()(const DocParBlock &);
103
104 private:
105 template<class T>
106 void visitChildren(const T &t)
107 {
108 for (const auto &child : t.children())
109 {
110 std::visit(*this, child);
111 }
112 }
113
114 //--------------------------------------
115 // helper functions
116 //--------------------------------------
117
118 void filter(const QCString &str,bool verbatim=FALSE);
119 void startLink(const QCString &ref,const QCString &file,
120 const QCString &anchor);
121 void endLink(const QCString &ref);
122 QCString getStyle(const QCString &name);
123 QCString getListTable(const int id);
124
125 int indentLevel() const;
126 void incIndentLevel();
127 void decIndentLevel();
128
129 void includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
130 void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage = FALSE);
131 void writeDotFile(const QCString &fileName, bool hasCaption,const QCString &srcFile,int srcLine);
132 void writeDotFile(const DocDotFile &);
133 void writeMscFile(const QCString &fileName, bool hasCaption,const QCString &srcFile,int srcLine);
134 void writeMscFile(const DocMscFile &);
135 void writeDiaFile(const DocDiaFile &);
136 void writePlantUMLFile(const QCString &fileName, bool hasCaption);
137
138 //--------------------------------------
139 // state variables
140 //--------------------------------------
141
144 bool m_insidePre = false;
145 bool m_hide = false;
146 bool m_lastIsPara = false;
148
149 static const int maxIndentLevels = 13;
153 {
154 bool isEnum = false;
155 bool isCheck = false;
156 int number = 1;
157 char type = '1';
158 };
160};
161
162#endif
Node representing an anchor.
Definition docnode.h:228
Node representing an auto List.
Definition docnode.h:566
Node representing an item of a auto list.
Definition docnode.h:590
Node representing a citation of some bibliographic reference.
Definition docnode.h:244
Node representing a dia file.
Definition docnode.h:725
Node representing a dot file.
Definition docnode.h:707
Node representing an emoji.
Definition docnode.h:336
Node representing an item of a cross-referenced list.
Definition docnode.h:524
Node representing a Hypertext reference.
Definition docnode.h:817
Node representing a horizontal ruler.
Definition docnode.h:215
Node representing an HTML blockquote.
Definition docnode.h:1285
Node representing a HTML table caption.
Definition docnode.h:1222
Node representing a HTML table cell.
Definition docnode.h:1187
Node representing a HTML description data.
Definition docnode.h:1175
Node representing a Html description list.
Definition docnode.h:895
Node representing a Html description item.
Definition docnode.h:882
Node Html details.
Definition docnode.h:851
Node Html heading.
Definition docnode.h:867
Node representing a Html list.
Definition docnode.h:994
Node representing a HTML list item.
Definition docnode.h:1159
Node representing a HTML table row.
Definition docnode.h:1240
Node Html summary.
Definition docnode.h:838
Node representing a HTML table.
Definition docnode.h:1263
Node representing an image.
Definition docnode.h:636
Node representing a include/dontinclude operator block.
Definition docnode.h:472
Node representing an included text block from file.
Definition docnode.h:430
Node representing an entry in the index.
Definition docnode.h:547
Node representing an internal section of documentation.
Definition docnode.h:963
Node representing an internal reference to some item.
Definition docnode.h:801
Node representing a line break.
Definition docnode.h:201
Node representing a word that can be linked to something.
Definition docnode.h:164
Node representing a msc file.
Definition docnode.h:716
Node representing an block of paragraphs.
Definition docnode.h:973
Node representing a paragraph in the documentation tree.
Definition docnode.h:1074
Node representing a parameter list.
Definition docnode.h:1119
Node representing a parameter section.
Definition docnode.h:1047
Node representing a uml file.
Definition docnode.h:734
Node representing a reference to some item.
Definition docnode.h:772
Root node of documentation tree.
Definition docnode.h:1307
Node representing a reference to a section.
Definition docnode.h:929
Node representing a list of section references.
Definition docnode.h:953
Node representing a normal section.
Definition docnode.h:908
Node representing a separator.
Definition docnode.h:360
Node representing a simple list.
Definition docnode.h:984
Node representing a simple list item.
Definition docnode.h:1147
Node representing a simple section.
Definition docnode.h:1011
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1038
Node representing a style change.
Definition docnode.h:264
Node representing a special symbol.
Definition docnode.h:323
Root node of a text fragment.
Definition docnode.h:1298
Node representing a simple section title.
Definition docnode.h:603
Node representing a URL (or email address)
Definition docnode.h:187
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:371
Node representing a VHDL flow chart.
Definition docnode.h:743
Node representing some amount of white space.
Definition docnode.h:349
Node representing a word.
Definition docnode.h:152
Node representing an item of a cross-referenced list.
Definition docnode.h:615
Class representing a list of different code generators.
Definition outputlist.h:164
This is an alternative implementation of QCString.
Definition qcstring.h:101
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
void filter(const QCString &str, bool verbatim=FALSE)
int indentLevel() const
void visitChildren(const T &t)
void writeDotFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
void includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
QCString m_langExt
void writeDiaFile(const DocDiaFile &)
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
OutputCodeList & m_ci
RTFDocVisitor(TextStream &t, OutputCodeList &ci, const QCString &langExt, int hierarchyLevel=0)
QCString getStyle(const QCString &name)
void writePlantUMLFile(const QCString &fileName, bool hasCaption)
static const int maxIndentLevels
void writeMscFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
TextStream & m_t
QCString getListTable(const int id)
void endLink(const QCString &ref)
RTFListItemInfo m_listItemInfo[maxIndentLevels]
void operator()(const DocWord &)
Text streaming class that buffers data.
Definition textstream.h:36
#define FALSE
Definition qcstring.h:34