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 69 of file rtfdocvisitor.cpp.

71 : m_t(t), m_ci(ci), m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
72{
73}
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 1729 of file rtfdocvisitor.cpp.

1730{
1731 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1732 {
1733 m_t << "}}}";
1734 }
1735 else
1736 {
1737 m_t << "}";
1738 }
1740}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
#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 1671 of file rtfdocvisitor.cpp.

1672{
1673 if (!str.isEmpty())
1674 {
1675 const char *p=str.data();
1676 while (*p)
1677 {
1678 char c=*p++;
1679 switch (c)
1680 {
1681 case '{': m_t << "\\{"; break;
1682 case '}': m_t << "\\}"; break;
1683 case '\\': m_t << "\\\\"; break;
1684 case '\n': if (verbatim)
1685 {
1686 m_t << "\\par\n";
1687 }
1688 else
1689 {
1690 m_t << '\n';
1691 }
1692 break;
1693 default: m_t << c;
1694 }
1695 }
1696 }
1697}
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:159

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 82 of file rtfdocvisitor.cpp.

83{
84 for (int i=0 ; rtf_Table_Default[i].definition ; i++ )
85 {
86 if ((id == rtf_Table_Default[i].id) && (m_indentLevel == rtf_Table_Default[i].lvl))
87 {
88 return rtf_Table_Default[i].place;
89 }
90 }
91 ASSERT(0);
92 return "";
93}
#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 75 of file rtfdocvisitor.cpp.

76{
77 QCString n = name + QCString().setNum(indentLevel());
78 StyleData &sd = rtf_Style[n.str()];
79 return sd.reference();
80}
const std::string & str() const
Definition qcstring.h:537
QCString & setNum(short n)
Definition qcstring.h:444
int indentLevel() const
StyleDataMap rtf_Style
Definition rtfstyle.cpp:362
const char * 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 100 of file rtfdocvisitor.cpp.

101{
104 {
105 err("Maximum indent level ({}) exceeded while generating RTF output!\n",maxIndentLevels-1);
106 }
107}
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 1252 of file rtfdocvisitor.cpp.

1253{
1254 if (isTypeRTF)
1255 {
1256 if (m_hide) return;
1257 if (inlineImage)
1258 {
1259 if (hasCaption) m_t << " }";
1260 }
1261 else
1262 {
1263 if (hasCaption)
1264 {
1265 m_t << "}\n";
1266 m_t << "\\par}\n";
1267 }
1268 else
1269 {
1270 m_t << "}\n";
1271 }
1272 }
1273 }
1274 else
1275 {
1276 m_hide = popHidden();
1277 }
1278}
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 1215 of file rtfdocvisitor.cpp.

1216{
1217 if (isTypeRTF)
1218 {
1219 if (!inlineImage)
1220 {
1221 m_t << "\\par\n";
1222 m_t << "{\n";
1223 m_t << rtf_Style_Reset << "\n";
1224 if (hasCaption || m_lastIsPara) m_t << "\\par\n";
1225 m_t << "\\pard \\qc ";
1226 }
1227 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1228 m_t << name;
1229 m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
1230 if (!inlineImage)
1231 {
1232 m_t << "\\par\n";
1233 if (hasCaption)
1234 {
1235 m_t << "\\pard \\qc \\b";
1236 m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1237 }
1239 }
1240 else
1241 {
1242 if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown
1243 }
1244 }
1245 else // other format -> skip
1246 {
1248 m_hide=TRUE;
1249 }
1250}
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 95 of file rtfdocvisitor.cpp.

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

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 441 of file rtfdocvisitor.cpp.

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

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 674 of file rtfdocvisitor.cpp.

675{
676 if (m_hide) return;
677 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoList &)}\n");
678 m_t << "{\n";
679 int level = indentLevel();
680 m_listItemInfo[level].isEnum = l.isEnumList();
681 m_listItemInfo[level].isCheck = l.isCheckedList();
682 m_listItemInfo[level].type = '1';
683 m_listItemInfo[level].number = 1;
685 visitChildren(l);
686 if (!m_lastIsPara) m_t << "\\par";
687 m_t << "}\n";
689 if (!l.isCheckedList() && indentLevel()==0) m_t << "\\par\n";
690}
bool isCheckedList() const
Definition docnode.h:578
bool isEnumList() const
Definition docnode.h:576
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 692 of file rtfdocvisitor.cpp.

693{
694 static int prevLevel = -1;
695 if (m_hide) return;
696 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoListItem &)}\n");
697 int level = indentLevel();
698 if ((level != prevLevel-1) &&
699 (!(level==prevLevel && level != 0 && m_listItemInfo[level].isCheck)) &&
700 (!m_lastIsPara))
701 m_t << "\\par\n";
702 prevLevel= level;
704 if (m_listItemInfo[level].isEnum)
705 {
706 m_t << getStyle("ListEnum") << "\n";
707 m_t << m_listItemInfo[level].number << ".\\tab ";
708 m_listItemInfo[level].number++;
709 }
710 else
711 {
712 switch (li.itemNumber())
713 {
714 case DocAutoList::Unchecked: // unchecked
715 m_t << getListTable(2) << "\n";
716 break;
717 case DocAutoList::Checked_x: // checked with x
718 case DocAutoList::Checked_X: // checked with X
719 m_t << getListTable(3) << "\n";
720 break;
721 default:
722 m_t << getListTable(1) << "\n";
723 break;
724 }
725 }
727 m_lastIsPara=false;
728 visitChildren(li);
730}
int itemNumber() const
Definition docnode.h:594
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 646 of file rtfdocvisitor.cpp.

647{
648 if (m_hide) return;
649 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
650 if (!cite.file().isEmpty())
651 {
652 startLink(cite.ref(),cite.file(),cite.anchor());
653 }
654 else
655 {
656 m_t << "{\\b ";
657 }
658 filter(cite.text());
659 if (!cite.file().isEmpty())
660 {
661 endLink(cite.ref());
662 }
663 else
664 {
665 m_t << "}";
666 }
667}
QCString text() const
Definition docnode.h:251
QCString anchor() const
Definition docnode.h:250
QCString ref() const
Definition docnode.h:249
QCString file() const
Definition docnode.h:247
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(), QCString::isEmpty(), m_hide, m_t, DocCite::ref(), startLink(), and DocCite::text().

◆ operator()() [5/58]

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

Definition at line 1306 of file rtfdocvisitor.cpp.

1307{
1308 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDiaFile &)}\n");
1309 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1310 writeDiaFile(df);
1311 visitChildren(df);
1313}
QCString file() const
Definition docnode.h:680
bool hasCaption() const
Definition docnode.h:682
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:6336

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 1289 of file rtfdocvisitor.cpp.

1290{
1291 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDotFile &)}\n");
1292 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1293 writeDotFile(df);
1294 visitChildren(df);
1296}
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 167 of file rtfdocvisitor.cpp.

168{
169 if (m_hide) return;
170 DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n");
171 const char *res = EmojiEntityMapper::instance().unicode(s.index());
172 if (res)
173 {
174 const char *p = res;
175 int val = 0;
176 int val1 = 0;
177 while (*p)
178 {
179 switch(*p)
180 {
181 case '&': case '#': case 'x':
182 break;
183 case ';':
184 val1 = val;
185 val = 0xd800 + ( ( val1 - 0x10000 ) & 0xffc00 ) / 0x400 - 0x10000;
186 m_t << "\\u" << val << "?";
187 val = 0xdC00 + ( ( val1 - 0x10000 ) & 0x3ff ) - 0x10000 ;
188 m_t << "\\u" << val << "?";
189 val = 0;
190 break;
191 case '0': case '1': case '2': case '3': case '4':
192 case '5': case '6': case '7': case '8': case '9':
193 val = val * 16 + *p - '0';
194 break;
195 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
196 val = val * 16 + *p - 'a' + 10;
197 break;
198 }
199 p++;
200 }
201 }
202 else
203 {
204 m_t << s.name();
205 }
207}
int index() const
Definition docnode.h:341
QCString name() const
Definition docnode.h:340
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 613 of file rtfdocvisitor.cpp.

614{
615 if (m_hide) return;
616 DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
617 bool bDisplay = !f.isInline();
618 if (bDisplay)
619 {
620 m_t << "\\par";
621 m_t << "{";
622 m_t << "\\pard\\plain";
623 m_t << "\\pard";
624 m_t << "\\qc";
625 }
626 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f.relPath() << f.name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
627 if (bDisplay)
628 {
629 m_t << "\\par}";
630 }
632}
QCString name() const
Definition docnode.h:528
bool isInline() const
Definition docnode.h:532
QCString relPath() const
Definition docnode.h:530

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 247 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [10/58]

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

Definition at line 1114 of file rtfdocvisitor.cpp.

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

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 1638 of file rtfdocvisitor.cpp.

1639{
1640 if (m_hide) return;
1641 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1642 if (!m_lastIsPara) m_t << "\\par\n";
1643 m_t << "{"; // start desc
1645 m_t << rtf_Style_Reset << getStyle("DescContinue");
1646 visitChildren(q);
1647 if (!m_lastIsPara) m_t << "\\par\n";
1649 m_t << "}"; // end desc
1651}

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 1056 of file rtfdocvisitor.cpp.

1057{
1058 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCaption &)}\n");
1059 visitChildren(c);
1060 m_t << "}\n\\par\n";
1061}

References DBG_RTF, m_t, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1097 of file rtfdocvisitor.cpp.

1098{
1099 if (m_hide) return;
1100 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCell &)}\n");
1101 m_t << "{" << align(c);
1103 visitChildren(c);
1104 m_t << "\\cell }";
1106}
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 1019 of file rtfdocvisitor.cpp.

1020{
1021 if (m_hide) return;
1022 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescData &)}\n");
1024 m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
1025 visitChildren(dd);
1026 m_t << "\\par";
1027 m_t << "}\n";
1030}

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 992 of file rtfdocvisitor.cpp.

993{
994 if (m_hide) return;
995 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescList &)}\n");
996 //m_t << "{\n";
997 //m_t << rtf_Style_Reset << getStyle("ListContinue");
998 //m_lastIsPara=FALSE;
999 visitChildren(dl);
1000 //m_t << "}\n";
1001 //m_t << "\\par\n";
1002 //m_lastIsPara=TRUE;
1003}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [16/58]

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

Definition at line 1005 of file rtfdocvisitor.cpp.

1006{
1007 if (m_hide) return;
1008 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescTitle &)}\n");
1009 //m_t << "\\par\n";
1010 //m_t << "{\\b ";
1011 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1013 visitChildren(dt);
1014 m_t << "\\par\n";
1015 m_t << "}\n";
1017}

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 1171 of file rtfdocvisitor.cpp.

1172{
1173 if (m_hide) return;
1174 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDetails &)}\n");
1175 if (!m_lastIsPara) m_t << "\\par\n";
1176 auto summary = d.summary();
1177 if (summary)
1178 {
1179 std::visit(*this,*summary);
1180 m_t << "{"; // start desc
1182 m_t << rtf_Style_Reset << getStyle("DescContinue");
1183 }
1184 visitChildren(d);
1185 if (!m_lastIsPara) m_t << "\\par\n";
1186 if (summary)
1187 {
1189 m_t << "}"; // end desc
1190 }
1192}
const DocNodeVariant * summary() const
Definition docnode.h:859

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 1194 of file rtfdocvisitor.cpp.

1195{
1196 if (m_hide) return;
1197 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlHeader &)}\n");
1198 m_t << "{" // start section
1199 << rtf_Style_Reset;
1200 QCString heading;
1201 int level = std::clamp(header.level()+m_hierarchyLevel,SectionType::MinLevel,SectionType::MaxLevel);
1202 heading.sprintf("Heading%d",level);
1203 // set style
1204 m_t << rtf_Style[heading.str()].reference();
1205 // make open table of contents entry that will be closed in visitPost method
1206 m_t << "{\\tc\\tcl" << level << " ";
1208 visitChildren(header);
1209 // close open table of contents entry
1210 m_t << "} \\par";
1211 m_t << "}\n"; // end section
1213}
int level() const
Definition docnode.h:872
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 909 of file rtfdocvisitor.cpp.

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

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 938 of file rtfdocvisitor.cpp.

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

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 1063 of file rtfdocvisitor.cpp.

1064{
1065 if (m_hide) return;
1066 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlRow &)}\n");
1067 size_t columnWidth=r.numCells()>0 ? rtf_pageWidth/r.numCells() : 10;
1068 m_t << "\\trowd \\trgaph108\\trleft-108"
1069 "\\trbrdrt\\brdrs\\brdrw10 "
1070 "\\trbrdrl\\brdrs\\brdrw10 "
1071 "\\trbrdrb\\brdrs\\brdrw10 "
1072 "\\trbrdrr\\brdrs\\brdrw10 "
1073 "\\trbrdrh\\brdrs\\brdrw10 "
1074 "\\trbrdrv\\brdrs\\brdrw10 \n";
1075 for (size_t i=0;i<r.numCells();i++)
1076 {
1077 if (r.isHeading())
1078 {
1079 m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
1080 }
1081 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
1082 "\\clbrdrl\\brdrs\\brdrw10 "
1083 "\\clbrdrb\\brdrs\\brdrw10 "
1084 "\\clbrdrr \\brdrs\\brdrw10 "
1085 "\\cltxlrtb "
1086 "\\cellx" << ((i+1)*columnWidth) << "\n";
1087 }
1088 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1090 visitChildren(r);
1091 m_t << "\n";
1092 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1093 m_t << "{\\row }\n";
1095}
bool isHeading() const
Definition docnode.cpp:1898
size_t numCells() const
Definition docnode.h:1246
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 1163 of file rtfdocvisitor.cpp.

1164{
1165 if (m_hide) return;
1166 m_t << "{\\b ";
1167 visitChildren(s);
1168 m_t << "}\\par ";
1169}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1032 of file rtfdocvisitor.cpp.

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

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 1280 of file rtfdocvisitor.cpp.

1281{
1282 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocImage &)}\n");
1284 visitChildren(img);
1286}
QCString name() const
Definition docnode.h:643
Type type() const
Definition docnode.h:642
bool isInlineImage() const
Definition docnode.h:649
bool hasCaption() const
Definition docnode.h:644
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 463 of file rtfdocvisitor.cpp.

464{
465 if (m_hide) return;
467 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
468 switch(inc.type())
469 {
471 {
472 m_t << "{\n";
473 m_t << "\\par\n";
474 m_t << rtf_Style_Reset << getStyle("CodeExample");
475 FileInfo cfi( inc.file().str() );
476 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
478 inc.text(),
479 langExt,
480 inc.stripCodeComments(),
481 inc.isExample(),
482 inc.exampleFile(),
483 fd.get(), // fileDef,
484 -1, // start line
485 -1, // end line
486 FALSE, // inline fragment
487 nullptr, // memberDef
488 TRUE // show line numbers
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 inc.isExample(),
502 inc.exampleFile(),
503 nullptr, // fileDef
504 -1, // startLine
505 -1, // endLine
506 TRUE, // inlineFragment
507 nullptr, // memberDef
508 FALSE // show line numbers
509 );
510 m_t << "\\par";
511 m_t << "}\n";
512 break;
520 break;
522 m_t << inc.text();
523 break;
525 m_t << "{\n";
526 m_t << "\\par\n";
527 m_t << rtf_Style_Reset << getStyle("CodeExample");
528 filter(inc.text());
529 m_t << "\\par";
530 m_t << "}\n";
531 break;
534 m_t << "{\n";
535 if (!m_lastIsPara) m_t << "\\par\n";
536 m_t << rtf_Style_Reset << getStyle("CodeExample");
538 inc.file(),
539 inc.blockId(),
540 inc.context(),
542 inc.trimLeft(),
544 );
545 m_t << "}";
546 break;
547 }
549}
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, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=nullptr, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=nullptr, bool showLineNumbers=TRUE, const Definition *searchCtx=nullptr, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
QCString blockId() const
Definition docnode.h:450
QCString extension() const
Definition docnode.h:446
bool stripCodeComments() const
Definition docnode.h:451
@ LatexInclude
Definition docnode.h:433
@ SnippetWithLines
Definition docnode.h:434
@ DontIncWithLines
Definition docnode.h:435
@ IncWithLines
Definition docnode.h:434
@ HtmlInclude
Definition docnode.h:433
@ VerbInclude
Definition docnode.h:433
@ DontInclude
Definition docnode.h:433
@ DocbookInclude
Definition docnode.h:435
Type type() const
Definition docnode.h:447
QCString exampleFile() const
Definition docnode.h:453
QCString text() const
Definition docnode.h:448
QCString file() const
Definition docnode.h:445
bool trimLeft() const
Definition docnode.h:455
bool isExample() const
Definition docnode.h:452
QCString context() const
Definition docnode.h:449
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:5721

References DocInclude::blockId(), DocInclude::context(), createFileDef(), DBG_RTF, FileInfo::dirPath(), DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile(), DocInclude::extension(), FALSE, 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, 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 551 of file rtfdocvisitor.cpp.

552{
553 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
554 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
555 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
556 QCString locLangExt = getFileNameExtension(op.includeFileName());
557 if (locLangExt.isEmpty()) locLangExt = m_langExt;
558 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
559 if (op.isFirst())
560 {
561 if (!m_hide)
562 {
563 m_t << "{\n";
564 m_t << "\\par\n";
565 m_t << rtf_Style_Reset << getStyle("CodeExample");
566 }
568 m_hide = TRUE;
569 }
570 if (op.type()!=DocIncOperator::Skip)
571 {
572 m_hide = popHidden();
573 if (!m_hide)
574 {
575 std::unique_ptr<FileDef> fd = nullptr;
576 if (!op.includeFileName().isEmpty())
577 {
578 FileInfo cfi( op.includeFileName().str() );
579 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
580 }
581
582 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
584 op.isExample(),op.exampleFile(),
585 fd.get(), // fileDef
586 op.line(), // startLine
587 -1, // endLine
588 FALSE, // inline fragment
589 nullptr, // memberDef
590 op.showLineNo() // show line numbers
591 );
592 }
594 m_hide=TRUE;
595 }
596 if (op.isLast())
597 {
598 m_hide = popHidden();
599 if (!m_hide)
600 {
601 m_t << "\\par";
602 m_t << "}\n";
603 }
605 }
606 else
607 {
608 if (!m_hide) m_t << "\n";
610 }
611}
bool stripCodeComments() const
Definition docnode.h:502
bool isLast() const
Definition docnode.h:499
QCString includeFileName() const
Definition docnode.h:505
QCString text() const
Definition docnode.h:495
QCString context() const
Definition docnode.h:497
QCString exampleFile() const
Definition docnode.h:504
int line() const
Definition docnode.h:493
Type type() const
Definition docnode.h:481
bool isFirst() const
Definition docnode.h:498
bool showLineNo() const
Definition docnode.h:494
bool isExample() const
Definition docnode.h:503
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5763

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, 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 634 of file rtfdocvisitor.cpp.

635{
636 if (m_hide) return;
637 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
638 m_t << "{\\xe \\v " << i.entry() << "}\n";
640}
QCString entry() const
Definition docnode.h:555

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 1108 of file rtfdocvisitor.cpp.

1109{
1110 if (m_hide) return;
1111 visitChildren(i);
1112}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1621 of file rtfdocvisitor.cpp.

1622{
1623 if (m_hide) return;
1624 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1625 startLink("",ref.file(),ref.anchor());
1626 visitChildren(ref);
1627 endLink("");
1628 m_t << " ";
1629}
QCString file() const
Definition docnode.h:806
QCString anchor() const
Definition docnode.h:808

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 239 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [31/58]

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

Definition at line 1330 of file rtfdocvisitor.cpp.

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

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 126 of file rtfdocvisitor.cpp.

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

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 1297 of file rtfdocvisitor.cpp.

1298{
1299 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocMscFile &)}\n");
1300 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1301 writeMscFile(df);
1302 visitChildren(df);
1304}
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 732 of file rtfdocvisitor.cpp.

733{
734 if (m_hide) return;
735 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPara &)}\n");
736 visitChildren(p);
737 if (!m_lastIsPara &&
738 !p.isLast() && // omit <p> for last paragraph
739 !(p.parent() && // and for parameters & sections
740 std::get_if<DocParamSect>(p.parent())
741 )
742 )
743 {
744 m_t << "\\par\n";
746 }
747}
DocNodeVariant * parent()
Definition docnode.h:89
bool isLast() const
Definition docnode.h:1083

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 1429 of file rtfdocvisitor.cpp.

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

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 1382 of file rtfdocvisitor.cpp.

1383{
1384 if (m_hide) return;
1385 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1386 m_t << "{"; // start param list
1387 if (!m_lastIsPara) m_t << "\\par\n";
1388 //m_t << "{\\b "; // start bold
1389 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1390 switch(s.type())
1391 {
1393 m_t << theTranslator->trParameters(); break;
1395 m_t << theTranslator->trReturnValues(); break;
1397 m_t << theTranslator->trExceptions(); break;
1400 default:
1401 ASSERT(0);
1402 }
1403 m_t << "\\par";
1404 m_t << "}\n";
1405 bool useTable = s.type()==DocParamSect::Param ||
1409 if (!useTable)
1410 {
1412 }
1413 m_t << rtf_Style_Reset << getStyle("DescContinue");
1415 visitChildren(s);
1416 //m_t << "\\par\n";
1417 if (!useTable)
1418 {
1420 }
1421 m_t << "}\n";
1422}
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 1657 of file rtfdocvisitor.cpp.

1658{
1659 if (m_hide) return;
1660 visitChildren(pb);
1661}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1315 of file rtfdocvisitor.cpp.

1316{
1317 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPlantUmlFile &)}\n");
1318 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1319 QCString rtfOutput = Config_getString(RTF_OUTPUT);
1320 std::string inBuf;
1321 readInputFile(df.file(),inBuf);
1322 QCString baseName = PlantumlManager::instance().writePlantUMLSource(
1323 rtfOutput,QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,
1324 QCString(),df.srcFile(),df.srcLine(),false);
1325 writePlantUMLFile(baseName, df.hasCaption());
1326 visitChildren(df);
1328}
QCString srcFile() const
Definition docnode.h:686
int srcLine() const
Definition docnode.h:687
QCString 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:28
static PlantumlManager & instance()
Definition plantuml.cpp:157
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:6013

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 1339 of file rtfdocvisitor.cpp.

1340{
1341 if (m_hide) return;
1342 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1343 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1344 // ref.anchor() for LaTeX/RTF
1345 if (ref.isSubPage())
1346 {
1347 startLink(ref.ref(),QCString(),ref.anchor());
1348 }
1349 else
1350 {
1351 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1352 }
1353 if (!ref.hasLinkText()) filter(ref.targetTitle());
1354 visitChildren(ref);
1355 if (!ref.file().isEmpty()) endLink(ref.ref());
1356 //m_t << " ";
1357}
QCString anchor() const
Definition docnode.h:780
QCString targetTitle() const
Definition docnode.h:781
bool isSubPage() const
Definition docnode.h:787
QCString file() const
Definition docnode.h:777
QCString ref() const
Definition docnode.h:779
bool hasLinkText() const
Definition docnode.h:783

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 749 of file rtfdocvisitor.cpp.

750{
751 if (m_hide) return;
752 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRoot &)}\n");
753 if (r.indent()) incIndentLevel();
754 m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
755 visitChildren(r);
756 if (!m_lastIsPara && !r.singleLine()) m_t << "\\par\n";
757 m_t << "}";
759 if (r.indent()) decIndentLevel();
760}
bool singleLine() const
Definition docnode.h:1314
bool indent() const
Definition docnode.h:1313

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 1360 of file rtfdocvisitor.cpp.

1361{
1362 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1363 visitChildren(ref);
1364}

References DBG_RTF, and visitChildren().

◆ operator()() [42/58]

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

Definition at line 1366 of file rtfdocvisitor.cpp.

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

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 875 of file rtfdocvisitor.cpp.

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

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 1424 of file rtfdocvisitor.cpp.

1425{
1426 m_t << " " << sep.chars() << " ";
1427}
QCString chars() const
Definition docnode.h:365

References DocSeparator::chars(), and m_t.

◆ operator()() [45/58]

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

Definition at line 846 of file rtfdocvisitor.cpp.

847{
848 if (m_hide) return;
849 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
850 m_t << "{\n";
851 m_listItemInfo[indentLevel()].isEnum = false;
852 m_listItemInfo[indentLevel()].isCheck = false;
854 visitChildren(l);
855 if (!m_lastIsPara) m_t << "\\par\n";
856 m_t << "}\n";
858}

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 860 of file rtfdocvisitor.cpp.

861{
862 if (m_hide) return;
863 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleListItem &)}\n");
864 m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
867 if (li.paragraph())
868 {
869 std::visit(*this,*li.paragraph());
870 }
872 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
873}
const DocNodeVariant * paragraph() const
Definition docnode.h:1152

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 762 of file rtfdocvisitor.cpp.

763{
764 if (m_hide) return;
765 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
766 if (!m_lastIsPara) m_t << "\\par\n";
767 m_t << "{"; // start desc
768 //m_t << "{\\b "; // start bold
769 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
770 switch(s.type())
771 {
773 m_t << theTranslator->trSeeAlso(); break;
775 m_t << theTranslator->trReturns(); break;
777 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
779 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
781 m_t << theTranslator->trVersion(); break;
783 m_t << theTranslator->trSince(); break;
785 m_t << theTranslator->trDate(); break;
787 m_t << theTranslator->trNote(); break;
789 m_t << theTranslator->trWarning(); break;
791 m_t << theTranslator->trPrecondition(); break;
793 m_t << theTranslator->trPostcondition(); break;
795 m_t << theTranslator->trCopyright(); break;
797 m_t << theTranslator->trInvariant(); break;
799 m_t << theTranslator->trRemarks(); break;
801 m_t << theTranslator->trAttention(); break;
803 m_t << theTranslator->trImportant(); break;
804 case DocSimpleSect::User: break;
805 case DocSimpleSect::Rcs: break;
806 case DocSimpleSect::Unknown: break;
807 }
808
811 {
812 m_t << "\\par";
813 m_t << "}"; // end bold
814 m_t << rtf_Style_Reset << getStyle("DescContinue");
815 m_t << "{\\s17 \\sa60 \\sb30\n";
816 }
817 else
818 {
819 if (s.title())
820 {
821 std::visit(*this,*s.title());
822 }
823 m_t << "\\par\n";
824 m_t << "}"; // end bold
825 m_t << rtf_Style_Reset << getStyle("DescContinue");
826 }
828 visitChildren(s);
829 if (!m_lastIsPara) m_t << "\\par\n";
832 {
833 m_t << "}"; // end DescContinue
834 }
835 m_t << "}"; // end desc
837}
Type type() const
Definition docnode.h:1021
const DocNodeVariant * title() const
Definition docnode.h:1028
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 642 of file rtfdocvisitor.cpp.

643{
644}

◆ operator()() [49/58]

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

Definition at line 255 of file rtfdocvisitor.cpp.

256{
257 if (m_hide) return;
259 DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
260 switch (s.style())
261 {
263 if (s.enable()) m_t << "{\\b "; else m_t << "} ";
264 break;
268 if (s.enable()) m_t << "{\\strike "; else m_t << "} ";
269 break;
272 if (s.enable()) m_t << "{\\ul "; else m_t << "} ";
273 break;
275 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
276 break;
280 if (s.enable()) m_t << "{\\f2 "; else m_t << "} ";
281 break;
283 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
284 break;
286 if (s.enable()) m_t << "{\\super "; else m_t << "} ";
287 break;
289 if (s.enable()) m_t << "{\\qc "; else m_t << "} ";
290 break;
292 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
293 break;
295 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
296 break;
298 if (s.enable())
299 {
300 m_t << "{\n";
301 m_t << "\\par\n";
302 m_t << rtf_Style_Reset << getStyle("CodeExample");
304 }
305 else
306 {
308 m_t << "\\par";
309 m_t << "}\n";
310 }
312 break;
313 case DocStyleChange::Div: /* HTML only */ break;
314 case DocStyleChange::Span: /* HTML only */ break;
315 }
316}
Style style() const
Definition docnode.h:303
bool enable() const
Definition docnode.h:305

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 151 of file rtfdocvisitor.cpp.

152{
153 if (m_hide) return;
154 DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
155 const char *res = HtmlEntityMapper::instance().rtf(s.symbol());
156 if (res)
157 {
158 m_t << res;
159 }
160 else
161 {
162 err("RTF: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
163 }
165}
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:328
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 1631 of file rtfdocvisitor.cpp.

1632{
1633 if (m_hide) return;
1634 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1635 visitChildren(t);
1636}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 839 of file rtfdocvisitor.cpp.

840{
841 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocTitle &)}\n");
842 if (m_hide) return;
843 visitChildren(t);
844}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 209 of file rtfdocvisitor.cpp.

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

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 318 of file rtfdocvisitor.cpp.

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

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 1653 of file rtfdocvisitor.cpp.

1654{
1655}

◆ operator()() [56/58]

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

Definition at line 136 of file rtfdocvisitor.cpp.

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

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 118 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [58/58]

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

Definition at line 1560 of file rtfdocvisitor.cpp.

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

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 1699 of file rtfdocvisitor.cpp.

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

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 1769 of file rtfdocvisitor.cpp.

1770{
1771 QCString baseName=makeBaseName(df.file());
1772 QCString outDir = Config_getString(RTF_OUTPUT);
1773 writeDiaGraphFromFile(df.file(),outDir,baseName,DiaOutputFormat::BITMAP,df.srcFile(),df.srcLine());
1774 includePicturePreRTF(baseName + ".png", true, df.hasCaption());
1775}
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 1746 of file rtfdocvisitor.cpp.

1748{
1749 QCString baseName=makeBaseName(filename);
1750 QCString outDir = Config_getString(RTF_OUTPUT);
1751 writeDotGraphFromFile(filename,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1752 QCString imgExt = getDotImageExtension();
1753 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1754}
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:6766

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 1760 of file rtfdocvisitor.cpp.

1762{
1763 QCString baseName=makeBaseName(fileName);
1764 QCString outDir = Config_getString(RTF_OUTPUT);
1765 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1766 includePicturePreRTF(baseName + ".png", true, hasCaption);
1767}
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 1777 of file rtfdocvisitor.cpp.

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

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: