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

Concrete visitor implementation for RTF output. More...

#include <src/rtfdocvisitor.h>

Inheritance diagram for RTFDocVisitor:
Collaboration diagram for RTFDocVisitor:

Classes

struct  RTFListItemInfo

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Static Private Attributes

static const int maxIndentLevels = 13

Detailed Description

Concrete visitor implementation for RTF output.

Definition at line 31 of file rtfdocvisitor.h.

Constructor & Destructor Documentation

◆ RTFDocVisitor()

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

Definition at line 70 of file rtfdocvisitor.cpp.

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

References m_ci, m_hierarchyLevel, m_langExt, and m_t.

Member Function Documentation

◆ decIndentLevel()

void RTFDocVisitor::decIndentLevel ( )
private

◆ endLink()

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

Definition at line 1736 of file rtfdocvisitor.cpp.

1737{
1738 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1739 {
1740 m_t << "}}}";
1741 }
1742 else
1743 {
1744 m_t << "}";
1745 }
1747}
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 1678 of file rtfdocvisitor.cpp.

1679{
1680 if (!str.isEmpty())
1681 {
1682 const char *p=str.data();
1683 while (*p)
1684 {
1685 char c=*p++;
1686 switch (c)
1687 {
1688 case '{': m_t << "\\{"; break;
1689 case '}': m_t << "\\}"; break;
1690 case '\\': m_t << "\\\\"; break;
1691 case '\n': if (verbatim)
1692 {
1693 m_t << "\\par\n";
1694 }
1695 else
1696 {
1697 m_t << '\n';
1698 }
1699 break;
1700 default: m_t << c;
1701 }
1702 }
1703 }
1704}
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 83 of file rtfdocvisitor.cpp.

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

References ASSERT, m_indentLevel, and rtf_Table_Default.

Referenced by operator()().

◆ getStyle()

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

Definition at line 76 of file rtfdocvisitor.cpp.

77{
78 QCString n = name + QCString().setNum(indentLevel());
79 StyleData &sd = rtf_Style[n.str()];
80 return sd.reference();
81}
const std::string & str() const
Definition qcstring.h: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 101 of file rtfdocvisitor.cpp.

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

References err, m_indentLevel, and maxIndentLevels.

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

◆ includePicturePostRTF()

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

Definition at line 1256 of file rtfdocvisitor.cpp.

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

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

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

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

◆ indentLevel()

int RTFDocVisitor::indentLevel ( ) const
private

Definition at line 96 of file rtfdocvisitor.cpp.

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

References m_indentLevel, and maxIndentLevels.

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

◆ operator()() [1/58]

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

Definition at line 445 of file rtfdocvisitor.cpp.

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

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

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

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

651{
652 if (m_hide) return;
653 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
654 auto opt = cite.option();
655 if (!cite.file().isEmpty())
656 {
657 if (!opt.noCite()) startLink(cite.ref(),cite.file(),cite.anchor());
658
659 filter(cite.getText());
660
661 if (!opt.noCite()) endLink(cite.ref());
662 }
663 else
664 {
665 m_t << "{\\b";
666 if (!opt.noPar()) filter("[");
667 filter(cite.target());
668 if (!opt.noPar()) filter("]");
669 m_t << "}";
670 }
671}
QCString getText() const
Definition docnode.cpp:939
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 1310 of file rtfdocvisitor.cpp.

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

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

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

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

◆ operator()() [7/58]

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

Definition at line 168 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [8/58]

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

Definition at line 617 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [9/58]

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

Definition at line 248 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [10/58]

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

Definition at line 1118 of file rtfdocvisitor.cpp.

1119{
1120 if (m_hide) return;
1121 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHRef &)}\n");
1122 if (Config_getBool(RTF_HYPERLINKS))
1123 {
1124 if (href.url().startsWith("#"))
1125 {
1126 // when starting with # so a local link
1127 QCString cite;
1128 cite = href.file() + "_" + href.url().right(href.url().length()-1);
1129 m_t << "{\\field "
1130 "{\\*\\fldinst "
1131 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
1132 "}{}"
1133 "}"
1134 "{\\fldrslt "
1135 "{\\cs37\\ul\\cf2 ";
1136 }
1137 else
1138 {
1139 m_t << "{\\field "
1140 "{\\*\\fldinst "
1141 "{ HYPERLINK \"" << href.url() << "\" "
1142 "}{}"
1143 "}"
1144 "{\\fldrslt "
1145 "{\\cs37\\ul\\cf2 ";
1146 }
1147 }
1148 else
1149 {
1150 m_t << "{\\f2 ";
1151 }
1153 visitChildren(href);
1154 if (Config_getBool(RTF_HYPERLINKS))
1155 {
1156 m_t << "}"
1157 "}"
1158 "}";
1159 }
1160 else
1161 {
1162 m_t << "}";
1163 }
1165}
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: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 1645 of file rtfdocvisitor.cpp.

1646{
1647 if (m_hide) return;
1648 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1649 if (!m_lastIsPara) m_t << "\\par\n";
1650 m_t << "{"; // start desc
1652 m_t << rtf_Style_Reset << getStyle("DescContinue");
1653 visitChildren(q);
1654 if (!m_lastIsPara) m_t << "\\par\n";
1656 m_t << "}"; // end desc
1658}

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

1061{
1062 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCaption &)}\n");
1063 visitChildren(c);
1064 m_t << "}\n\\par\n";
1065}

References DBG_RTF, m_t, and visitChildren().

◆ operator()() [13/58]

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

Definition at line 1101 of file rtfdocvisitor.cpp.

1102{
1103 if (m_hide) return;
1104 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCell &)}\n");
1105 m_t << "{" << align(c);
1107 visitChildren(c);
1108 m_t << "\\cell }";
1110}
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 1023 of file rtfdocvisitor.cpp.

1024{
1025 if (m_hide) return;
1026 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescData &)}\n");
1028 m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
1029 visitChildren(dd);
1030 m_t << "\\par";
1031 m_t << "}\n";
1034}

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

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

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [16/58]

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

Definition at line 1009 of file rtfdocvisitor.cpp.

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

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

1176{
1177 if (m_hide) return;
1178 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDetails &)}\n");
1179 if (!m_lastIsPara) m_t << "\\par\n";
1180 auto summary = d.summary();
1181 if (summary)
1182 {
1183 std::visit(*this,*summary);
1184 m_t << "{"; // start desc
1186 m_t << rtf_Style_Reset << getStyle("DescContinue");
1187 }
1188 visitChildren(d);
1189 if (!m_lastIsPara) m_t << "\\par\n";
1190 if (summary)
1191 {
1193 m_t << "}"; // end desc
1194 }
1196}
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 1198 of file rtfdocvisitor.cpp.

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

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

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

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

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

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

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

◆ operator()() [22/58]

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

Definition at line 1167 of file rtfdocvisitor.cpp.

1168{
1169 if (m_hide) return;
1170 m_t << "{\\b ";
1171 visitChildren(s);
1172 m_t << "}\\par ";
1173}

References m_hide, m_t, and visitChildren().

◆ operator()() [23/58]

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

Definition at line 1036 of file rtfdocvisitor.cpp.

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

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

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

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

◆ operator()() [25/58]

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

Definition at line 467 of file rtfdocvisitor.cpp.

468{
469 if (m_hide) return;
471 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
472 switch(inc.type())
473 {
475 {
476 m_t << "{\n";
477 m_t << "\\par\n";
478 m_t << rtf_Style_Reset << getStyle("CodeExample");
479 FileInfo cfi( inc.file().str() );
480 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
482 inc.text(),
483 langExt,
484 inc.stripCodeComments(),
485 inc.isExample(),
486 inc.exampleFile(),
487 fd.get(), // fileDef,
488 -1, // start line
489 -1, // end line
490 FALSE, // inline fragment
491 nullptr, // memberDef
492 TRUE // show line numbers
493 );
494 m_t << "\\par";
495 m_t << "}\n";
496 }
497 break;
499 m_t << "{\n";
500 m_t << "\\par\n";
501 m_t << rtf_Style_Reset << getStyle("CodeExample");
503 inc.text(),langExt,
504 inc.stripCodeComments(),
505 inc.isExample(),
506 inc.exampleFile(),
507 nullptr, // fileDef
508 -1, // startLine
509 -1, // endLine
510 TRUE, // inlineFragment
511 nullptr, // memberDef
512 FALSE // show line numbers
513 );
514 m_t << "\\par";
515 m_t << "}\n";
516 break;
524 break;
526 m_t << inc.text();
527 break;
529 m_t << "{\n";
530 m_t << "\\par\n";
531 m_t << rtf_Style_Reset << getStyle("CodeExample");
532 filter(inc.text());
533 m_t << "\\par";
534 m_t << "}\n";
535 break;
538 m_t << "{\n";
539 if (!m_lastIsPara) m_t << "\\par\n";
540 m_t << rtf_Style_Reset << getStyle("CodeExample");
542 inc.file(),
543 inc.blockId(),
544 inc.context(),
546 inc.trimLeft(),
548 );
549 m_t << "}";
550 break;
551 }
553}
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: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:5718

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

556{
557 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
558 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
559 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
560 QCString locLangExt = getFileNameExtension(op.includeFileName());
561 if (locLangExt.isEmpty()) locLangExt = m_langExt;
562 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
563 if (op.isFirst())
564 {
565 if (!m_hide)
566 {
567 m_t << "{\n";
568 m_t << "\\par\n";
569 m_t << rtf_Style_Reset << getStyle("CodeExample");
570 }
572 m_hide = TRUE;
573 }
574 if (op.type()!=DocIncOperator::Skip)
575 {
576 m_hide = popHidden();
577 if (!m_hide)
578 {
579 std::unique_ptr<FileDef> fd = nullptr;
580 if (!op.includeFileName().isEmpty())
581 {
582 FileInfo cfi( op.includeFileName().str() );
583 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
584 }
585
586 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
588 op.isExample(),op.exampleFile(),
589 fd.get(), // fileDef
590 op.line(), // startLine
591 -1, // endLine
592 FALSE, // inline fragment
593 nullptr, // memberDef
594 op.showLineNo() // show line numbers
595 );
596 }
598 m_hide=TRUE;
599 }
600 if (op.isLast())
601 {
602 m_hide = popHidden();
603 if (!m_hide)
604 {
605 m_t << "\\par";
606 m_t << "}\n";
607 }
609 }
610 else
611 {
612 if (!m_hide) m_t << "\n";
614 }
615}
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:5760

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

639{
640 if (m_hide) return;
641 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
642 m_t << "{\\xe \\v " << i.entry() << "}\n";
644}
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 1112 of file rtfdocvisitor.cpp.

1113{
1114 if (m_hide) return;
1115 visitChildren(i);
1116}

References m_hide, and visitChildren().

◆ operator()() [29/58]

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

Definition at line 1628 of file rtfdocvisitor.cpp.

1629{
1630 if (m_hide) return;
1631 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1632 startLink("",ref.file(),ref.anchor());
1633 visitChildren(ref);
1634 endLink("");
1635 m_t << " ";
1636}
QCString file() const
Definition docnode.h:811
QCString anchor() const
Definition docnode.h:813

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

◆ operator()() [30/58]

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

Definition at line 240 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [31/58]

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

Definition at line 1337 of file rtfdocvisitor.cpp.

1338{
1339 if (m_hide) return;
1340 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocLink &)}\n");
1341 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1342 visitChildren(lnk);
1343 endLink(lnk.ref());
1344}

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

◆ operator()() [32/58]

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

Definition at line 127 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [33/58]

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

Definition at line 1301 of file rtfdocvisitor.cpp.

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

737{
738 if (m_hide) return;
739 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPara &)}\n");
740 visitChildren(p);
741 if (!m_lastIsPara &&
742 !p.isLast() && // omit <p> for last paragraph
743 !(p.parent() && // and for parameters & sections
744 std::get_if<DocParamSect>(p.parent())
745 )
746 )
747 {
748 m_t << "\\par\n";
750 }
751}
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 1436 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [36/58]

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

Definition at line 1389 of file rtfdocvisitor.cpp.

1390{
1391 if (m_hide) return;
1392 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1393 m_t << "{"; // start param list
1394 if (!m_lastIsPara) m_t << "\\par\n";
1395 //m_t << "{\\b "; // start bold
1396 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1397 switch(s.type())
1398 {
1400 m_t << theTranslator->trParameters(); break;
1402 m_t << theTranslator->trReturnValues(); break;
1404 m_t << theTranslator->trExceptions(); break;
1407 default:
1408 ASSERT(0);
1409 }
1410 m_t << "\\par";
1411 m_t << "}\n";
1412 bool useTable = s.type()==DocParamSect::Param ||
1416 if (!useTable)
1417 {
1419 }
1420 m_t << rtf_Style_Reset << getStyle("DescContinue");
1422 visitChildren(s);
1423 //m_t << "\\par\n";
1424 if (!useTable)
1425 {
1427 }
1428 m_t << "}\n";
1429}
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 1664 of file rtfdocvisitor.cpp.

1665{
1666 if (m_hide) return;
1667 visitChildren(pb);
1668}

References m_hide, and visitChildren().

◆ operator()() [38/58]

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

Definition at line 1319 of file rtfdocvisitor.cpp.

1320{
1321 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPlantUmlFile &)}\n");
1322 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1323 QCString rtfOutput = Config_getString(RTF_OUTPUT);
1324 std::string inBuf;
1325 readInputFile(df.file(),inBuf);
1326 auto baseNameVector = PlantumlManager::instance().writePlantUMLSource(
1327 rtfOutput,QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,
1328 QCString(),df.srcFile(),df.srcLine(),false);
1329 for(const auto &baseName: baseNameVector)
1330 {
1331 writePlantUMLFile(QCString(baseName), df.hasCaption());
1332 visitChildren(df);
1334 }
1335}
QCString srcFile() const
Definition docnode.h:691
int srcLine() const
Definition docnode.h:692
StringVector writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine, bool inlineCode)
Write a PlantUML compatible file.
Definition plantuml.cpp:31
static PlantumlManager & instance()
Definition plantuml.cpp:231
void writePlantUMLFile(const QCString &fileName, bool hasCaption)
bool readInputFile(const QCString &fileName, std::string &contents, bool filter, bool isSourceCode)
read a file name fileName and optionally filter and transcode it
Definition util.cpp:6047

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

1347{
1348 if (m_hide) return;
1349 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1350 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1351 // ref.anchor() for LaTeX/RTF
1352 if (ref.isSubPage())
1353 {
1354 startLink(ref.ref(),QCString(),ref.anchor());
1355 }
1356 else
1357 {
1358 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1359 }
1360 if (!ref.hasLinkText()) filter(ref.targetTitle());
1361 visitChildren(ref);
1362 if (!ref.file().isEmpty()) endLink(ref.ref());
1363 //m_t << " ";
1364}
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 753 of file rtfdocvisitor.cpp.

754{
755 if (m_hide) return;
756 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRoot &)}\n");
757 if (r.indent()) incIndentLevel();
758 m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
759 visitChildren(r);
760 if (!m_lastIsPara && !r.singleLine()) m_t << "\\par\n";
761 m_t << "}";
763 if (r.indent()) decIndentLevel();
764}
bool singleLine() const
Definition docnode.h:1319
bool indent() const
Definition docnode.h:1318

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

◆ operator()() [41/58]

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

Definition at line 1367 of file rtfdocvisitor.cpp.

1368{
1369 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1370 visitChildren(ref);
1371}

References DBG_RTF, and visitChildren().

◆ operator()() [42/58]

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

Definition at line 1373 of file rtfdocvisitor.cpp.

1374{
1375 if (m_hide) return;
1376 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefList &)}\n");
1377 m_t << "{\n";
1379 m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
1380 m_t << "\\par\n";
1382 visitChildren(l);
1384 m_t << "\\par";
1385 m_t << "}\n";
1387}

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

880{
881 if (m_hide) return;
882 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSection &)}\n");
883 if (!m_lastIsPara) m_t << "\\par\n";
884 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
885 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
886 m_t << "{{" // start section
888 QCString heading;
889 int level = std::min(s.level()+2+m_hierarchyLevel,4);
890 if (level <= 0)
891 level = 1;
892 heading.sprintf("Heading%d",level);
893 // set style
894 m_t << rtf_Style[heading.str()].reference() << "\n";
895 // make table of contents entry
896 if (s.title())
897 {
898 std::visit(*this,*s.title());
899 }
900 m_t << "\n\\par" << "}\n";
901 m_t << "{\\tc\\tcl" << level << " \\v ";
902 if (s.title())
903 {
904 std::visit(*this,*s.title());
905 }
906 m_t << "}\n";
908 visitChildren(s);
909 m_t << "\\par}\n"; // end section
911}
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 1431 of file rtfdocvisitor.cpp.

1432{
1433 m_t << " " << sep.chars() << " ";
1434}
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 850 of file rtfdocvisitor.cpp.

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

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

865{
866 if (m_hide) return;
867 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleListItem &)}\n");
868 m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
871 if (li.paragraph())
872 {
873 std::visit(*this,*li.paragraph());
874 }
876 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
877}
const DocNodeVariant * paragraph() const
Definition docnode.h:1157

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

◆ operator()() [47/58]

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

Definition at line 766 of file rtfdocvisitor.cpp.

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

647{
648}

◆ operator()() [49/58]

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

Definition at line 256 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [50/58]

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

Definition at line 152 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [51/58]

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

Definition at line 1638 of file rtfdocvisitor.cpp.

1639{
1640 if (m_hide) return;
1641 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1642 visitChildren(t);
1643}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [52/58]

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

Definition at line 843 of file rtfdocvisitor.cpp.

844{
845 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocTitle &)}\n");
846 if (m_hide) return;
847 visitChildren(t);
848}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [53/58]

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

Definition at line 210 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [54/58]

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

Definition at line 319 of file rtfdocvisitor.cpp.

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

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

1661{
1662}

◆ operator()() [56/58]

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

Definition at line 137 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [57/58]

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

Definition at line 119 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [58/58]

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

Definition at line 1567 of file rtfdocvisitor.cpp.

1568{
1569 if (m_hide) return;
1570 if (x.title().isEmpty()) return;
1571 bool anonymousEnum = x.file()=="@";
1572 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocXRefItem &)}\n");
1573 if (!m_lastIsPara)
1574 {
1575 m_t << "\\par\n";
1577 }
1578 m_t << "{"; // start param list
1579 //m_t << "{\\b "; // start bold
1580 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1581 if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1582 {
1583 QCString refName;
1584 if (!x.file().isEmpty())
1585 {
1586 refName+=stripPath(x.file());
1587 }
1588 if (!x.file().isEmpty() && !x.anchor().isEmpty())
1589 {
1590 refName+="_";
1591 }
1592 if (!x.anchor().isEmpty())
1593 {
1594 refName+=x.anchor();
1595 }
1596
1597 m_t << "{\\field "
1598 "{\\*\\fldinst "
1599 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1600 "}{}"
1601 "}"
1602 "{\\fldrslt "
1603 "{\\cs37\\ul\\cf2 ";
1604 filter(x.title());
1605 m_t << "}"
1606 "}"
1607 "}";
1608 }
1609 else
1610 {
1611 filter(x.title());
1612 }
1613 m_t << ":";
1614 m_t << "\\par";
1615 m_t << "}"; // end bold
1617 m_t << rtf_Style_Reset << getStyle("DescContinue");
1619 visitChildren(x);
1620 if (x.title().isEmpty()) return;
1621 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1622 m_t << "\\par\n";
1624 m_t << "}\n"; // end xref item
1626}
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 1706 of file rtfdocvisitor.cpp.

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

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

1777{
1778 QCString baseName=makeBaseName(df.file());
1779 QCString outDir = Config_getString(RTF_OUTPUT);
1780 writeDiaGraphFromFile(df.file(),outDir,baseName,DiaOutputFormat::BITMAP,df.srcFile(),df.srcLine());
1781 includePicturePreRTF(baseName + ".png", true, df.hasCaption());
1782}
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 1753 of file rtfdocvisitor.cpp.

1755{
1756 QCString baseName=makeBaseName(filename);
1757 QCString outDir = Config_getString(RTF_OUTPUT);
1758 writeDotGraphFromFile(filename,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1759 QCString imgExt = getDotImageExtension();
1760 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1761}
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:6800

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

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

1785{
1786 QCString baseName=makeBaseName(fileName);
1787 QCString outDir = Config_getString(RTF_OUTPUT);
1789 includePicturePreRTF(baseName + ".png", true, hasCaption);
1790}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:202

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

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

Member Data Documentation

◆ m_ci

OutputCodeList& RTFDocVisitor::m_ci
private

Definition at line 143 of file rtfdocvisitor.h.

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

◆ m_hide

◆ m_hierarchyLevel

int RTFDocVisitor::m_hierarchyLevel = 0
private

Definition at line 151 of file rtfdocvisitor.h.

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

◆ m_indentLevel

int RTFDocVisitor::m_indentLevel = 0
private

Definition at line 150 of file rtfdocvisitor.h.

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

◆ m_insidePre

bool RTFDocVisitor::m_insidePre = false
private

Definition at line 144 of file rtfdocvisitor.h.

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

◆ m_langExt

QCString RTFDocVisitor::m_langExt
private

Definition at line 147 of file rtfdocvisitor.h.

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

◆ m_lastIsPara

◆ m_listItemInfo

RTFListItemInfo RTFDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 159 of file rtfdocvisitor.h.

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

◆ m_t

◆ maxIndentLevels

const int RTFDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 149 of file rtfdocvisitor.h.

Referenced by incIndentLevel(), and indentLevel().


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