Doxygen
Loading...
Searching...
No Matches
RTFDocVisitor Class Reference

Concrete visitor implementation for RTF output. More...

#include <src/rtfdocvisitor.h>

Inheritance diagram for RTFDocVisitor:
Collaboration diagram for RTFDocVisitor:

Classes

struct  RTFListItemInfo

Public Member Functions

 RTFDocVisitor (TextStream &t, OutputCodeList &ci, const QCString &langExt, int hierarchyLevel=0)
void operator() (const DocWord &)
void operator() (const DocLinkedWord &)
void operator() (const DocWhiteSpace &)
void operator() (const DocSymbol &)
void operator() (const DocEmoji &)
void operator() (const DocURL &)
void operator() (const DocLineBreak &)
void operator() (const DocHorRuler &)
void operator() (const DocStyleChange &)
void operator() (const DocVerbatim &)
void operator() (const DocAnchor &)
void operator() (const DocInclude &)
void operator() (const DocIncOperator &)
void operator() (const DocFormula &)
void operator() (const DocIndexEntry &)
void operator() (const DocSimpleSectSep &)
void operator() (const DocCite &)
void operator() (const DocSeparator &)
void operator() (const DocAutoList &)
void operator() (const DocAutoListItem &)
void operator() (const DocPara &)
void operator() (const DocRoot &)
void operator() (const DocSimpleSect &)
void operator() (const DocTitle &)
void operator() (const DocSimpleList &)
void operator() (const DocSimpleListItem &)
void operator() (const DocSection &s)
void operator() (const DocHtmlList &s)
void operator() (const DocHtmlListItem &)
void operator() (const DocHtmlDescList &)
void operator() (const DocHtmlDescTitle &)
void operator() (const DocHtmlDescData &)
void operator() (const DocHtmlTable &t)
void operator() (const DocHtmlCaption &)
void operator() (const DocHtmlRow &)
void operator() (const DocHtmlCell &)
void operator() (const DocInternal &)
void operator() (const DocHRef &)
void operator() (const DocHtmlSummary &)
void operator() (const DocHtmlDetails &)
void operator() (const DocHtmlHeader &)
void operator() (const DocImage &)
void operator() (const DocDotFile &)
void operator() (const DocMscFile &)
void operator() (const DocDiaFile &)
void operator() (const DocPlantUmlFile &)
void operator() (const DocLink &)
void operator() (const DocRef &ref)
void operator() (const DocSecRefItem &)
void operator() (const DocSecRefList &)
void operator() (const DocParamSect &)
void operator() (const DocParamList &)
void operator() (const DocXRefItem &)
void operator() (const DocInternalRef &)
void operator() (const DocText &)
void operator() (const DocHtmlBlockQuote &)
void operator() (const DocVhdlFlow &)
void operator() (const DocParBlock &)
Public Member Functions inherited from DocVisitor
 DocVisitor ()
virtual ~DocVisitor ()
CodeParserInterfacegetCodeParser (const QCString &langExt)
void pushHidden (bool hide)
bool popHidden ()

Private Member Functions

template<class T>
void visitChildren (const T &t)
void filter (const QCString &str, bool verbatim=FALSE)
void startLink (const QCString &ref, const QCString &file, const QCString &anchor)
void endLink (const QCString &ref)
QCString getStyle (const QCString &name)
QCString getListTable (const int id)
int indentLevel () const
void incIndentLevel ()
void decIndentLevel ()
void includePicturePreRTF (const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
void includePicturePostRTF (bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
void writeDotFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
void writeDotFile (const DocDotFile &)
void writeMscFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
void writeMscFile (const DocMscFile &)
void writeDiaFile (const DocDiaFile &)
void writePlantUMLFile (const QCString &fileName, bool hasCaption)

Private Attributes

TextStreamm_t
OutputCodeListm_ci
bool m_insidePre = false
bool m_hide = false
bool m_lastIsPara = false
QCString m_langExt
int m_indentLevel = 0
int m_hierarchyLevel = 0
RTFListItemInfo m_listItemInfo [maxIndentLevels]

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for RTF output.

Definition at line 31 of file rtfdocvisitor.h.

Constructor & Destructor Documentation

◆ RTFDocVisitor()

RTFDocVisitor::RTFDocVisitor ( TextStream & t,
OutputCodeList & ci,
const QCString & langExt,
int hierarchyLevel = 0 )

Definition at line 70 of file rtfdocvisitor.cpp.

72 : m_t(t), m_ci(ci), m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
73{
74}
QCString m_langExt
OutputCodeList & m_ci
TextStream & m_t

References m_ci, m_hierarchyLevel, m_langExt, and m_t.

Member Function Documentation

◆ decIndentLevel()

void RTFDocVisitor::decIndentLevel ( )
private

◆ endLink()

void RTFDocVisitor::endLink ( const QCString & ref)
private

Definition at line 1726 of file rtfdocvisitor.cpp.

1727{
1728 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1729 {
1730 m_t << "}}}";
1731 }
1732 else
1733 {
1734 m_t << "}";
1735 }
1737}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163
#define Config_getBool(name)
Definition config.h:33
#define FALSE
Definition qcstring.h:34

References Config_getBool, FALSE, QCString::isEmpty(), m_lastIsPara, and m_t.

Referenced by operator()(), operator()(), operator()(), operator()(), and operator()().

◆ filter()

void RTFDocVisitor::filter ( const QCString & str,
bool verbatim = FALSE )
private

Definition at line 1668 of file rtfdocvisitor.cpp.

1669{
1670 if (!str.isEmpty())
1671 {
1672 const char *p=str.data();
1673 while (*p)
1674 {
1675 char c=*p++;
1676 switch (c)
1677 {
1678 case '{': m_t << "\\{"; break;
1679 case '}': m_t << "\\}"; break;
1680 case '\\': m_t << "\\\\"; break;
1681 case '\n': if (verbatim)
1682 {
1683 m_t << "\\par\n";
1684 }
1685 else
1686 {
1687 m_t << '\n';
1688 }
1689 break;
1690 default: m_t << c;
1691 }
1692 }
1693 }
1694}
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition qcstring.h:172

References QCString::data(), QCString::isEmpty(), and m_t.

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ getListTable()

QCString RTFDocVisitor::getListTable ( const int id)
private

Definition at line 83 of file rtfdocvisitor.cpp.

84{
85 for (int i=0 ; rtf_Table_Default[i].definition ; i++ )
86 {
87 if ((id == rtf_Table_Default[i].id) && (m_indentLevel == rtf_Table_Default[i].lvl))
88 {
89 return rtf_Table_Default[i].place;
90 }
91 }
92 ASSERT(0);
93 return "";
94}
#define ASSERT(x)
Definition qcstring.h:39
Rtf_Table_Default rtf_Table_Default[]
Definition rtfstyle.cpp:245
const char * definition
Definition rtfstyle.h:50
const char * place
Definition rtfstyle.h:51

References ASSERT, m_indentLevel, and rtf_Table_Default.

Referenced by operator()().

◆ getStyle()

QCString RTFDocVisitor::getStyle ( const QCString & name)
private

Definition at line 76 of file rtfdocvisitor.cpp.

77{
78 QCString n = name + QCString().setNum(indentLevel());
79 StyleData &sd = rtf_Style[n.str()];
80 return sd.reference();
81}
const std::string & str() const
Definition qcstring.h:552
QCString & setNum(short n)
Definition qcstring.h:459
int indentLevel() const
StyleDataMap rtf_Style
Definition rtfstyle.cpp:362
QCString reference() const
Definition rtfstyle.h:69

References indentLevel(), StyleData::reference(), rtf_Style, QCString::setNum(), and QCString::str().

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ incIndentLevel()

void RTFDocVisitor::incIndentLevel ( )
private

Definition at line 101 of file rtfdocvisitor.cpp.

102{
105 {
106 err("Maximum indent level ({}) exceeded while generating RTF output!\n",maxIndentLevels-1);
107 }
108}
static const int maxIndentLevels
#define err(fmt,...)
Definition message.h:127

References err, m_indentLevel, and maxIndentLevels.

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ includePicturePostRTF()

void RTFDocVisitor::includePicturePostRTF ( bool isTypeRTF,
bool hasCaption,
bool inlineImage = FALSE )
private

Definition at line 1246 of file rtfdocvisitor.cpp.

1247{
1248 if (isTypeRTF)
1249 {
1250 if (m_hide) return;
1251 if (inlineImage)
1252 {
1253 if (hasCaption) m_t << " }";
1254 }
1255 else
1256 {
1257 if (hasCaption)
1258 {
1259 m_t << "}\n";
1260 m_t << "\\par}\n";
1261 }
1262 else
1263 {
1264 m_t << "}\n";
1265 }
1266 }
1267 }
1268 else
1269 {
1270 m_hide = popHidden();
1271 }
1272}
bool popHidden()

References m_hide, m_t, and DocVisitor::popHidden().

Referenced by operator()(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ includePicturePreRTF()

void RTFDocVisitor::includePicturePreRTF ( const QCString & name,
bool isTypeRTF,
bool hasCaption,
bool inlineImage = FALSE )
private

Definition at line 1209 of file rtfdocvisitor.cpp.

1210{
1211 if (isTypeRTF)
1212 {
1213 if (!inlineImage)
1214 {
1215 m_t << "\\par\n";
1216 m_t << "{\n";
1217 m_t << rtf_Style_Reset << "\n";
1218 if (hasCaption || m_lastIsPara) m_t << "\\par\n";
1219 m_t << "\\pard \\qc ";
1220 }
1221 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1222 m_t << name;
1223 m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
1224 if (!inlineImage)
1225 {
1226 m_t << "\\par\n";
1227 if (hasCaption)
1228 {
1229 m_t << "\\pard \\qc \\b";
1230 m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1231 }
1233 }
1234 else
1235 {
1236 if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown
1237 }
1238 }
1239 else // other format -> skip
1240 {
1242 m_hide=TRUE;
1243 }
1244}
void pushHidden(bool hide)
#define TRUE
Definition qcstring.h:37
char rtf_Style_Reset[]
Definition rtfstyle.cpp:49

References m_hide, m_lastIsPara, m_t, DocVisitor::pushHidden(), rtf_Style_Reset, and TRUE.

Referenced by operator()(), writeDiaFile(), writeDotFile(), writeMscFile(), and writePlantUMLFile().

◆ indentLevel()

int RTFDocVisitor::indentLevel ( ) const
private

Definition at line 96 of file rtfdocvisitor.cpp.

97{
98 return std::min(m_indentLevel,maxIndentLevels-1);
99}

References m_indentLevel, and maxIndentLevels.

Referenced by getStyle(), operator()(), operator()(), operator()(), operator()(), and operator()().

◆ operator()() [1/58]

void RTFDocVisitor::operator() ( const DocAnchor & anc)

Definition at line 445 of file rtfdocvisitor.cpp.

446{
447 if (m_hide) return;
448 DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
449 QCString anchor;
450 if (!anc.file().isEmpty())
451 {
452 anchor+=stripPath(anc.file());
453 }
454 if (!anc.file().isEmpty() && !anc.anchor().isEmpty())
455 {
456 anchor+="_";
457 }
458 if (!anc.anchor().isEmpty())
459 {
460 anchor+=anc.anchor();
461 }
462 m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
463 m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
465}
QCString anchor() const
Definition docnode.h:232
QCString file() const
Definition docnode.h:233
#define DBG_RTF(x)
QCString rtfFormatBmkStr(const QCString &name)
Definition rtfgen.cpp:2873
QCString stripPath(const QCString &s)
Definition util.cpp:4890

References DocAnchor::anchor(), DBG_RTF, FALSE, DocAnchor::file(), QCString::isEmpty(), m_hide, m_lastIsPara, m_t, rtfFormatBmkStr(), and stripPath().

◆ operator()() [2/58]

void RTFDocVisitor::operator() ( const DocAutoList & l)

Definition at line 668 of file rtfdocvisitor.cpp.

669{
670 if (m_hide) return;
671 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoList &)}\n");
672 m_t << "{\n";
673 int level = indentLevel();
674 m_listItemInfo[level].isEnum = l.isEnumList();
675 m_listItemInfo[level].isCheck = l.isCheckedList();
676 m_listItemInfo[level].type = '1';
677 m_listItemInfo[level].number = 1;
679 visitChildren(l);
680 if (!m_lastIsPara) m_t << "\\par";
681 m_t << "}\n";
683 if (!l.isCheckedList() && indentLevel()==0) m_t << "\\par\n";
684}
bool isCheckedList() const
Definition docnode.h:582
bool isEnumList() const
Definition docnode.h:580
void visitChildren(const T &t)
RTFListItemInfo m_listItemInfo[maxIndentLevels]

References DBG_RTF, FALSE, indentLevel(), DocAutoList::isCheckedList(), DocAutoList::isEnumList(), m_hide, m_lastIsPara, m_listItemInfo, m_t, TRUE, and visitChildren().

◆ operator()() [3/58]

void RTFDocVisitor::operator() ( const DocAutoListItem & li)

Definition at line 686 of file rtfdocvisitor.cpp.

687{
688 static int prevLevel = -1;
689 if (m_hide) return;
690 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoListItem &)}\n");
691 int level = indentLevel();
692 if ((level != prevLevel-1) &&
693 (!(level==prevLevel && level != 0 && m_listItemInfo[level].isCheck)) &&
694 (!m_lastIsPara))
695 m_t << "\\par\n";
696 prevLevel= level;
698 if (m_listItemInfo[level].isEnum)
699 {
700 m_t << getStyle("ListEnum") << "\n";
701 m_t << m_listItemInfo[level].number << ".\\tab ";
702 m_listItemInfo[level].number++;
703 }
704 else
705 {
706 switch (li.itemNumber())
707 {
708 case DocAutoList::Unchecked: // unchecked
709 m_t << getListTable(2) << "\n";
710 break;
711 case DocAutoList::Checked_x: // checked with x
712 case DocAutoList::Checked_X: // checked with X
713 m_t << getListTable(3) << "\n";
714 break;
715 default:
716 m_t << getListTable(1) << "\n";
717 break;
718 }
719 }
721 m_lastIsPara=false;
722 visitChildren(li);
724}
int itemNumber() const
Definition docnode.h:598
QCString getStyle(const QCString &name)
QCString getListTable(const int id)

References DocAutoList::Checked_X, DocAutoList::Checked_x, DBG_RTF, decIndentLevel(), getListTable(), getStyle(), incIndentLevel(), indentLevel(), DocAutoListItem::itemNumber(), m_hide, m_lastIsPara, m_listItemInfo, m_t, rtf_Style_Reset, DocAutoList::Unchecked, and visitChildren().

◆ operator()() [4/58]

void RTFDocVisitor::operator() ( const DocCite & cite)

Definition at line 640 of file rtfdocvisitor.cpp.

641{
642 if (m_hide) return;
643 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
644 auto opt = cite.option();
645 if (!cite.file().isEmpty())
646 {
647 if (!opt.noCite()) startLink(cite.ref(),cite.file(),cite.anchor());
648
649 filter(cite.getText());
650
651 if (!opt.noCite()) endLink(cite.ref());
652 }
653 else
654 {
655 m_t << "{\\b";
656 if (!opt.noPar()) filter("[");
657 filter(cite.target());
658 if (!opt.noPar()) filter("]");
659 m_t << "}";
660 }
661}
QCString getText() const
Definition docnode.cpp:959
CiteInfoOption option() const
Definition docnode.h:253
QCString target() const
Definition docnode.h:252
QCString anchor() const
Definition docnode.h:251
QCString ref() const
Definition docnode.h:250
QCString file() const
Definition docnode.h:248
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
void filter(const QCString &str, bool verbatim=FALSE)
void endLink(const QCString &ref)

References DocCite::anchor(), DBG_RTF, endLink(), DocCite::file(), filter(), DocCite::getText(), QCString::isEmpty(), m_hide, m_t, DocCite::option(), DocCite::ref(), startLink(), and DocCite::target().

◆ operator()() [5/58]

void RTFDocVisitor::operator() ( const DocDiaFile & df)

Definition at line 1300 of file rtfdocvisitor.cpp.

1301{
1302 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDiaFile &)}\n");
1303 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1304 writeDiaFile(df);
1305 visitChildren(df);
1307}
QCString file() const
Definition docnode.h:685
bool hasCaption() const
Definition docnode.h:687
void writeDiaFile(const DocDiaFile &)
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
#define Config_getString(name)
Definition config.h:32
bool copyFile(const QCString &src, const QCString &dest)
Copies the contents of file with name src to the newly created file with name dest.
Definition util.cpp:5809

References Config_getBool, Config_getString, copyFile(), DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), stripPath(), visitChildren(), and writeDiaFile().

◆ operator()() [6/58]

void RTFDocVisitor::operator() ( const DocDotFile & df)

Definition at line 1283 of file rtfdocvisitor.cpp.

1284{
1285 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDotFile &)}\n");
1286 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1287 writeDotFile(df);
1288 visitChildren(df);
1290}
void writeDotFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)

References Config_getBool, Config_getString, copyFile(), DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), stripPath(), visitChildren(), and writeDotFile().

◆ operator()() [7/58]

void RTFDocVisitor::operator() ( const DocEmoji & s)

Definition at line 168 of file rtfdocvisitor.cpp.

169{
170 if (m_hide) return;
171 DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n");
172 const char *res = EmojiEntityMapper::instance().unicode(s.index());
173 if (res)
174 {
175 const char *p = res;
176 int val = 0;
177 int val1 = 0;
178 while (*p)
179 {
180 switch(*p)
181 {
182 case '&': case '#': case 'x':
183 break;
184 case ';':
185 val1 = val;
186 val = 0xd800 + ( ( val1 - 0x10000 ) & 0xffc00 ) / 0x400 - 0x10000;
187 m_t << "\\u" << val << "?";
188 val = 0xdC00 + ( ( val1 - 0x10000 ) & 0x3ff ) - 0x10000 ;
189 m_t << "\\u" << val << "?";
190 val = 0;
191 break;
192 case '0': case '1': case '2': case '3': case '4':
193 case '5': case '6': case '7': case '8': case '9':
194 val = val * 16 + *p - '0';
195 break;
196 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
197 val = val * 16 + *p - 'a' + 10;
198 break;
199 }
200 p++;
201 }
202 }
203 else
204 {
205 m_t << s.name();
206 }
208}
int index() const
Definition docnode.h:345
QCString name() const
Definition docnode.h:344
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity.
Definition emoji.cpp:2016
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1978

References DBG_RTF, FALSE, DocEmoji::index(), EmojiEntityMapper::instance(), m_hide, m_lastIsPara, m_t, DocEmoji::name(), and EmojiEntityMapper::unicode().

◆ operator()() [8/58]

void RTFDocVisitor::operator() ( const DocFormula & f)

Definition at line 607 of file rtfdocvisitor.cpp.

608{
609 if (m_hide) return;
610 DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
611 bool bDisplay = !f.isInline();
612 if (bDisplay)
613 {
614 m_t << "\\par";
615 m_t << "{";
616 m_t << "\\pard\\plain";
617 m_t << "\\pard";
618 m_t << "\\qc";
619 }
620 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f.relPath() << f.name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
621 if (bDisplay)
622 {
623 m_t << "\\par}";
624 }
626}
QCString name() const
Definition docnode.h:532
bool isInline() const
Definition docnode.h:536
QCString relPath() const
Definition docnode.h:534

References DBG_RTF, FALSE, DocFormula::isInline(), m_hide, m_lastIsPara, m_t, DocFormula::name(), and DocFormula::relPath().

◆ operator()() [9/58]

void RTFDocVisitor::operator() ( const DocHorRuler & )

Definition at line 248 of file rtfdocvisitor.cpp.

249{
250 if (m_hide) return;
251 DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
252 m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
254}

References DBG_RTF, m_hide, m_lastIsPara, m_t, and TRUE.

◆ operator()() [10/58]

void RTFDocVisitor::operator() ( const DocHRef & href)

Definition at line 1108 of file rtfdocvisitor.cpp.

1109{
1110 if (m_hide) return;
1111 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHRef &)}\n");
1112 if (Config_getBool(RTF_HYPERLINKS))
1113 {
1114 if (href.url().startsWith("#"))
1115 {
1116 // when starting with # so a local link
1117 QCString cite;
1118 cite = href.file() + "_" + href.url().right(href.url().length()-1);
1119 m_t << "{\\field "
1120 "{\\*\\fldinst "
1121 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
1122 "}{}"
1123 "}"
1124 "{\\fldrslt "
1125 "{\\cs37\\ul\\cf2 ";
1126 }
1127 else
1128 {
1129 m_t << "{\\field "
1130 "{\\*\\fldinst "
1131 "{ HYPERLINK \"" << href.url() << "\" "
1132 "}{}"
1133 "}"
1134 "{\\fldrslt "
1135 "{\\cs37\\ul\\cf2 ";
1136 }
1137 }
1138 else
1139 {
1140 m_t << "{\\f2 ";
1141 }
1143 visitChildren(href);
1144 if (Config_getBool(RTF_HYPERLINKS))
1145 {
1146 m_t << "}"
1147 "}"
1148 "}";
1149 }
1150 else
1151 {
1152 m_t << "}";
1153 }
1155}
QCString url() const
Definition docnode.h:830
QCString file() const
Definition docnode.h:831
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition qcstring.h:166
bool startsWith(const char *s) const
Definition qcstring.h:507
QCString right(size_t len) const
Definition qcstring.h:234

References Config_getBool, DBG_RTF, FALSE, DocHRef::file(), QCString::length(), m_hide, m_lastIsPara, m_t, QCString::right(), rtfFormatBmkStr(), QCString::startsWith(), DocHRef::url(), and visitChildren().

◆ operator()() [11/58]

void RTFDocVisitor::operator() ( const DocHtmlBlockQuote & q)

Definition at line 1635 of file rtfdocvisitor.cpp.

1636{
1637 if (m_hide) return;
1638 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1639 if (!m_lastIsPara) m_t << "\\par\n";
1640 m_t << "{"; // start desc
1642 m_t << rtf_Style_Reset << getStyle("DescContinue");
1643 visitChildren(q);
1644 if (!m_lastIsPara) m_t << "\\par\n";
1646 m_t << "}"; // end desc
1648}

References DBG_RTF, decIndentLevel(), getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE, and visitChildren().

◆ operator()() [12/58]

void RTFDocVisitor::operator() ( const DocHtmlCaption & c)

Definition at line 1050 of file rtfdocvisitor.cpp.

1051{
1052 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCaption &)}\n");
1053 visitChildren(c);
1054 m_t << "}\n\\par\n";
1055}

References DBG_RTF, m_t, and visitChildren().

◆ operator()() [13/58]

void RTFDocVisitor::operator() ( const DocHtmlCell & c)

Definition at line 1091 of file rtfdocvisitor.cpp.

1092{
1093 if (m_hide) return;
1094 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCell &)}\n");
1095 m_t << "{" << align(c);
1097 visitChildren(c);
1098 m_t << "\\cell }";
1100}
static QCString align(const DocHtmlCell &cell)

References align(), DBG_RTF, FALSE, m_hide, m_lastIsPara, m_t, and visitChildren().

◆ operator()() [14/58]

void RTFDocVisitor::operator() ( const DocHtmlDescData & dd)

Definition at line 1013 of file rtfdocvisitor.cpp.

1014{
1015 if (m_hide) return;
1016 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescData &)}\n");
1018 m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
1019 visitChildren(dd);
1020 m_t << "\\par";
1021 m_t << "}\n";
1024}

References DBG_RTF, decIndentLevel(), getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE, and visitChildren().

◆ operator()() [15/58]

void RTFDocVisitor::operator() ( const DocHtmlDescList & dl)

Definition at line 986 of file rtfdocvisitor.cpp.

987{
988 if (m_hide) return;
989 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescList &)}\n");
990 //m_t << "{\n";
991 //m_t << rtf_Style_Reset << getStyle("ListContinue");
992 //m_lastIsPara=FALSE;
993 visitChildren(dl);
994 //m_t << "}\n";
995 //m_t << "\\par\n";
996 //m_lastIsPara=TRUE;
997}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [16/58]

void RTFDocVisitor::operator() ( const DocHtmlDescTitle & dt)

Definition at line 999 of file rtfdocvisitor.cpp.

1000{
1001 if (m_hide) return;
1002 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescTitle &)}\n");
1003 //m_t << "\\par\n";
1004 //m_t << "{\\b ";
1005 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1007 visitChildren(dt);
1008 m_t << "\\par\n";
1009 m_t << "}\n";
1011}

References DBG_RTF, FALSE, m_hide, m_lastIsPara, m_t, rtf_Style, TRUE, and visitChildren().

◆ operator()() [17/58]

void RTFDocVisitor::operator() ( const DocHtmlDetails & d)

Definition at line 1165 of file rtfdocvisitor.cpp.

1166{
1167 if (m_hide) return;
1168 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDetails &)}\n");
1169 if (!m_lastIsPara) m_t << "\\par\n";
1170 auto summary = d.summary();
1171 if (summary)
1172 {
1173 std::visit(*this,*summary);
1174 m_t << "{"; // start desc
1176 m_t << rtf_Style_Reset << getStyle("DescContinue");
1177 }
1178 visitChildren(d);
1179 if (!m_lastIsPara) m_t << "\\par\n";
1180 if (summary)
1181 {
1183 m_t << "}"; // end desc
1184 }
1186}
const DocNodeVariant * summary() const
Definition docnode.h:864

References DBG_RTF, decIndentLevel(), getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, rtf_Style_Reset, DocHtmlDetails::summary(), TRUE, and visitChildren().

◆ operator()() [18/58]

void RTFDocVisitor::operator() ( const DocHtmlHeader & header)

Definition at line 1188 of file rtfdocvisitor.cpp.

1189{
1190 if (m_hide) return;
1191 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlHeader &)}\n");
1192 m_t << "{" // start section
1193 << rtf_Style_Reset;
1194 QCString heading;
1195 int level = std::clamp(header.level()+m_hierarchyLevel,SectionType::MinLevel,SectionType::MaxLevel);
1196 heading.sprintf("Heading%d",level);
1197 // set style
1198 m_t << rtf_Style[heading.str()].reference();
1199 // make open table of contents entry that will be closed in visitPost method
1200 m_t << "{\\tc\\tcl" << level << " ";
1202 visitChildren(header);
1203 // close open table of contents entry
1204 m_t << "} \\par";
1205 m_t << "}\n"; // end section
1207}
int level() const
Definition docnode.h:877
QCString & sprintf(const char *format,...)
Definition qcstring.cpp:29
static constexpr int MaxLevel
Definition section.h:39
static constexpr int MinLevel
Definition section.h:32

References DBG_RTF, FALSE, DocHtmlHeader::level(), m_hide, m_hierarchyLevel, m_lastIsPara, m_t, SectionType::MaxLevel, SectionType::MinLevel, rtf_Style, rtf_Style_Reset, QCString::sprintf(), QCString::str(), TRUE, and visitChildren().

◆ operator()() [19/58]

void RTFDocVisitor::operator() ( const DocHtmlList & s)

Definition at line 903 of file rtfdocvisitor.cpp.

904{
905 if (m_hide) return;
906 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlList &)}\n");
907 m_t << "{\n";
908 int level = indentLevel();
909 m_listItemInfo[level].isEnum = l.type()==DocHtmlList::Ordered;
910 m_listItemInfo[level].isCheck = false;
911 m_listItemInfo[level].number = 1;
912 m_listItemInfo[level].type = '1';
913 for (const auto &opt : l.attribs())
914 {
915 if (opt.name=="type")
916 {
917 m_listItemInfo[level].type = opt.value[0];
918 }
919 if (opt.name=="start")
920 {
921 bool ok = false;
922 int val = opt.value.toInt(&ok);
923 if (ok) m_listItemInfo[level].number = val;
924 }
925 }
927 visitChildren(l);
928 m_t << "\\par" << "}\n";
930}

References DocHtmlList::attribs(), DBG_RTF, FALSE, indentLevel(), m_hide, m_lastIsPara, m_listItemInfo, m_t, DocHtmlList::Ordered, TRUE, DocHtmlList::type(), and visitChildren().

◆ operator()() [20/58]

void RTFDocVisitor::operator() ( const DocHtmlListItem & l)

Definition at line 932 of file rtfdocvisitor.cpp.

933{
934 if (m_hide) return;
935 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlListItem &)}\n");
936 m_t << "\\par\n";
938 int level = indentLevel();
939 if (m_listItemInfo[level].isEnum)
940 {
941 for (const auto &opt : l.attribs())
942 {
943 if (opt.name=="value")
944 {
945 bool ok = false;
946 int val = opt.value.toInt(&ok);
947 if (ok) m_listItemInfo[level].number = val;
948 }
949 }
950 m_t << getStyle("ListEnum") << "\n";
951 switch (m_listItemInfo[level].type)
952 {
953 case '1':
954 m_t << m_listItemInfo[level].number;
955 break;
956 case 'a':
957 m_t << integerToAlpha(m_listItemInfo[level].number,false);
958 break;
959 case 'A':
960 m_t << integerToAlpha(m_listItemInfo[level].number);
961 break;
962 case 'i':
963 m_t << integerToRoman(m_listItemInfo[level].number,false);
964 break;
965 case 'I':
966 m_t << integerToRoman(m_listItemInfo[level].number);
967 break;
968 default:
969 m_t << m_listItemInfo[level].number;
970 break;
971 }
972 m_t << ".\\tab ";
973 m_listItemInfo[level].number++;
974 }
975 else
976 {
977 m_t << getStyle("ListBullet") << "\n";
978 }
981 visitChildren(l);
983 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
984}
const HtmlAttribList & attribs() const
Definition docnode.h:1170
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6648
QCString integerToAlpha(int n, bool upper)
Definition util.cpp:6632

References DocHtmlListItem::attribs(), DBG_RTF, decIndentLevel(), FALSE, getStyle(), incIndentLevel(), indentLevel(), integerToAlpha(), integerToRoman(), m_hide, m_lastIsPara, m_listItemInfo, m_t, rtf_Style_Reset, and visitChildren().

◆ operator()() [21/58]

void RTFDocVisitor::operator() ( const DocHtmlRow & r)

Definition at line 1057 of file rtfdocvisitor.cpp.

1058{
1059 if (m_hide) return;
1060 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlRow &)}\n");
1061 size_t columnWidth=r.numCells()>0 ? rtf_pageWidth/r.numCells() : 10;
1062 m_t << "\\trowd \\trgaph108\\trleft-108"
1063 "\\trbrdrt\\brdrs\\brdrw10 "
1064 "\\trbrdrl\\brdrs\\brdrw10 "
1065 "\\trbrdrb\\brdrs\\brdrw10 "
1066 "\\trbrdrr\\brdrs\\brdrw10 "
1067 "\\trbrdrh\\brdrs\\brdrw10 "
1068 "\\trbrdrv\\brdrs\\brdrw10 \n";
1069 for (size_t i=0;i<r.numCells();i++)
1070 {
1071 if (r.isHeading())
1072 {
1073 m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
1074 }
1075 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
1076 "\\clbrdrl\\brdrs\\brdrw10 "
1077 "\\clbrdrb\\brdrs\\brdrw10 "
1078 "\\clbrdrr \\brdrs\\brdrw10 "
1079 "\\cltxlrtb "
1080 "\\cellx" << ((i+1)*columnWidth) << "\n";
1081 }
1082 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1084 visitChildren(r);
1085 m_t << "\n";
1086 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1087 m_t << "{\\row }\n";
1089}
bool isHeading() const
Definition docnode.cpp:1941
size_t numCells() const
Definition docnode.h:1251
const int rtf_pageWidth
Definition rtfstyle.h:26

References DBG_RTF, FALSE, DocHtmlRow::isHeading(), m_hide, m_lastIsPara, m_t, DocHtmlRow::numCells(), rtf_pageWidth, and visitChildren().

◆ operator()() [22/58]

void RTFDocVisitor::operator() ( const DocHtmlSummary & s)

Definition at line 1157 of file rtfdocvisitor.cpp.

1158{
1159 if (m_hide) return;
1160 m_t << "{\\b ";
1161 visitChildren(s);
1162 m_t << "}\\par ";
1163}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

void RTFDocVisitor::operator() ( const DocHtmlTable & t)

Definition at line 1026 of file rtfdocvisitor.cpp.

1027{
1028 if (m_hide) return;
1029 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlTable &)}\n");
1030 if (!m_lastIsPara) m_t << "\\par\n";
1032 if (t.caption())
1033 {
1034 const DocHtmlCaption &c = std::get<DocHtmlCaption>(*t.caption());
1035 m_t << "\\pard \\qc \\b";
1036 if (!c.file().isEmpty())
1037 {
1038 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1039 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1040 }
1041 m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1042 std::visit(*this,*t.caption());
1043 }
1044 visitChildren(t);
1045 m_t << "\\pard\\plain\n";
1046 m_t << "\\par\n";
1048}
QCString anchor() const
Definition docnode.h:1235
QCString file() const
Definition docnode.h:1234
const DocNodeVariant * caption() const
Definition docnode.cpp:2189

References DocHtmlCaption::anchor(), DocHtmlTable::caption(), DBG_RTF, DocHtmlCaption::file(), QCString::isEmpty(), m_hide, m_lastIsPara, m_t, rtfFormatBmkStr(), stripPath(), TRUE, and visitChildren().

◆ operator()() [24/58]

void RTFDocVisitor::operator() ( const DocImage & img)

Definition at line 1274 of file rtfdocvisitor.cpp.

1275{
1276 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocImage &)}\n");
1278 visitChildren(img);
1280}
QCString name() const
Definition docnode.h:648
Type type() const
Definition docnode.h:647
bool isInlineImage() const
Definition docnode.h:654
bool hasCaption() const
Definition docnode.h:649
void includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)

References DBG_RTF, DocImage::hasCaption(), includePicturePostRTF(), includePicturePreRTF(), DocImage::isInlineImage(), DocImage::name(), DocImage::Rtf, DocImage::type(), and visitChildren().

◆ operator()() [25/58]

void RTFDocVisitor::operator() ( const DocInclude & inc)

Definition at line 467 of file rtfdocvisitor.cpp.

468{
469 if (m_hide) return;
471 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
472 switch(inc.type())
473 {
475 {
476 m_t << "{\n";
477 m_t << "\\par\n";
478 m_t << rtf_Style_Reset << getStyle("CodeExample");
479 FileInfo cfi( inc.file().str() );
480 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
482 inc.text(),
483 langExt,
484 inc.stripCodeComments(),
485 CodeParserOptions()
486 .setExample(inc.isExample(),inc.exampleFile())
487 .setFileDef(fd.get())
488 .setInlineFragment(true)
489 );
490 m_t << "\\par";
491 m_t << "}\n";
492 }
493 break;
495 m_t << "{\n";
496 m_t << "\\par\n";
497 m_t << rtf_Style_Reset << getStyle("CodeExample");
499 inc.text(),langExt,
500 inc.stripCodeComments(),
501 CodeParserOptions()
502 .setExample(inc.isExample(),inc.exampleFile())
503 .setInlineFragment(true)
504 .setShowLineNumbers(false)
505 );
506 m_t << "\\par";
507 m_t << "}\n";
508 break;
516 break;
518 m_t << inc.text();
519 break;
521 m_t << "{\n";
522 m_t << "\\par\n";
523 m_t << rtf_Style_Reset << getStyle("CodeExample");
524 filter(inc.text());
525 m_t << "\\par";
526 m_t << "}\n";
527 break;
530 m_t << "{\n";
531 if (!m_lastIsPara) m_t << "\\par\n";
532 m_t << rtf_Style_Reset << getStyle("CodeExample");
534 inc.file(),
535 inc.blockId(),
536 inc.context(),
538 inc.trimLeft(),
540 );
541 m_t << "}";
542 break;
543 }
545}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
QCString blockId() const
Definition docnode.h:454
QCString extension() const
Definition docnode.h:450
bool stripCodeComments() const
Definition docnode.h:455
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
Type type() const
Definition docnode.h:451
QCString exampleFile() const
Definition docnode.h:457
QCString text() const
Definition docnode.h:452
QCString file() const
Definition docnode.h:449
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
QCString context() const
Definition docnode.h:453
CodeParserInterface & getCodeParser(const QCString &langExt)
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:268
SrcLangExt
Definition types.h:207
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5147

References DocInclude::blockId(), DocInclude::context(), createFileDef(), DBG_RTF, FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), DocInclude::file(), FileInfo::fileName(), filter(), DocVisitor::getCodeParser(), getLanguageFromFileName(), getStyle(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance(), DocInclude::isExample(), DocInclude::LatexInclude, m_ci, m_hide, m_lastIsPara, m_t, DocInclude::ManInclude, CodeParserInterface::parseCode(), CodeFragmentManager::parseCodeFragment(), rtf_Style_Reset, DocInclude::RtfInclude, CodeParserOptions::setFileDef(), CodeParserOptions::setInlineFragment(), CodeParserOptions::setShowLineNumbers(), DocInclude::Snippet, DocInclude::SnippetWithLines, QCString::str(), DocInclude::stripCodeComments(), DocInclude::text(), DocInclude::trimLeft(), TRUE, DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/58]

void RTFDocVisitor::operator() ( const DocIncOperator & op)

Definition at line 547 of file rtfdocvisitor.cpp.

548{
549 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
550 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
551 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
552 QCString locLangExt = getFileNameExtension(op.includeFileName());
553 if (locLangExt.isEmpty()) locLangExt = m_langExt;
554 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
555 if (op.isFirst())
556 {
557 if (!m_hide)
558 {
559 m_t << "{\n";
560 m_t << "\\par\n";
561 m_t << rtf_Style_Reset << getStyle("CodeExample");
562 }
564 m_hide = TRUE;
565 }
566 if (op.type()!=DocIncOperator::Skip)
567 {
568 m_hide = popHidden();
569 if (!m_hide)
570 {
571 std::unique_ptr<FileDef> fd = nullptr;
572 if (!op.includeFileName().isEmpty())
573 {
574 FileInfo cfi( op.includeFileName().str() );
575 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
576 }
577
578 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
580 CodeParserOptions()
581 .setExample(op.isExample(),op.exampleFile())
582 .setFileDef(fd.get())
583 .setStartLine(op.line())
584 .setShowLineNumbers(op.showLineNo())
585 );
586 }
588 m_hide=TRUE;
589 }
590 if (op.isLast())
591 {
592 m_hide = popHidden();
593 if (!m_hide)
594 {
595 m_t << "\\par";
596 m_t << "}\n";
597 }
599 }
600 else
601 {
602 if (!m_hide) m_t << "\n";
604 }
605}
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
QCString includeFileName() const
Definition docnode.h:509
QCString text() const
Definition docnode.h:499
QCString context() const
Definition docnode.h:501
QCString exampleFile() const
Definition docnode.h:508
int line() const
Definition docnode.h:497
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5189

References DocIncOperator::context(), createFileDef(), DBG_RTF, FileInfo::dirPath(), DocIncOperator::exampleFile(), FALSE, FileInfo::fileName(), DocVisitor::getCodeParser(), getFileNameExtension(), getLanguageFromFileName(), getStyle(), DocIncOperator::includeFileName(), QCString::isEmpty(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), DocIncOperator::line(), m_ci, m_hide, m_langExt, m_lastIsPara, m_t, CodeParserInterface::parseCode(), DocVisitor::popHidden(), DocVisitor::pushHidden(), rtf_Style_Reset, CodeParserOptions::setFileDef(), CodeParserOptions::setShowLineNumbers(), CodeParserOptions::setStartLine(), DocIncOperator::showLineNo(), DocIncOperator::Skip, QCString::str(), DocIncOperator::stripCodeComments(), DocIncOperator::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/58]

void RTFDocVisitor::operator() ( const DocIndexEntry & i)

Definition at line 628 of file rtfdocvisitor.cpp.

629{
630 if (m_hide) return;
631 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
632 m_t << "{\\xe \\v " << i.entry() << "}\n";
634}
QCString entry() const
Definition docnode.h:559

References DBG_RTF, DocIndexEntry::entry(), FALSE, m_hide, m_lastIsPara, and m_t.

◆ operator()() [28/58]

void RTFDocVisitor::operator() ( const DocInternal & i)

Definition at line 1102 of file rtfdocvisitor.cpp.

1103{
1104 if (m_hide) return;
1105 visitChildren(i);
1106}

References m_hide, and visitChildren().

◆ operator()() [29/58]

void RTFDocVisitor::operator() ( const DocInternalRef & ref)

Definition at line 1618 of file rtfdocvisitor.cpp.

1619{
1620 if (m_hide) return;
1621 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1622 startLink("",ref.file(),ref.anchor());
1623 visitChildren(ref);
1624 endLink("");
1625 m_t << " ";
1626}
QCString file() const
Definition docnode.h:811
QCString anchor() const
Definition docnode.h:813

References DocInternalRef::anchor(), DBG_RTF, endLink(), DocInternalRef::file(), m_hide, m_t, startLink(), and visitChildren().

◆ operator()() [30/58]

void RTFDocVisitor::operator() ( const DocLineBreak & )

Definition at line 240 of file rtfdocvisitor.cpp.

241{
242 if (m_hide) return;
243 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
244 m_t << "\\par\n";
246}

References DBG_RTF, m_hide, m_lastIsPara, m_t, and TRUE.

◆ operator()() [31/58]

void RTFDocVisitor::operator() ( const DocLink & lnk)

Definition at line 1327 of file rtfdocvisitor.cpp.

1328{
1329 if (m_hide) return;
1330 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocLink &)}\n");
1331 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1332 visitChildren(lnk);
1333 endLink(lnk.ref());
1334}

References DocLink::anchor(), DBG_RTF, endLink(), DocLink::file(), m_hide, DocLink::ref(), startLink(), and visitChildren().

◆ operator()() [32/58]

void RTFDocVisitor::operator() ( const DocLinkedWord & w)

Definition at line 127 of file rtfdocvisitor.cpp.

128{
129 if (m_hide) return;
130 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
131 startLink(w.ref(),w.file(),w.anchor());
132 filter(w.word());
133 endLink(w.ref());
135}
QCString file() const
Definition docnode.h:171
QCString ref() const
Definition docnode.h:173
QCString word() const
Definition docnode.h:170
QCString anchor() const
Definition docnode.h:174

References DocLinkedWord::anchor(), DBG_RTF, endLink(), FALSE, DocLinkedWord::file(), filter(), m_hide, m_lastIsPara, DocLinkedWord::ref(), startLink(), and DocLinkedWord::word().

◆ operator()() [33/58]

void RTFDocVisitor::operator() ( const DocMscFile & df)

Definition at line 1291 of file rtfdocvisitor.cpp.

1292{
1293 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocMscFile &)}\n");
1294 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1295 writeMscFile(df);
1296 visitChildren(df);
1298}
void writeMscFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)

References Config_getBool, Config_getString, copyFile(), DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), stripPath(), visitChildren(), and writeMscFile().

◆ operator()() [34/58]

void RTFDocVisitor::operator() ( const DocPara & p)

Definition at line 726 of file rtfdocvisitor.cpp.

727{
728 if (m_hide) return;
729 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPara &)}\n");
730 visitChildren(p);
731 if (!m_lastIsPara &&
732 !p.isLast() && // omit <p> for last paragraph
733 !(p.parent() && // and for parameters & sections
734 std::get_if<DocParamSect>(p.parent())
735 )
736 )
737 {
738 m_t << "\\par\n";
740 }
741}
DocNodeVariant * parent()
Definition docnode.h:90
bool isLast() const
Definition docnode.h:1088

References DBG_RTF, DocPara::isLast(), m_hide, m_lastIsPara, m_t, DocNode::parent(), TRUE, and visitChildren().

◆ operator()() [35/58]

void RTFDocVisitor::operator() ( const DocParamList & pl)

Definition at line 1426 of file rtfdocvisitor.cpp.

1427{
1428 static int columnPos[4][5] =
1429 { { 2, 25, 100, 100, 100 }, // no inout, no type
1430 { 3, 14, 35, 100, 100 }, // inout, no type
1431 { 3, 25, 50, 100, 100 }, // no inout, type
1432 { 4, 14, 35, 55, 100 }, // inout, type
1433 };
1434 int config=0;
1435 if (m_hide) return;
1436 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamList &)}\n");
1437
1439 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1440 if (sect)
1441 {
1442 parentType = sect->type();
1443 }
1444 bool useTable = parentType==DocParamSect::Param ||
1445 parentType==DocParamSect::RetVal ||
1446 parentType==DocParamSect::Exception ||
1447 parentType==DocParamSect::TemplateParam;
1448 if (sect && sect->hasInOutSpecifier()) config+=1;
1449 if (sect && sect->hasTypeSpecifier()) config+=2;
1450 if (useTable)
1451 {
1452 m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
1453 "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1454 "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1455 "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1456 "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
1457 "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
1458 "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< "\n";
1459 for (int i=0;i<columnPos[config][0];i++)
1460 {
1461 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1462 "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1463 "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1464 "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
1465 "\\cltxlrtb "
1466 "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << "\n";
1467 }
1468 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1469 }
1470
1471 if (sect && sect->hasInOutSpecifier())
1472 {
1473 if (useTable)
1474 {
1475 m_t << "{";
1476 }
1477
1478 // Put in the direction: in/out/in,out if specified.
1480 {
1481 if (pl.direction()==DocParamSect::In)
1482 {
1483 m_t << "in";
1484 }
1485 else if (pl.direction()==DocParamSect::Out)
1486 {
1487 m_t << "out";
1488 }
1489 else if (pl.direction()==DocParamSect::InOut)
1490 {
1491 m_t << "in,out";
1492 }
1493 }
1494
1495 if (useTable)
1496 {
1497 m_t << "\\cell }";
1498 }
1499 }
1500
1501 if (sect && sect->hasTypeSpecifier())
1502 {
1503 if (useTable)
1504 {
1505 m_t << "{";
1506 }
1507 for (const auto &type : pl.paramTypes())
1508 {
1509 std::visit(*this,type);
1510 }
1511 if (useTable)
1512 {
1513 m_t << "\\cell }";
1514 }
1515 }
1516
1517
1518 if (useTable)
1519 {
1520 m_t << "{";
1521 }
1522
1523 m_t << "{\\i ";
1524 bool first=TRUE;
1525 for (const auto &param : pl.parameters())
1526 {
1527 if (!first) m_t << ","; else first=FALSE;
1528 std::visit(*this,param);
1529 }
1530 m_t << "} ";
1531
1532 if (useTable)
1533 {
1534 m_t << "\\cell }{";
1535 }
1537
1538 for (const auto &par : pl.paragraphs())
1539 {
1540 std::visit(*this,par);
1541 }
1542
1543 if (useTable)
1544 {
1545 m_t << "\\cell }\n";
1546 //m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1547 m_t << "{\\row }\n";
1548 }
1549 else
1550 {
1551 m_t << "\\par\n";
1552 }
1553
1555}
const DocNodeList & parameters() const
Definition docnode.h:1129
const DocNodeList & paramTypes() const
Definition docnode.h:1130
DocParamSect::Direction direction() const
Definition docnode.h:1133
const DocNodeList & paragraphs() const
Definition docnode.h:1131
bool hasInOutSpecifier() const
Definition docnode.h:1069
bool hasTypeSpecifier() const
Definition docnode.h:1070
Type type() const
Definition docnode.h:1068

References DBG_RTF, DocParamList::direction(), DocParamSect::Exception, FALSE, DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), DocParamSect::In, DocParamSect::InOut, m_hide, m_lastIsPara, m_t, DocParamSect::Out, DocParamList::paragraphs(), DocParamSect::Param, DocParamList::parameters(), DocParamList::paramTypes(), DocNode::parent(), DocParamSect::RetVal, rtf_pageWidth, DocParamSect::TemplateParam, TRUE, DocParamSect::type(), DocParamSect::Unknown, and DocParamSect::Unspecified.

◆ operator()() [36/58]

void RTFDocVisitor::operator() ( const DocParamSect & s)

Definition at line 1379 of file rtfdocvisitor.cpp.

1380{
1381 if (m_hide) return;
1382 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1383 m_t << "{"; // start param list
1384 if (!m_lastIsPara) m_t << "\\par\n";
1385 //m_t << "{\\b "; // start bold
1386 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1387 switch(s.type())
1388 {
1390 m_t << theTranslator->trParameters(); break;
1392 m_t << theTranslator->trReturnValues(); break;
1394 m_t << theTranslator->trExceptions(); break;
1397 default:
1398 ASSERT(0);
1399 }
1400 m_t << "\\par";
1401 m_t << "}\n";
1402 bool useTable = s.type()==DocParamSect::Param ||
1406 if (!useTable)
1407 {
1409 }
1410 m_t << rtf_Style_Reset << getStyle("DescContinue");
1412 visitChildren(s);
1413 //m_t << "\\par\n";
1414 if (!useTable)
1415 {
1417 }
1418 m_t << "}\n";
1419}
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trTemplateParameters()=0
virtual QCString trReturnValues()=0
Translator * theTranslator
Definition language.cpp:71

References ASSERT, DBG_RTF, decIndentLevel(), DocParamSect::Exception, getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, DocParamSect::Param, DocParamSect::RetVal, rtf_Style, rtf_Style_Reset, DocParamSect::TemplateParam, theTranslator, TRUE, DocParamSect::type(), and visitChildren().

◆ operator()() [37/58]

void RTFDocVisitor::operator() ( const DocParBlock & pb)

Definition at line 1654 of file rtfdocvisitor.cpp.

1655{
1656 if (m_hide) return;
1657 visitChildren(pb);
1658}

References m_hide, and visitChildren().

◆ operator()() [38/58]

void RTFDocVisitor::operator() ( const DocPlantUmlFile & df)

Definition at line 1309 of file rtfdocvisitor.cpp.

1310{
1311 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPlantUmlFile &)}\n");
1312 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1313 QCString rtfOutput = Config_getString(RTF_OUTPUT);
1314 std::string inBuf;
1315 readInputFile(df.file(),inBuf);
1316 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
1317 rtfOutput,QCString(),inBuf,PlantumlManager::PUML_BITMAP,
1318 QCString(),df.srcFile(),df.srcLine(),false);
1319 for(const auto &baseName: baseNameVector)
1320 {
1321 writePlantUMLFile(baseName, df.hasCaption());
1322 visitChildren(df);
1324 }
1325}
QCString srcFile() const
Definition docnode.h:691
int srcLine() const
Definition docnode.h:692
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
void writePlantUMLFile(const QCString &fileName, bool hasCaption)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:5486

References Config_getBool, Config_getString, copyFile(), DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), PlantumlManager::instance(), PlantumlManager::PUML_BITMAP, readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), writePlantUMLFile(), and PlantumlManager::writePlantUMLSource().

◆ operator()() [39/58]

void RTFDocVisitor::operator() ( const DocRef & ref)

Definition at line 1336 of file rtfdocvisitor.cpp.

1337{
1338 if (m_hide) return;
1339 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1340 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1341 // ref.anchor() for LaTeX/RTF
1342 if (ref.isSubPage())
1343 {
1344 startLink(ref.ref(),QCString(),ref.anchor());
1345 }
1346 else
1347 {
1348 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1349 }
1350 if (!ref.hasLinkText()) filter(ref.targetTitle());
1351 visitChildren(ref);
1352 if (!ref.file().isEmpty()) endLink(ref.ref());
1353 //m_t << " ";
1354}
QCString anchor() const
Definition docnode.h:785
QCString targetTitle() const
Definition docnode.h:786
bool isSubPage() const
Definition docnode.h:792
QCString file() const
Definition docnode.h:782
QCString ref() const
Definition docnode.h:784
bool hasLinkText() const
Definition docnode.h:788

References DocRef::anchor(), DBG_RTF, endLink(), DocRef::file(), filter(), DocRef::hasLinkText(), QCString::isEmpty(), DocRef::isSubPage(), m_hide, DocRef::ref(), startLink(), DocRef::targetTitle(), and visitChildren().

◆ operator()() [40/58]

void RTFDocVisitor::operator() ( const DocRoot & r)

Definition at line 743 of file rtfdocvisitor.cpp.

744{
745 if (m_hide) return;
746 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRoot &)}\n");
747 if (r.indent()) incIndentLevel();
748 m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
749 visitChildren(r);
750 if (!m_lastIsPara && !r.singleLine()) m_t << "\\par\n";
751 m_t << "}";
753 if (r.indent()) decIndentLevel();
754}
bool singleLine() const
Definition docnode.h:1319
bool indent() const
Definition docnode.h:1318

References DBG_RTF, decIndentLevel(), incIndentLevel(), DocRoot::indent(), m_hide, m_lastIsPara, m_t, rtf_Style, DocRoot::singleLine(), TRUE, and visitChildren().

◆ operator()() [41/58]

void RTFDocVisitor::operator() ( const DocSecRefItem & ref)

Definition at line 1357 of file rtfdocvisitor.cpp.

1358{
1359 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1360 visitChildren(ref);
1361}

References DBG_RTF, and visitChildren().

◆ operator()() [42/58]

void RTFDocVisitor::operator() ( const DocSecRefList & l)

Definition at line 1363 of file rtfdocvisitor.cpp.

1364{
1365 if (m_hide) return;
1366 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefList &)}\n");
1367 m_t << "{\n";
1369 m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
1370 m_t << "\\par\n";
1372 visitChildren(l);
1374 m_t << "\\par";
1375 m_t << "}\n";
1377}

References DBG_RTF, decIndentLevel(), getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE, and visitChildren().

◆ operator()() [43/58]

void RTFDocVisitor::operator() ( const DocSection & s)

Definition at line 869 of file rtfdocvisitor.cpp.

870{
871 if (m_hide) return;
872 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSection &)}\n");
873 if (!m_lastIsPara) m_t << "\\par\n";
874 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
875 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
876 m_t << "{{" // start section
878 QCString heading;
879 int level = std::min(s.level()+2+m_hierarchyLevel,4);
880 if (level <= 0)
881 level = 1;
882 heading.sprintf("Heading%d",level);
883 // set style
884 m_t << rtf_Style[heading.str()].reference() << "\n";
885 // make table of contents entry
886 if (s.title())
887 {
888 std::visit(*this,*s.title());
889 }
890 m_t << "\n\\par" << "}\n";
891 m_t << "{\\tc\\tcl" << level << " \\v ";
892 if (s.title())
893 {
894 std::visit(*this,*s.title());
895 }
896 m_t << "}\n";
898 visitChildren(s);
899 m_t << "\\par}\n"; // end section
901}
QCString file() const
Definition docnode.h:922
int level() const
Definition docnode.h:918
QCString anchor() const
Definition docnode.h:920
const DocNodeVariant * title() const
Definition docnode.h:919

References DocSection::anchor(), DBG_RTF, DocSection::file(), DocSection::level(), m_hide, m_hierarchyLevel, m_lastIsPara, m_t, rtf_Style, rtf_Style_Reset, rtfFormatBmkStr(), QCString::sprintf(), QCString::str(), stripPath(), DocSection::title(), TRUE, and visitChildren().

◆ operator()() [44/58]

void RTFDocVisitor::operator() ( const DocSeparator & sep)

Definition at line 1421 of file rtfdocvisitor.cpp.

1422{
1423 m_t << " " << sep.chars() << " ";
1424}
QCString chars() const
Definition docnode.h:369

References DocSeparator::chars(), and m_t.

◆ operator()() [45/58]

void RTFDocVisitor::operator() ( const DocSimpleList & l)

Definition at line 840 of file rtfdocvisitor.cpp.

841{
842 if (m_hide) return;
843 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
844 m_t << "{\n";
845 m_listItemInfo[indentLevel()].isEnum = false;
846 m_listItemInfo[indentLevel()].isCheck = false;
848 visitChildren(l);
849 if (!m_lastIsPara) m_t << "\\par\n";
850 m_t << "}\n";
852}

References DBG_RTF, FALSE, indentLevel(), m_hide, m_lastIsPara, m_listItemInfo, m_t, TRUE, and visitChildren().

◆ operator()() [46/58]

void RTFDocVisitor::operator() ( const DocSimpleListItem & li)

Definition at line 854 of file rtfdocvisitor.cpp.

855{
856 if (m_hide) return;
857 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleListItem &)}\n");
858 m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
861 if (li.paragraph())
862 {
863 std::visit(*this,*li.paragraph());
864 }
866 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
867}
const DocNodeVariant * paragraph() const
Definition docnode.h:1157

References DBG_RTF, decIndentLevel(), FALSE, getStyle(), incIndentLevel(), m_hide, m_lastIsPara, m_t, DocSimpleListItem::paragraph(), and rtf_Style_Reset.

◆ operator()() [47/58]

void RTFDocVisitor::operator() ( const DocSimpleSect & s)

Definition at line 756 of file rtfdocvisitor.cpp.

757{
758 if (m_hide) return;
759 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
760 if (!m_lastIsPara) m_t << "\\par\n";
761 m_t << "{"; // start desc
762 //m_t << "{\\b "; // start bold
763 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
764 switch(s.type())
765 {
767 m_t << theTranslator->trSeeAlso(); break;
769 m_t << theTranslator->trReturns(); break;
771 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
773 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
775 m_t << theTranslator->trVersion(); break;
777 m_t << theTranslator->trSince(); break;
779 m_t << theTranslator->trDate(); break;
781 m_t << theTranslator->trNote(); break;
783 m_t << theTranslator->trWarning(); break;
785 m_t << theTranslator->trPrecondition(); break;
787 m_t << theTranslator->trPostcondition(); break;
789 m_t << theTranslator->trCopyright(); break;
791 m_t << theTranslator->trInvariant(); break;
793 m_t << theTranslator->trRemarks(); break;
795 m_t << theTranslator->trAttention(); break;
797 m_t << theTranslator->trImportant(); break;
798 case DocSimpleSect::User: break;
799 case DocSimpleSect::Rcs: break;
800 case DocSimpleSect::Unknown: break;
801 }
802
805 {
806 m_t << "\\par";
807 m_t << "}"; // end bold
808 m_t << rtf_Style_Reset << getStyle("DescContinue");
809 m_t << "{\\s17 \\sa60 \\sb30\n";
810 }
811 else
812 {
813 if (s.title())
814 {
815 std::visit(*this,*s.title());
816 }
817 m_t << "\\par\n";
818 m_t << "}"; // end bold
819 m_t << rtf_Style_Reset << getStyle("DescContinue");
820 }
822 visitChildren(s);
823 if (!m_lastIsPara) m_t << "\\par\n";
826 {
827 m_t << "}"; // end DescContinue
828 }
829 m_t << "}"; // end desc
831}
Type type() const
Definition docnode.h:1026
const DocNodeVariant * title() const
Definition docnode.h:1033
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trVersion()=0
virtual QCString trReturns()=0
virtual QCString trRemarks()=0
virtual QCString trNote()=0
virtual QCString trPostcondition()=0
virtual QCString trAttention()=0
virtual QCString trCopyright()=0
virtual QCString trDate()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trWarning()=0
virtual QCString trSeeAlso()=0
virtual QCString trImportant()=0
virtual QCString trInvariant()=0

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, DBG_RTF, decIndentLevel(), FALSE, getStyle(), DocSimpleSect::Important, incIndentLevel(), DocSimpleSect::Invar, m_hide, m_lastIsPara, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, rtf_Style, rtf_Style_Reset, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, DocSimpleSect::title(), TRUE, DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [48/58]

void RTFDocVisitor::operator() ( const DocSimpleSectSep & )

Definition at line 636 of file rtfdocvisitor.cpp.

637{
638}

◆ operator()() [49/58]

void RTFDocVisitor::operator() ( const DocStyleChange & s)

Definition at line 256 of file rtfdocvisitor.cpp.

257{
258 if (m_hide) return;
260 DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
261 switch (s.style())
262 {
264 if (s.enable()) m_t << "{\\b "; else m_t << "} ";
265 break;
269 if (s.enable()) m_t << "{\\strike "; else m_t << "} ";
270 break;
273 if (s.enable()) m_t << "{\\ul "; else m_t << "} ";
274 break;
276 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
277 break;
281 if (s.enable()) m_t << "{\\f2 "; else m_t << "} ";
282 break;
284 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
285 break;
287 if (s.enable()) m_t << "{\\super "; else m_t << "} ";
288 break;
290 if (s.enable()) m_t << "{\\qc "; else m_t << "} ";
291 break;
293 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
294 break;
296 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
297 break;
299 if (s.enable())
300 {
301 m_t << "{\n";
302 m_t << "\\par\n";
303 m_t << rtf_Style_Reset << getStyle("CodeExample");
305 }
306 else
307 {
309 m_t << "\\par";
310 m_t << "}\n";
311 }
313 break;
314 case DocStyleChange::Div: /* HTML only */ break;
315 case DocStyleChange::Span: /* HTML only */ break;
316 }
317}
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DBG_RTF, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, getStyle(), DocStyleChange::Ins, DocStyleChange::Italic, DocStyleChange::Kbd, m_hide, m_insidePre, m_lastIsPara, m_t, DocStyleChange::Preformatted, rtf_Style_Reset, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::style(), DocStyleChange::Subscript, DocStyleChange::Superscript, TRUE, DocStyleChange::Typewriter, and DocStyleChange::Underline.

◆ operator()() [50/58]

void RTFDocVisitor::operator() ( const DocSymbol & s)

Definition at line 152 of file rtfdocvisitor.cpp.

153{
154 if (m_hide) return;
155 DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
156 const char *res = HtmlEntityMapper::instance().rtf(s.symbol());
157 if (res)
158 {
159 m_t << res;
160 }
161 else
162 {
163 err("RTF: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
164 }
166}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * rtf(SymType symb) const
Access routine to the RTF code of the HTML entity.

References DBG_RTF, err, FALSE, HtmlEntityMapper::instance(), m_hide, m_lastIsPara, m_t, HtmlEntityMapper::rtf(), DocSymbol::symbol(), and TRUE.

◆ operator()() [51/58]

void RTFDocVisitor::operator() ( const DocText & t)

Definition at line 1628 of file rtfdocvisitor.cpp.

1629{
1630 if (m_hide) return;
1631 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1632 visitChildren(t);
1633}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [52/58]

void RTFDocVisitor::operator() ( const DocTitle & t)

Definition at line 833 of file rtfdocvisitor.cpp.

834{
835 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocTitle &)}\n");
836 if (m_hide) return;
837 visitChildren(t);
838}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [53/58]

void RTFDocVisitor::operator() ( const DocURL & u)

Definition at line 210 of file rtfdocvisitor.cpp.

211{
212 if (m_hide) return;
213 DBG_RTF("{\\comment RTFDocVisitor::visit(DocURL)}\n");
214 if (Config_getBool(RTF_HYPERLINKS))
215 {
216 m_t << "{\\field "
217 "{\\*\\fldinst "
218 "{ HYPERLINK \"";
219 if (u.isEmail()) m_t << "mailto:";
220 m_t << u.url();
221 m_t << "\" }"
222 "{}";
223 m_t << "}"
224 "{\\fldrslt "
225 "{\\cs37\\ul\\cf2 ";
226 filter(u.url());
227 m_t << "}"
228 "}"
229 "}\n";
230 }
231 else
232 {
233 m_t << "{\\f2 ";
234 filter(u.url());
235 m_t << "}";
236 }
238}
QCString url() const
Definition docnode.h:192
bool isEmail() const
Definition docnode.h:193

References Config_getBool, DBG_RTF, FALSE, filter(), DocURL::isEmail(), m_hide, m_lastIsPara, m_t, and DocURL::url().

◆ operator()() [54/58]

void RTFDocVisitor::operator() ( const DocVerbatim & s)

Definition at line 319 of file rtfdocvisitor.cpp.

320{
321 if (m_hide) return;
322 DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
323 QCString lang = m_langExt;
324 if (!s.language().isEmpty()) // explicit language setting
325 {
326 lang = s.language();
327 }
328 SrcLangExt langExt = getLanguageFromCodeLang(lang);
329 switch(s.type())
330 {
332 m_t << "{\n";
333 m_t << "\\par\n";
334 m_t << rtf_Style_Reset << getStyle("CodeExample");
335 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
336 Config_getBool(STRIP_CODE_COMMENTS),
337 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
338 //m_t << "\\par\n";
339 m_t << "}\n";
340 break;
342 filter(s.text(),TRUE);
343 break;
345 m_t << "{\n";
346 m_t << "{\\f2 ";
347 filter(s.text(),TRUE);
348 m_t << "}";
349 m_t << "}\n";
350 break;
352 m_t << "{\n";
353 m_t << "\\par\n";
354 m_t << rtf_Style_Reset << getStyle("CodeExample");
355 filter(s.text(),TRUE);
356 //m_t << "\\par\n";
357 m_t << "}\n";
358 break;
360 m_t << s.text();
361 break;
367 /* nothing */
368 break;
369 case DocVerbatim::Dot:
370 {
371 static int dotindex = 1;
372 QCString fileName(4096, QCString::ExplicitSize);
373
374 fileName.sprintf("%s%d%s",
375 qPrint(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_"),
376 dotindex++,
377 ".dot"
378 );
379 std::ofstream file = Portable::openOutputStream(fileName);
380 if (!file.is_open())
381 {
382 err("Could not open file {} for writing\n",qPrint(fileName));
383 }
384 else
385 {
386 QCString stext = s.text();
387 file.write( stext.data(), stext.length() );
388 file.close();
389 }
390
391 writeDotFile(fileName, s.hasCaption(), s.srcFile(), s.srcLine());
392 visitChildren(s);
394
395 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
396 }
397 break;
398 case DocVerbatim::Msc:
399 {
400 static int mscindex = 1;
401 QCString baseName(4096, QCString::ExplicitSize);
402
403 baseName.sprintf("%s%d%s",
404 qPrint(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_"),
405 mscindex++,
406 ".msc"
407 );
408 std::ofstream file = Portable::openOutputStream(baseName);
409 if (!file.is_open())
410 {
411 err("Could not open file {} for writing\n",qPrint(baseName));
412 }
413 QCString text = "msc {";
414 text+=s.text();
415 text+="}";
416 file.write( text.data(), text.length() );
417 file.close();
418
419 writeMscFile(baseName, s.hasCaption(), s.srcFile(), s.srcLine());
420 visitChildren(s);
422
423 if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str());
424 }
425 break;
427 {
428 QCString rtfOutput = Config_getString(RTF_OUTPUT);
429 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
431 s.engine(),s.srcFile(),s.srcLine(),true);
432
433 for (const auto &baseName: baseNameVector)
434 {
435 writePlantUMLFile(baseName, s.hasCaption());
436 visitChildren(s);
438 }
439 }
440 break;
441 }
443}
QCString srcFile() const
Definition docnode.h:397
int srcLine() const
Definition docnode.h:398
bool hasCaption() const
Definition docnode.h:390
QCString language() const
Definition docnode.h:388
bool isExample() const
Definition docnode.h:385
QCString context() const
Definition docnode.h:384
Type type() const
Definition docnode.h:382
QCString text() const
Definition docnode.h:383
QCString exampleFile() const
Definition docnode.h:386
QCString engine() const
Definition docnode.h:393
@ JavaDocLiteral
Definition docnode.h:378
@ ExplicitSize
Definition qcstring.h:146
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:649
const char * qPrint(const char *s)
Definition qcstring.h:687
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5165

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), QCString::data(), DBG_RTF, DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine(), err, DocVerbatim::exampleFile(), QCString::ExplicitSize, FALSE, filter(), DocVisitor::getCodeParser(), getLanguageFromCodeLang(), getStyle(), DocVerbatim::hasCaption(), DocVerbatim::HtmlOnly, includePicturePostRTF(), PlantumlManager::instance(), QCString::isEmpty(), DocVerbatim::isExample(), DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language(), DocVerbatim::LatexOnly, QCString::length(), m_ci, m_hide, m_langExt, m_lastIsPara, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream(), CodeParserInterface::parseCode(), DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, qPrint(), Dir::remove(), rtf_Style_Reset, DocVerbatim::RtfOnly, QCString::sprintf(), DocVerbatim::srcFile(), DocVerbatim::srcLine(), QCString::str(), DocVerbatim::text(), TRUE, DocVerbatim::type(), DocVerbatim::Verbatim, visitChildren(), writeDotFile(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

void RTFDocVisitor::operator() ( const DocVhdlFlow & )

Definition at line 1650 of file rtfdocvisitor.cpp.

1651{
1652}

◆ operator()() [56/58]

void RTFDocVisitor::operator() ( const DocWhiteSpace & w)

Definition at line 137 of file rtfdocvisitor.cpp.

138{
139 if (m_hide) return;
140 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
141 if (m_insidePre)
142 {
143 m_t << w.chars();
144 }
145 else
146 {
147 m_t << " ";
148 }
150}
QCString chars() const
Definition docnode.h:358

References DocWhiteSpace::chars(), DBG_RTF, FALSE, m_hide, m_insidePre, m_lastIsPara, and m_t.

◆ operator()() [57/58]

void RTFDocVisitor::operator() ( const DocWord & w)

Definition at line 119 of file rtfdocvisitor.cpp.

120{
121 if (m_hide) return;
122 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWord)}\n");
123 filter(w.word());
125}
QCString word() const
Definition docnode.h:156

References DBG_RTF, FALSE, filter(), m_hide, m_lastIsPara, and DocWord::word().

◆ operator()() [58/58]

void RTFDocVisitor::operator() ( const DocXRefItem & x)

Definition at line 1557 of file rtfdocvisitor.cpp.

1558{
1559 if (m_hide) return;
1560 if (x.title().isEmpty()) return;
1561 bool anonymousEnum = x.file()=="@";
1562 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocXRefItem &)}\n");
1563 if (!m_lastIsPara)
1564 {
1565 m_t << "\\par\n";
1567 }
1568 m_t << "{"; // start param list
1569 //m_t << "{\\b "; // start bold
1570 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1571 if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1572 {
1573 QCString refName;
1574 if (!x.file().isEmpty())
1575 {
1576 refName+=stripPath(x.file());
1577 }
1578 if (!x.file().isEmpty() && !x.anchor().isEmpty())
1579 {
1580 refName+="_";
1581 }
1582 if (!x.anchor().isEmpty())
1583 {
1584 refName+=x.anchor();
1585 }
1586
1587 m_t << "{\\field "
1588 "{\\*\\fldinst "
1589 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1590 "}{}"
1591 "}"
1592 "{\\fldrslt "
1593 "{\\cs37\\ul\\cf2 ";
1594 filter(x.title());
1595 m_t << "}"
1596 "}"
1597 "}";
1598 }
1599 else
1600 {
1601 filter(x.title());
1602 }
1603 m_t << ":";
1604 m_t << "\\par";
1605 m_t << "}"; // end bold
1607 m_t << rtf_Style_Reset << getStyle("DescContinue");
1609 visitChildren(x);
1610 if (x.title().isEmpty()) return;
1611 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1612 m_t << "\\par\n";
1614 m_t << "}\n"; // end xref item
1616}
QCString anchor() const
Definition docnode.h:625
QCString file() const
Definition docnode.h:624
QCString title() const
Definition docnode.h:626

References DocXRefItem::anchor(), Config_getBool, DBG_RTF, decIndentLevel(), FALSE, DocXRefItem::file(), filter(), getStyle(), incIndentLevel(), QCString::isEmpty(), m_hide, m_lastIsPara, m_t, rtf_Style, rtf_Style_Reset, rtfFormatBmkStr(), stripPath(), DocXRefItem::title(), TRUE, and visitChildren().

◆ startLink()

void RTFDocVisitor::startLink ( const QCString & ref,
const QCString & file,
const QCString & anchor )
private

Definition at line 1696 of file rtfdocvisitor.cpp.

1697{
1698 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1699 {
1700 QCString refName;
1701 if (!file.isEmpty())
1702 {
1703 refName+=stripPath(file);
1704 }
1705 if (!file.isEmpty() && !anchor.isEmpty())
1706 {
1707 refName+='_';
1708 }
1709 if (!anchor.isEmpty())
1710 {
1711 refName+=anchor;
1712 }
1713
1714 m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1715 m_t << rtfFormatBmkStr(refName);
1716 m_t << "\" }{}";
1717 m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1718 }
1719 else
1720 {
1721 m_t << "{\\b ";
1722 }
1724}

References Config_getBool, FALSE, QCString::isEmpty(), m_lastIsPara, m_t, rtfFormatBmkStr(), and stripPath().

Referenced by operator()(), operator()(), operator()(), operator()(), and operator()().

◆ visitChildren()

◆ writeDiaFile()

void RTFDocVisitor::writeDiaFile ( const DocDiaFile & df)
private

Definition at line 1766 of file rtfdocvisitor.cpp.

1767{
1768 QCString baseName=makeBaseName(df.file());
1769 QCString outDir = Config_getString(RTF_OUTPUT);
1770 writeDiaGraphFromFile(df.file(),outDir,baseName,DiaOutputFormat::BITMAP,df.srcFile(),df.srcLine());
1771 includePicturePreRTF(baseName + ".png", true, df.hasCaption());
1772}
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
static QCString makeBaseName(const QCString &name)

References BITMAP, Config_getString, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePreRTF(), makeBaseName(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), and writeDiaGraphFromFile().

Referenced by operator()().

◆ writeDotFile() [1/2]

void RTFDocVisitor::writeDotFile ( const DocDotFile & df)
private

◆ writeDotFile() [2/2]

void RTFDocVisitor::writeDotFile ( const QCString & fileName,
bool hasCaption,
const QCString & srcFile,
int srcLine )
private

Definition at line 1743 of file rtfdocvisitor.cpp.

1745{
1746 QCString baseName=makeBaseName(filename);
1747 QCString outDir = Config_getString(RTF_OUTPUT);
1748 writeDotGraphFromFile(filename,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1749 QCString imgExt = getDotImageExtension();
1750 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1751}
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
QCString getDotImageExtension()
Definition util.cpp:6239

References BITMAP, Config_getString, getDotImageExtension(), includePicturePreRTF(), makeBaseName(), and writeDotGraphFromFile().

Referenced by operator()(), operator()(), and writeDotFile().

◆ writeMscFile() [1/2]

void RTFDocVisitor::writeMscFile ( const DocMscFile & df)
private

◆ writeMscFile() [2/2]

void RTFDocVisitor::writeMscFile ( const QCString & fileName,
bool hasCaption,
const QCString & srcFile,
int srcLine )
private

Definition at line 1757 of file rtfdocvisitor.cpp.

1759{
1760 QCString baseName=makeBaseName(fileName);
1761 QCString outDir = Config_getString(RTF_OUTPUT);
1762 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1763 includePicturePreRTF(baseName + ".png", true, hasCaption);
1764}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:157

References BITMAP, Config_getString, includePicturePreRTF(), makeBaseName(), and writeMscGraphFromFile().

Referenced by operator()(), operator()(), and writeMscFile().

◆ writePlantUMLFile()

void RTFDocVisitor::writePlantUMLFile ( const QCString & fileName,
bool hasCaption )
private

Definition at line 1774 of file rtfdocvisitor.cpp.

1775{
1776 QCString baseName=makeBaseName(fileName);
1777 QCString outDir = Config_getString(RTF_OUTPUT);
1779 includePicturePreRTF(baseName + ".png", true, hasCaption);
1780}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202

References Config_getString, PlantumlManager::generatePlantUMLOutput(), includePicturePreRTF(), PlantumlManager::instance(), makeBaseName(), and PlantumlManager::PUML_BITMAP.

Referenced by operator()(), and operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& RTFDocVisitor::m_ci
private

Definition at line 143 of file rtfdocvisitor.h.

Referenced by operator()(), operator()(), operator()(), and RTFDocVisitor().

◆ m_hide

◆ m_hierarchyLevel

int RTFDocVisitor::m_hierarchyLevel = 0
private

Definition at line 151 of file rtfdocvisitor.h.

Referenced by operator()(), operator()(), and RTFDocVisitor().

◆ m_indentLevel

int RTFDocVisitor::m_indentLevel = 0
private

Definition at line 150 of file rtfdocvisitor.h.

Referenced by decIndentLevel(), getListTable(), incIndentLevel(), and indentLevel().

◆ m_insidePre

bool RTFDocVisitor::m_insidePre = false
private

Definition at line 144 of file rtfdocvisitor.h.

Referenced by operator()(), and operator()().

◆ m_langExt

QCString RTFDocVisitor::m_langExt
private

Definition at line 147 of file rtfdocvisitor.h.

Referenced by operator()(), operator()(), and RTFDocVisitor().

◆ m_lastIsPara

◆ m_listItemInfo

RTFListItemInfo RTFDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 159 of file rtfdocvisitor.h.

Referenced by operator()(), operator()(), operator()(), operator()(), and operator()().

◆ m_t

◆ maxIndentLevels

const int RTFDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 149 of file rtfdocvisitor.h.

Referenced by incIndentLevel(), and indentLevel().


The documentation for this class was generated from the following files: