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, bool newFile=true)
void writeMscFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
void writeDiaFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
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 59 of file rtfdocvisitor.cpp.

61 : m_t(t), m_ci(ci), m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
62{
63}
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 1721 of file rtfdocvisitor.cpp.

1722{
1723 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1724 {
1725 m_t << "}}}";
1726 }
1727 else
1728 {
1729 m_t << "}";
1730 }
1732}
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 1663 of file rtfdocvisitor.cpp.

1664{
1665 if (!str.isEmpty())
1666 {
1667 const char *p=str.data();
1668 while (*p)
1669 {
1670 char c=*p++;
1671 switch (c)
1672 {
1673 case '{': m_t << "\\{"; break;
1674 case '}': m_t << "\\}"; break;
1675 case '\\': m_t << "\\\\"; break;
1676 case '\n': if (verbatim)
1677 {
1678 m_t << "\\par\n";
1679 }
1680 else
1681 {
1682 m_t << '\n';
1683 }
1684 break;
1685 default: m_t << c;
1686 }
1687 }
1688 }
1689}
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 72 of file rtfdocvisitor.cpp.

73{
74 for (int i=0 ; rtf_Table_Default[i].definition ; i++ )
75 {
76 if ((id == rtf_Table_Default[i].id) && (m_indentLevel == rtf_Table_Default[i].lvl))
77 {
78 return rtf_Table_Default[i].place;
79 }
80 }
81 ASSERT(0);
82 return "";
83}
#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 65 of file rtfdocvisitor.cpp.

66{
67 QCString n = name + QCString().setNum(indentLevel());
68 StyleData &sd = rtf_Style[n.str()];
69 return sd.reference();
70}
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 90 of file rtfdocvisitor.cpp.

91{
94 {
95 err("Maximum indent level ({}) exceeded while generating RTF output!\n",maxIndentLevels-1);
96 }
97}
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 1208 of file rtfdocvisitor.cpp.

1209{
1210 if (isTypeRTF)
1211 {
1212 if (m_hide) return;
1213 if (inlineImage)
1214 {
1215 if (hasCaption) m_t << " }";
1216 }
1217 else
1218 {
1219 if (hasCaption)
1220 {
1221 m_t << "}\n";
1222 m_t << "\\par}\n";
1223 }
1224 else
1225 {
1226 m_t << "}\n";
1227 }
1228 }
1229 }
1230 else
1231 {
1232 m_hide = popHidden();
1233 }
1234}
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 1171 of file rtfdocvisitor.cpp.

1172{
1173 if (isTypeRTF)
1174 {
1175 if (!inlineImage)
1176 {
1177 m_t << "\\par\n";
1178 m_t << "{\n";
1179 m_t << rtf_Style_Reset << "\n";
1180 if (hasCaption || m_lastIsPara) m_t << "\\par\n";
1181 m_t << "\\pard \\qc ";
1182 }
1183 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1184 m_t << name;
1185 m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
1186 if (!inlineImage)
1187 {
1188 m_t << "\\par\n";
1189 if (hasCaption)
1190 {
1191 m_t << "\\pard \\qc \\b";
1192 m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1193 }
1195 }
1196 else
1197 {
1198 if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown
1199 }
1200 }
1201 else // other format -> skip
1202 {
1204 m_hide=TRUE;
1205 }
1206}
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 85 of file rtfdocvisitor.cpp.

86{
87 return std::min(m_indentLevel,maxIndentLevels-1);
88}

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

408{
409 if (m_hide) return;
410 DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
411 QCString anchor;
412 if (!anc.file().isEmpty())
413 {
414 anchor+=stripPath(anc.file());
415 }
416 if (!anc.file().isEmpty() && !anc.anchor().isEmpty())
417 {
418 anchor+="_";
419 }
420 if (!anc.anchor().isEmpty())
421 {
422 anchor+=anc.anchor();
423 }
424 m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
425 m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
427}
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:4931

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

631{
632 if (m_hide) return;
633 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoList &)}\n");
634 m_t << "{\n";
635 int level = indentLevel();
636 m_listItemInfo[level].isEnum = l.isEnumList();
637 m_listItemInfo[level].isCheck = l.isCheckedList();
638 m_listItemInfo[level].type = '1';
639 m_listItemInfo[level].number = 1;
641 visitChildren(l);
642 if (!m_lastIsPara) m_t << "\\par";
643 m_t << "}\n";
645 if (!l.isCheckedList() && indentLevel()==0) m_t << "\\par\n";
646}
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 648 of file rtfdocvisitor.cpp.

649{
650 static int prevLevel = -1;
651 if (m_hide) return;
652 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoListItem &)}\n");
653 int level = indentLevel();
654 if ((level != prevLevel-1) &&
655 (!(level==prevLevel && level != 0 && m_listItemInfo[level].isCheck)) &&
656 (!m_lastIsPara))
657 m_t << "\\par\n";
658 prevLevel= level;
660 if (m_listItemInfo[level].isEnum)
661 {
662 m_t << getStyle("ListEnum") << "\n";
663 m_t << m_listItemInfo[level].number << ".\\tab ";
664 m_listItemInfo[level].number++;
665 }
666 else
667 {
668 switch (li.itemNumber())
669 {
670 case DocAutoList::Unchecked: // unchecked
671 m_t << getListTable(2) << "\n";
672 break;
673 case DocAutoList::Checked_x: // checked with x
674 case DocAutoList::Checked_X: // checked with X
675 m_t << getListTable(3) << "\n";
676 break;
677 default:
678 m_t << getListTable(1) << "\n";
679 break;
680 }
681 }
683 m_lastIsPara=false;
684 visitChildren(li);
686}
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 602 of file rtfdocvisitor.cpp.

603{
604 if (m_hide) return;
605 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
606 auto opt = cite.option();
607 if (!cite.file().isEmpty())
608 {
609 if (!opt.noCite()) startLink(cite.ref(),cite.file(),cite.anchor());
610
611 filter(cite.getText());
612
613 if (!opt.noCite()) endLink(cite.ref());
614 }
615 else
616 {
617 m_t << "{\\b";
618 if (!opt.noPar()) filter("[");
619 filter(cite.target());
620 if (!opt.noPar()) filter("]");
621 m_t << "}";
622 }
623}
QCString getText() const
Definition docnode.cpp:972
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 1284 of file rtfdocvisitor.cpp.

1285{
1286 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDiaFile &)}\n");
1287 bool exists = false;
1288 std::string inBuf;
1289 if (readInputFile(df.file(),inBuf))
1290 {
1291 auto fileName = writeFileContents(Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1292 ".dia", // extension
1293 inBuf, // contents
1294 exists);
1295 if (!fileName.isEmpty())
1296 {
1297 writeDiaFile(fileName, df.hasCaption(), df.srcFile(), df.srcLine(), !exists);
1298 visitChildren(df);
1300 }
1301 }
1302}
QCString srcFile() const
Definition docnode.h:691
QCString file() const
Definition docnode.h:685
int srcLine() const
Definition docnode.h:692
bool hasCaption() const
Definition docnode.h:687
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
void writeDiaFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)
#define Config_getString(name)
Definition config.h:32
QCString writeFileContents(const QCString &baseName, const QCString &extension, const QCString &content, bool &exists)
Thread-safe function to write a string to a file.
Definition util.cpp:6961
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:5532

References Config_getString, DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), writeDiaFile(), and writeFileContents().

◆ operator()() [6/58]

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

Definition at line 1245 of file rtfdocvisitor.cpp.

1246{
1247 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDotFile &)}\n");
1248 bool exists = false;
1249 std::string inBuf;
1250 if (readInputFile(df.file(),inBuf))
1251 {
1252 auto fileName = writeFileContents(Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1253 ".dot", // extension
1254 inBuf, // contents
1255 exists);
1256 if (!fileName.isEmpty())
1257 {
1258 writeDotFile(fileName, df.hasCaption(), df.srcFile(), df.srcLine(), !exists);
1259 visitChildren(df);
1261 }
1262 }
1263}
void writeDotFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)

References Config_getString, DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), writeDotFile(), and writeFileContents().

◆ operator()() [7/58]

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

Definition at line 157 of file rtfdocvisitor.cpp.

158{
159 if (m_hide) return;
160 DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n");
161 const char *res = EmojiEntityMapper::instance().unicode(s.index());
162 if (res)
163 {
164 const char *p = res;
165 int val = 0;
166 int val1 = 0;
167 while (*p)
168 {
169 switch(*p)
170 {
171 case '&': case '#': case 'x':
172 break;
173 case ';':
174 val1 = val;
175 val = 0xd800 + ( ( val1 - 0x10000 ) & 0xffc00 ) / 0x400 - 0x10000;
176 m_t << "\\u" << val << "?";
177 val = 0xdC00 + ( ( val1 - 0x10000 ) & 0x3ff ) - 0x10000 ;
178 m_t << "\\u" << val << "?";
179 val = 0;
180 break;
181 case '0': case '1': case '2': case '3': case '4':
182 case '5': case '6': case '7': case '8': case '9':
183 val = val * 16 + *p - '0';
184 break;
185 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
186 val = val * 16 + *p - 'a' + 10;
187 break;
188 }
189 p++;
190 }
191 }
192 else
193 {
194 m_t << s.name();
195 }
197}
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 569 of file rtfdocvisitor.cpp.

570{
571 if (m_hide) return;
572 DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
573 bool bDisplay = !f.isInline();
574 if (bDisplay)
575 {
576 m_t << "\\par";
577 m_t << "{";
578 m_t << "\\pard\\plain";
579 m_t << "\\pard";
580 m_t << "\\qc";
581 }
582 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f.relPath() << f.name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
583 if (bDisplay)
584 {
585 m_t << "\\par}";
586 }
588}
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 237 of file rtfdocvisitor.cpp.

238{
239 if (m_hide) return;
240 DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
241 m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
243}

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

◆ operator()() [10/58]

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

Definition at line 1070 of file rtfdocvisitor.cpp.

1071{
1072 if (m_hide) return;
1073 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHRef &)}\n");
1074 if (Config_getBool(RTF_HYPERLINKS))
1075 {
1076 if (href.url().startsWith("#"))
1077 {
1078 // when starting with # so a local link
1079 QCString cite;
1080 cite = href.file() + "_" + href.url().right(href.url().length()-1);
1081 m_t << "{\\field "
1082 "{\\*\\fldinst "
1083 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
1084 "}{}"
1085 "}"
1086 "{\\fldrslt "
1087 "{\\cs37\\ul\\cf2 ";
1088 }
1089 else
1090 {
1091 m_t << "{\\field "
1092 "{\\*\\fldinst "
1093 "{ HYPERLINK \"" << href.url() << "\" "
1094 "}{}"
1095 "}"
1096 "{\\fldrslt "
1097 "{\\cs37\\ul\\cf2 ";
1098 }
1099 }
1100 else
1101 {
1102 m_t << "{\\f2 ";
1103 }
1105 visitChildren(href);
1106 if (Config_getBool(RTF_HYPERLINKS))
1107 {
1108 m_t << "}"
1109 "}"
1110 "}";
1111 }
1112 else
1113 {
1114 m_t << "}";
1115 }
1117}
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 1630 of file rtfdocvisitor.cpp.

1631{
1632 if (m_hide) return;
1633 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1634 if (!m_lastIsPara) m_t << "\\par\n";
1635 m_t << "{"; // start desc
1637 m_t << rtf_Style_Reset << getStyle("DescContinue");
1638 visitChildren(q);
1639 if (!m_lastIsPara) m_t << "\\par\n";
1641 m_t << "}"; // end desc
1643}

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

1013{
1014 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCaption &)}\n");
1015 visitChildren(c);
1016 m_t << "}\n\\par\n";
1017}

References DBG_RTF, m_t, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1053 of file rtfdocvisitor.cpp.

1054{
1055 if (m_hide) return;
1056 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCell &)}\n");
1057 m_t << "{" << align(c);
1059 visitChildren(c);
1060 m_t << "\\cell }";
1062}
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 975 of file rtfdocvisitor.cpp.

976{
977 if (m_hide) return;
978 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescData &)}\n");
980 m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
981 visitChildren(dd);
982 m_t << "\\par";
983 m_t << "}\n";
986}

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

949{
950 if (m_hide) return;
951 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescList &)}\n");
952 //m_t << "{\n";
953 //m_t << rtf_Style_Reset << getStyle("ListContinue");
954 //m_lastIsPara=FALSE;
955 visitChildren(dl);
956 //m_t << "}\n";
957 //m_t << "\\par\n";
958 //m_lastIsPara=TRUE;
959}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [16/58]

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

Definition at line 961 of file rtfdocvisitor.cpp.

962{
963 if (m_hide) return;
964 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescTitle &)}\n");
965 //m_t << "\\par\n";
966 //m_t << "{\\b ";
967 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
969 visitChildren(dt);
970 m_t << "\\par\n";
971 m_t << "}\n";
973}

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

1128{
1129 if (m_hide) return;
1130 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDetails &)}\n");
1131 if (!m_lastIsPara) m_t << "\\par\n";
1132 auto summary = d.summary();
1133 if (summary)
1134 {
1135 std::visit(*this,*summary);
1136 m_t << "{"; // start desc
1138 m_t << rtf_Style_Reset << getStyle("DescContinue");
1139 }
1140 visitChildren(d);
1141 if (!m_lastIsPara) m_t << "\\par\n";
1142 if (summary)
1143 {
1145 m_t << "}"; // end desc
1146 }
1148}
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 1150 of file rtfdocvisitor.cpp.

1151{
1152 if (m_hide) return;
1153 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlHeader &)}\n");
1154 m_t << "{" // start section
1155 << rtf_Style_Reset;
1156 QCString heading;
1157 int level = std::clamp(header.level()+m_hierarchyLevel,SectionType::MinLevel,SectionType::MaxLevel);
1158 heading.sprintf("Heading%d",level);
1159 // set style
1160 m_t << rtf_Style[heading.str()].reference();
1161 // make open table of contents entry that will be closed in visitPost method
1162 m_t << "{\\tc\\tcl" << level << " ";
1164 visitChildren(header);
1165 // close open table of contents entry
1166 m_t << "} \\par";
1167 m_t << "}\n"; // end section
1169}
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 865 of file rtfdocvisitor.cpp.

866{
867 if (m_hide) return;
868 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlList &)}\n");
869 m_t << "{\n";
870 int level = indentLevel();
871 m_listItemInfo[level].isEnum = l.type()==DocHtmlList::Ordered;
872 m_listItemInfo[level].isCheck = false;
873 m_listItemInfo[level].number = 1;
874 m_listItemInfo[level].type = '1';
875 for (const auto &opt : l.attribs())
876 {
877 if (opt.name=="type")
878 {
879 m_listItemInfo[level].type = opt.value[0];
880 }
881 if (opt.name=="start")
882 {
883 bool ok = false;
884 int val = opt.value.toInt(&ok);
885 if (ok) m_listItemInfo[level].number = val;
886 }
887 }
889 visitChildren(l);
890 m_t << "\\par" << "}\n";
892}

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

895{
896 if (m_hide) return;
897 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlListItem &)}\n");
898 m_t << "\\par\n";
900 int level = indentLevel();
901 if (m_listItemInfo[level].isEnum)
902 {
903 for (const auto &opt : l.attribs())
904 {
905 if (opt.name=="value")
906 {
907 bool ok = false;
908 int val = opt.value.toInt(&ok);
909 if (ok) m_listItemInfo[level].number = val;
910 }
911 }
912 m_t << getStyle("ListEnum") << "\n";
913 switch (m_listItemInfo[level].type)
914 {
915 case '1':
916 m_t << m_listItemInfo[level].number;
917 break;
918 case 'a':
919 m_t << integerToAlpha(m_listItemInfo[level].number,false);
920 break;
921 case 'A':
922 m_t << integerToAlpha(m_listItemInfo[level].number);
923 break;
924 case 'i':
925 m_t << integerToRoman(m_listItemInfo[level].number,false);
926 break;
927 case 'I':
928 m_t << integerToRoman(m_listItemInfo[level].number);
929 break;
930 default:
931 m_t << m_listItemInfo[level].number;
932 break;
933 }
934 m_t << ".\\tab ";
935 m_listItemInfo[level].number++;
936 }
937 else
938 {
939 m_t << getStyle("ListBullet") << "\n";
940 }
943 visitChildren(l);
945 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
946}
const HtmlAttribList & attribs() const
Definition docnode.h:1167
QCString integerToRoman(int n, bool upper)
Definition util.cpp:6700
QCString integerToAlpha(int n, bool upper)
Definition util.cpp:6684

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

1020{
1021 if (m_hide) return;
1022 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlRow &)}\n");
1023 size_t columnWidth=r.numCells()>0 ? rtf_pageWidth/r.numCells() : 10;
1024 m_t << "\\trowd \\trgaph108\\trleft-108"
1025 "\\trbrdrt\\brdrs\\brdrw10 "
1026 "\\trbrdrl\\brdrs\\brdrw10 "
1027 "\\trbrdrb\\brdrs\\brdrw10 "
1028 "\\trbrdrr\\brdrs\\brdrw10 "
1029 "\\trbrdrh\\brdrs\\brdrw10 "
1030 "\\trbrdrv\\brdrs\\brdrw10 \n";
1031 for (size_t i=0;i<r.numCells();i++)
1032 {
1033 if (r.isHeading())
1034 {
1035 m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
1036 }
1037 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
1038 "\\clbrdrl\\brdrs\\brdrw10 "
1039 "\\clbrdrb\\brdrs\\brdrw10 "
1040 "\\clbrdrr \\brdrs\\brdrw10 "
1041 "\\cltxlrtb "
1042 "\\cellx" << ((i+1)*columnWidth) << "\n";
1043 }
1044 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1046 visitChildren(r);
1047 m_t << "\n";
1048 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1049 m_t << "{\\row }\n";
1051}
bool isHeading() const
Definition docnode.cpp:1960
size_t numCells() const
Definition docnode.h:1248
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 1119 of file rtfdocvisitor.cpp.

1120{
1121 if (m_hide) return;
1122 m_t << "{\\b ";
1123 visitChildren(s);
1124 m_t << "}\\par ";
1125}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 988 of file rtfdocvisitor.cpp.

989{
990 if (m_hide) return;
991 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlTable &)}\n");
992 if (!m_lastIsPara) m_t << "\\par\n";
994 if (t.caption())
995 {
996 const DocHtmlCaption &c = std::get<DocHtmlCaption>(*t.caption());
997 m_t << "\\pard \\qc \\b";
998 if (!c.file().isEmpty())
999 {
1000 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1001 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1002 }
1003 m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1004 std::visit(*this,*t.caption());
1005 }
1006 visitChildren(t);
1007 m_t << "\\pard\\plain\n";
1008 m_t << "\\par\n";
1010}
QCString anchor() const
Definition docnode.h:1232
QCString file() const
Definition docnode.h:1231
const DocNodeVariant * caption() const
Definition docnode.cpp:2208

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

1237{
1238 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocImage &)}\n");
1240 visitChildren(img);
1242}
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 429 of file rtfdocvisitor.cpp.

430{
431 if (m_hide) return;
433 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
434 switch(inc.type())
435 {
437 {
438 m_t << "{\n";
439 m_t << "\\par\n";
440 m_t << rtf_Style_Reset << getStyle("CodeExample");
441 FileInfo cfi( inc.file().str() );
442 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
444 inc.text(),
445 langExt,
446 inc.stripCodeComments(),
447 CodeParserOptions()
448 .setExample(inc.isExample(),inc.exampleFile())
449 .setFileDef(fd.get())
450 .setInlineFragment(true)
451 );
452 m_t << "\\par";
453 m_t << "}\n";
454 }
455 break;
457 m_t << "{\n";
458 m_t << "\\par\n";
459 m_t << rtf_Style_Reset << getStyle("CodeExample");
461 inc.text(),langExt,
462 inc.stripCodeComments(),
463 CodeParserOptions()
464 .setExample(inc.isExample(),inc.exampleFile())
465 .setInlineFragment(true)
466 .setShowLineNumbers(false)
467 );
468 m_t << "\\par";
469 m_t << "}\n";
470 break;
478 break;
480 m_t << inc.text();
481 break;
483 m_t << "{\n";
484 m_t << "\\par\n";
485 m_t << rtf_Style_Reset << getStyle("CodeExample");
486 filter(inc.text());
487 m_t << "\\par";
488 m_t << "}\n";
489 break;
492 m_t << "{\n";
493 if (!m_lastIsPara) m_t << "\\par\n";
494 m_t << rtf_Style_Reset << getStyle("CodeExample");
496 inc.file(),
497 inc.blockId(),
498 inc.context(),
500 inc.trimLeft(),
502 );
503 m_t << "}";
504 break;
505 }
507}
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:5193

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

510{
511 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
512 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
513 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
514 QCString locLangExt = getFileNameExtension(op.includeFileName());
515 if (locLangExt.isEmpty()) locLangExt = m_langExt;
516 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
517 if (op.isFirst())
518 {
519 if (!m_hide)
520 {
521 m_t << "{\n";
522 m_t << "\\par\n";
523 m_t << rtf_Style_Reset << getStyle("CodeExample");
524 }
526 m_hide = TRUE;
527 }
528 if (op.type()!=DocIncOperator::Skip)
529 {
530 m_hide = popHidden();
531 if (!m_hide)
532 {
533 std::unique_ptr<FileDef> fd = nullptr;
534 if (!op.includeFileName().isEmpty())
535 {
536 FileInfo cfi( op.includeFileName().str() );
537 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
538 }
539
540 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
542 CodeParserOptions()
543 .setExample(op.isExample(),op.exampleFile())
544 .setFileDef(fd.get())
545 .setStartLine(op.line())
546 .setShowLineNumbers(op.showLineNo())
547 );
548 }
550 m_hide=TRUE;
551 }
552 if (op.isLast())
553 {
554 m_hide = popHidden();
555 if (!m_hide)
556 {
557 m_t << "\\par";
558 m_t << "}\n";
559 }
561 }
562 else
563 {
564 if (!m_hide) m_t << "\n";
566 }
567}
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:5235

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

591{
592 if (m_hide) return;
593 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
594 m_t << "{\\xe \\v " << i.entry() << "}\n";
596}
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 1064 of file rtfdocvisitor.cpp.

1065{
1066 if (m_hide) return;
1067 visitChildren(i);
1068}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1613 of file rtfdocvisitor.cpp.

1614{
1615 if (m_hide) return;
1616 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1617 startLink("",ref.file(),ref.anchor());
1618 visitChildren(ref);
1619 endLink("");
1620 m_t << " ";
1621}
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 229 of file rtfdocvisitor.cpp.

230{
231 if (m_hide) return;
232 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
233 m_t << "\\par\n";
235}

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

◆ operator()() [31/58]

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

Definition at line 1322 of file rtfdocvisitor.cpp.

1323{
1324 if (m_hide) return;
1325 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocLink &)}\n");
1326 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1327 visitChildren(lnk);
1328 endLink(lnk.ref());
1329}

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

117{
118 if (m_hide) return;
119 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
120 startLink(w.ref(),w.file(),w.anchor());
121 filter(w.word());
122 endLink(w.ref());
124}
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 1264 of file rtfdocvisitor.cpp.

1265{
1266 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocMscFile &)}\n");
1267 bool exists = false;
1268 std::string inBuf;
1269 if (readInputFile(df.file(),inBuf))
1270 {
1271 auto fileName = writeFileContents(Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file())+"_", // baseName
1272 ".msc", // extension
1273 inBuf, // contents
1274 exists);
1275 if (!fileName.isEmpty())
1276 {
1277 writeMscFile(fileName, df.hasCaption(), df.srcFile(), df.srcLine(), !exists);
1278 visitChildren(df);
1280 }
1281 }
1282}
void writeMscFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine, bool newFile=true)

References Config_getString, DBG_RTF, DocDiagramFileBase::file(), DocDiagramFileBase::hasCaption(), includePicturePostRTF(), readInputFile(), DocDiagramFileBase::srcFile(), DocDiagramFileBase::srcLine(), stripPath(), visitChildren(), writeFileContents(), and writeMscFile().

◆ operator()() [34/58]

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

Definition at line 688 of file rtfdocvisitor.cpp.

689{
690 if (m_hide) return;
691 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPara &)}\n");
692 visitChildren(p);
693 if (!m_lastIsPara &&
694 !p.isLast() && // omit <p> for last paragraph
695 !(p.parent() && // and for parameters & sections
696 std::get_if<DocParamSect>(p.parent())
697 )
698 )
699 {
700 m_t << "\\par\n";
702 }
703}
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 1421 of file rtfdocvisitor.cpp.

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

1375{
1376 if (m_hide) return;
1377 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1378 m_t << "{"; // start param list
1379 if (!m_lastIsPara) m_t << "\\par\n";
1380 //m_t << "{\\b "; // start bold
1381 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1382 switch(s.type())
1383 {
1385 m_t << theTranslator->trParameters(); break;
1387 m_t << theTranslator->trReturnValues(); break;
1389 m_t << theTranslator->trExceptions(); break;
1392 default:
1393 ASSERT(0);
1394 }
1395 m_t << "\\par";
1396 m_t << "}\n";
1397 bool useTable = s.type()==DocParamSect::Param ||
1401 if (!useTable)
1402 {
1404 }
1405 m_t << rtf_Style_Reset << getStyle("DescContinue");
1407 visitChildren(s);
1408 //m_t << "\\par\n";
1409 if (!useTable)
1410 {
1412 }
1413 m_t << "}\n";
1414}
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 1649 of file rtfdocvisitor.cpp.

1650{
1651 if (m_hide) return;
1652 visitChildren(pb);
1653}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1304 of file rtfdocvisitor.cpp.

1305{
1306 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPlantUmlFile &)}\n");
1307 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1308 QCString rtfOutput = Config_getString(RTF_OUTPUT);
1309 std::string inBuf;
1310 readInputFile(df.file(),inBuf);
1311 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
1312 rtfOutput,QCString(),inBuf,PlantumlManager::PUML_BITMAP,
1313 QCString(),df.srcFile(),df.srcLine(),false);
1314 for(const auto &baseName: baseNameVector)
1315 {
1316 writePlantUMLFile(baseName, df.hasCaption());
1317 visitChildren(df);
1319 }
1320}
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 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:5859

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

1332{
1333 if (m_hide) return;
1334 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1335 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1336 // ref.anchor() for LaTeX/RTF
1337 if (ref.isSubPage())
1338 {
1339 startLink(ref.ref(),QCString(),ref.anchor());
1340 }
1341 else
1342 {
1343 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1344 }
1345 if (!ref.hasLinkText()) filter(ref.targetTitle());
1346 visitChildren(ref);
1347 if (!ref.file().isEmpty()) endLink(ref.ref());
1348 //m_t << " ";
1349}
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 705 of file rtfdocvisitor.cpp.

706{
707 if (m_hide) return;
708 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRoot &)}\n");
709 if (r.indent()) incIndentLevel();
710 m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
711 visitChildren(r);
712 if (!m_lastIsPara && !r.singleLine()) m_t << "\\par\n";
713 m_t << "}";
715 if (r.indent()) decIndentLevel();
716}
bool singleLine() const
Definition docnode.h:1316
bool indent() const
Definition docnode.h:1315

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

1353{
1354 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1355 visitChildren(ref);
1356}

References DBG_RTF, and visitChildren().

◆ operator()() [42/58]

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

Definition at line 1358 of file rtfdocvisitor.cpp.

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

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

832{
833 if (m_hide) return;
834 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSection &)}\n");
835 if (!m_lastIsPara) m_t << "\\par\n";
836 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
837 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
838 m_t << "{{" // start section
840 QCString heading;
841 int level = std::min(s.level()+2+m_hierarchyLevel,4);
842 if (level <= 0)
843 level = 1;
844 heading.sprintf("Heading%d",level);
845 // set style
846 m_t << rtf_Style[heading.str()].reference() << "\n";
847 // make table of contents entry
848 if (s.title())
849 {
850 std::visit(*this,*s.title());
851 }
852 m_t << "\n\\par" << "}\n";
853 m_t << "{\\tc\\tcl" << level << " \\v ";
854 if (s.title())
855 {
856 std::visit(*this,*s.title());
857 }
858 m_t << "}\n";
860 visitChildren(s);
861 m_t << "\\par}\n"; // end section
863}
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 1416 of file rtfdocvisitor.cpp.

1417{
1418 m_t << " " << sep.chars() << " ";
1419}
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 802 of file rtfdocvisitor.cpp.

803{
804 if (m_hide) return;
805 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
806 m_t << "{\n";
807 m_listItemInfo[indentLevel()].isEnum = false;
808 m_listItemInfo[indentLevel()].isCheck = false;
810 visitChildren(l);
811 if (!m_lastIsPara) m_t << "\\par\n";
812 m_t << "}\n";
814}

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

817{
818 if (m_hide) return;
819 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleListItem &)}\n");
820 m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
823 if (li.paragraph())
824 {
825 std::visit(*this,*li.paragraph());
826 }
828 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
829}
const DocNodeVariant * paragraph() const
Definition docnode.h:1154

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

719{
720 if (m_hide) return;
721 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
722 if (!m_lastIsPara) m_t << "\\par\n";
723 m_t << "{"; // start desc
724 //m_t << "{\\b "; // start bold
725 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
726 switch(s.type())
727 {
729 m_t << theTranslator->trSeeAlso(); break;
731 m_t << theTranslator->trReturns(); break;
733 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
735 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
737 m_t << theTranslator->trVersion(); break;
739 m_t << theTranslator->trSince(); break;
741 m_t << theTranslator->trDate(); break;
743 m_t << theTranslator->trNote(); break;
745 m_t << theTranslator->trWarning(); break;
747 m_t << theTranslator->trPrecondition(); break;
749 m_t << theTranslator->trPostcondition(); break;
751 m_t << theTranslator->trCopyright(); break;
753 m_t << theTranslator->trInvariant(); break;
755 m_t << theTranslator->trRemarks(); break;
757 m_t << theTranslator->trAttention(); break;
759 m_t << theTranslator->trImportant(); break;
760 case DocSimpleSect::User: break;
761 case DocSimpleSect::Rcs: break;
762 case DocSimpleSect::Unknown: break;
763 }
764
767 {
768 m_t << "\\par";
769 m_t << "}"; // end bold
770 m_t << rtf_Style_Reset << getStyle("DescContinue");
771 m_t << "{\\s17 \\sa60 \\sb30\n";
772 }
773 else
774 {
775 if (s.title())
776 {
777 std::visit(*this,*s.title());
778 }
779 m_t << "\\par\n";
780 m_t << "}"; // end bold
781 m_t << rtf_Style_Reset << getStyle("DescContinue");
782 }
784 visitChildren(s);
785 if (!m_lastIsPara) m_t << "\\par\n";
788 {
789 m_t << "}"; // end DescContinue
790 }
791 m_t << "}"; // end desc
793}
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 598 of file rtfdocvisitor.cpp.

599{
600}

◆ operator()() [49/58]

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

Definition at line 245 of file rtfdocvisitor.cpp.

246{
247 if (m_hide) return;
249 DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
250 switch (s.style())
251 {
253 if (s.enable()) m_t << "{\\b "; else m_t << "} ";
254 break;
258 if (s.enable()) m_t << "{\\strike "; else m_t << "} ";
259 break;
262 if (s.enable()) m_t << "{\\ul "; else m_t << "} ";
263 break;
265 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
266 break;
270 if (s.enable()) m_t << "{\\f2 "; else m_t << "} ";
271 break;
273 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
274 break;
276 if (s.enable()) m_t << "{\\super "; else m_t << "} ";
277 break;
279 if (s.enable()) m_t << "{\\qc "; else m_t << "} ";
280 break;
282 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
283 break;
285 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
286 break;
288 if (s.enable())
289 {
290 m_t << "{\n";
291 m_t << "\\par\n";
292 m_t << rtf_Style_Reset << getStyle("CodeExample");
294 }
295 else
296 {
298 m_t << "\\par";
299 m_t << "}\n";
300 }
302 break;
303 case DocStyleChange::Div: /* HTML only */ break;
304 case DocStyleChange::Span: /* HTML only */ break;
305 }
306}
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 141 of file rtfdocvisitor.cpp.

142{
143 if (m_hide) return;
144 DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
145 const char *res = HtmlEntityMapper::instance().rtf(s.symbol());
146 if (res)
147 {
148 m_t << res;
149 }
150 else
151 {
152 err("RTF: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
153 }
155}
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 1623 of file rtfdocvisitor.cpp.

1624{
1625 if (m_hide) return;
1626 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1627 visitChildren(t);
1628}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 795 of file rtfdocvisitor.cpp.

796{
797 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocTitle &)}\n");
798 if (m_hide) return;
799 visitChildren(t);
800}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 199 of file rtfdocvisitor.cpp.

200{
201 if (m_hide) return;
202 DBG_RTF("{\\comment RTFDocVisitor::visit(DocURL)}\n");
203 if (Config_getBool(RTF_HYPERLINKS))
204 {
205 m_t << "{\\field "
206 "{\\*\\fldinst "
207 "{ HYPERLINK \"";
208 if (u.isEmail()) m_t << "mailto:";
209 m_t << u.url();
210 m_t << "\" }"
211 "{}";
212 m_t << "}"
213 "{\\fldrslt "
214 "{\\cs37\\ul\\cf2 ";
215 filter(u.url());
216 m_t << "}"
217 "}"
218 "}\n";
219 }
220 else
221 {
222 m_t << "{\\f2 ";
223 filter(u.url());
224 m_t << "}";
225 }
227}
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 308 of file rtfdocvisitor.cpp.

309{
310 if (m_hide) return;
311 DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
312 QCString lang = m_langExt;
313 if (!s.language().isEmpty()) // explicit language setting
314 {
315 lang = s.language();
316 }
317 SrcLangExt langExt = getLanguageFromCodeLang(lang);
318 switch(s.type())
319 {
321 m_t << "{\n";
322 m_t << "\\par\n";
323 m_t << rtf_Style_Reset << getStyle("CodeExample");
324 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
325 Config_getBool(STRIP_CODE_COMMENTS),
326 CodeParserOptions().setExample(s.isExample(),s.exampleFile()));
327 //m_t << "\\par\n";
328 m_t << "}\n";
329 break;
331 filter(s.text(),TRUE);
332 break;
334 m_t << "{\n";
335 m_t << "{\\f2 ";
336 filter(s.text(),TRUE);
337 m_t << "}";
338 m_t << "}\n";
339 break;
341 m_t << "{\n";
342 m_t << "\\par\n";
343 m_t << rtf_Style_Reset << getStyle("CodeExample");
344 filter(s.text(),TRUE);
345 //m_t << "\\par\n";
346 m_t << "}\n";
347 break;
349 m_t << s.text();
350 break;
356 /* nothing */
357 break;
358 case DocVerbatim::Dot:
359 {
360 bool exists = false;
361 auto fileName = writeFileContents(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_", // baseName
362 ".dot", // extension
363 s.text(), // contents
364 exists);
365 if (!fileName.isEmpty())
366 {
367 writeDotFile(fileName, s.hasCaption(), s.srcFile(), s.srcLine(), !exists);
368 visitChildren(s);
370 }
371 }
372 break;
373 case DocVerbatim::Msc:
374 {
375 bool exists = false;
376 auto fileName = writeFileContents(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_", // baseName
377 ".msc", // extension
378 "msc {"+s.text()+"}", // contents
379 exists);
380 if (!fileName.isEmpty())
381 {
382 writeMscFile(fileName, s.hasCaption(), s.srcFile(), s.srcLine(), !exists);
383 visitChildren(s);
385 }
386 }
387 break;
389 {
390 QCString rtfOutput = Config_getString(RTF_OUTPUT);
391 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
393 s.engine(),s.srcFile(),s.srcLine(),true);
394
395 for (const auto &baseName: baseNameVector)
396 {
397 writePlantUMLFile(baseName, s.hasCaption());
398 visitChildren(s);
400 }
401 }
402 break;
403 }
405}
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
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5211

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), DBG_RTF, DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine(), DocVerbatim::exampleFile(), 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, m_ci, m_hide, m_langExt, m_lastIsPara, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, CodeParserInterface::parseCode(), DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, rtf_Style_Reset, DocVerbatim::RtfOnly, DocVerbatim::srcFile(), DocVerbatim::srcLine(), DocVerbatim::text(), TRUE, DocVerbatim::type(), DocVerbatim::Verbatim, visitChildren(), writeDotFile(), writeFileContents(), writeMscFile(), writePlantUMLFile(), PlantumlManager::writePlantUMLSource(), and DocVerbatim::XmlOnly.

◆ operator()() [55/58]

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

Definition at line 1645 of file rtfdocvisitor.cpp.

1646{
1647}

◆ operator()() [56/58]

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

Definition at line 126 of file rtfdocvisitor.cpp.

127{
128 if (m_hide) return;
129 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
130 if (m_insidePre)
131 {
132 m_t << w.chars();
133 }
134 else
135 {
136 m_t << " ";
137 }
139}
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 108 of file rtfdocvisitor.cpp.

109{
110 if (m_hide) return;
111 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWord)}\n");
112 filter(w.word());
114}
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 1552 of file rtfdocvisitor.cpp.

1553{
1554 if (m_hide) return;
1555 if (x.title().isEmpty()) return;
1556 bool anonymousEnum = x.file()=="@";
1557 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocXRefItem &)}\n");
1558 if (!m_lastIsPara)
1559 {
1560 m_t << "\\par\n";
1562 }
1563 m_t << "{"; // start param list
1564 //m_t << "{\\b "; // start bold
1565 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1566 if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1567 {
1568 QCString refName;
1569 if (!x.file().isEmpty())
1570 {
1571 refName+=stripPath(x.file());
1572 }
1573 if (!x.file().isEmpty() && !x.anchor().isEmpty())
1574 {
1575 refName+="_";
1576 }
1577 if (!x.anchor().isEmpty())
1578 {
1579 refName+=x.anchor();
1580 }
1581
1582 m_t << "{\\field "
1583 "{\\*\\fldinst "
1584 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1585 "}{}"
1586 "}"
1587 "{\\fldrslt "
1588 "{\\cs37\\ul\\cf2 ";
1589 filter(x.title());
1590 m_t << "}"
1591 "}"
1592 "}";
1593 }
1594 else
1595 {
1596 filter(x.title());
1597 }
1598 m_t << ":";
1599 m_t << "\\par";
1600 m_t << "}"; // end bold
1602 m_t << rtf_Style_Reset << getStyle("DescContinue");
1604 visitChildren(x);
1605 if (x.title().isEmpty()) return;
1606 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1607 m_t << "\\par\n";
1609 m_t << "}\n"; // end xref item
1611}
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 1691 of file rtfdocvisitor.cpp.

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

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 QCString & fileName,
bool hasCaption,
const QCString & srcFile,
int srcLine,
bool newFile = true )
private

Definition at line 1753 of file rtfdocvisitor.cpp.

1755{
1756 QCString baseName=makeBaseName(fileName,".dia");
1757 QCString outDir = Config_getString(RTF_OUTPUT);
1758 if (newFile) writeDiaGraphFromFile(fileName,outDir,baseName,DiaOutputFormat::BITMAP,srcFile,srcLine);
1759 includePicturePreRTF(baseName + ".png", true, hasCaption);
1760}
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
QCString makeBaseName(const QCString &name, const QCString &ext)
Definition util.cpp:4947

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

Referenced by operator()().

◆ writeDotFile()

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

Definition at line 1734 of file rtfdocvisitor.cpp.

1736{
1737 QCString baseName=makeBaseName(filename,".dot");
1738 QCString outDir = Config_getString(RTF_OUTPUT);
1739 if (newFile) writeDotGraphFromFile(filename,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1740 QCString imgExt = getDotImageExtension();
1741 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1742}
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:6291

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

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

◆ writeMscFile()

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

Definition at line 1744 of file rtfdocvisitor.cpp.

1746{
1747 QCString baseName=makeBaseName(fileName,".msc");
1748 QCString outDir = Config_getString(RTF_OUTPUT);
1749 if (newFile) writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1750 includePicturePreRTF(baseName + ".png", true, hasCaption);
1751}
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()(), and operator()().

◆ writePlantUMLFile()

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

Definition at line 1762 of file rtfdocvisitor.cpp.

1763{
1764 QCString baseName=makeBaseName(fileName,".pu");
1765 QCString outDir = Config_getString(RTF_OUTPUT);
1767 includePicturePreRTF(baseName + ".png", true, hasCaption);
1768}
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 141 of file rtfdocvisitor.h.

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

◆ m_hide

◆ m_hierarchyLevel

int RTFDocVisitor::m_hierarchyLevel = 0
private

Definition at line 149 of file rtfdocvisitor.h.

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

◆ m_indentLevel

int RTFDocVisitor::m_indentLevel = 0
private

Definition at line 148 of file rtfdocvisitor.h.

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

◆ m_insidePre

bool RTFDocVisitor::m_insidePre = false
private

Definition at line 142 of file rtfdocvisitor.h.

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

◆ m_langExt

QCString RTFDocVisitor::m_langExt
private

Definition at line 145 of file rtfdocvisitor.h.

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

◆ m_lastIsPara

◆ m_listItemInfo

RTFListItemInfo RTFDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 157 of file rtfdocvisitor.h.

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

◆ m_t

◆ maxIndentLevels

const int RTFDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 147 of file rtfdocvisitor.h.

Referenced by incIndentLevel(), and indentLevel().


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