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 DocLink &)
 
void operator() (const DocRef &ref)
 
void operator() (const DocSecRefItem &)
 
void operator() (const DocSecRefList &)
 
void operator() (const DocParamSect &)
 
void operator() (const DocParamList &)
 
void operator() (const DocXRefItem &)
 
void operator() (const DocInternalRef &)
 
void operator() (const DocText &)
 
void operator() (const DocHtmlBlockQuote &)
 
void operator() (const DocVhdlFlow &)
 
void operator() (const DocParBlock &)
 
- Public Member Functions inherited from DocVisitor
 DocVisitor ()
 
virtual ~DocVisitor ()
 
CodeParserInterfacegetCodeParser (const QCString &langExt)
 
void pushHidden (bool hide)
 
bool popHidden ()
 

Private Member Functions

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

Private Attributes

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

Static Private Attributes

static const int maxIndentLevels = 13
 

Detailed Description

Concrete visitor implementation for RTF output.

Definition at line 31 of file rtfdocvisitor.h.

Constructor & Destructor Documentation

◆ RTFDocVisitor()

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

Definition at line 69 of file rtfdocvisitor.cpp.

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

Member Function Documentation

◆ decIndentLevel()

void RTFDocVisitor::decIndentLevel ( )
private

◆ endLink()

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

Definition at line 1707 of file rtfdocvisitor.cpp.

1708{
1709 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1710 {
1711 m_t << "}}}";
1712 }
1713 else
1714 {
1715 m_t << "}";
1716 }
1718}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:143
#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 1649 of file rtfdocvisitor.cpp.

1650{
1651 if (!str.isEmpty())
1652 {
1653 const char *p=str.data();
1654 while (*p)
1655 {
1656 char c=*p++;
1657 switch (c)
1658 {
1659 case '{': m_t << "\\{"; break;
1660 case '}': m_t << "\\}"; break;
1661 case '\\': m_t << "\\\\"; break;
1662 case '\n': if (verbatim)
1663 {
1664 m_t << "\\par\n";
1665 }
1666 else
1667 {
1668 m_t << '\n';
1669 }
1670 break;
1671 default: m_t << c;
1672 }
1673 }
1674 }
1675}
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:152

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

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

◆ getListTable()

QCString RTFDocVisitor::getListTable ( const int id)
private

Definition at line 82 of file rtfdocvisitor.cpp.

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

References ASSERT, Rtf_Table_Default::definition, m_indentLevel, Rtf_Table_Default::place, and rtf_Table_Default.

Referenced by operator()().

◆ getStyle()

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

Definition at line 75 of file rtfdocvisitor.cpp.

76{
77 QCString n = name + QCString().setNum(indentLevel());
78 StyleData &sd = rtf_Style[n.str()];
79 return sd.reference();
80}
This is an alternative implementation of QCString.
Definition qcstring.h:94
const std::string & str() const
Definition qcstring.h:517
QCString & setNum(short n)
Definition qcstring.h:435
int indentLevel() const
StyleDataMap rtf_Style
Definition rtfstyle.cpp:362
const char * reference() const
Definition rtfstyle.h:69

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

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

◆ incIndentLevel()

void RTFDocVisitor::incIndentLevel ( )
private

Definition at line 100 of file rtfdocvisitor.cpp.

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

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

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

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

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

◆ includePicturePreRTF()

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

Definition at line 1208 of file rtfdocvisitor.cpp.

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

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

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

◆ indentLevel()

int RTFDocVisitor::indentLevel ( ) const
private

Definition at line 95 of file rtfdocvisitor.cpp.

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

References m_indentLevel, and maxIndentLevels.

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

◆ operator()() [1/57]

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

Definition at line 438 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [2/57]

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

Definition at line 667 of file rtfdocvisitor.cpp.

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

References DBG_RTF, FALSE, indentLevel(), RTFDocVisitor::RTFListItemInfo::isCheck, DocAutoList::isCheckedList(), RTFDocVisitor::RTFListItemInfo::isEnum, DocAutoList::isEnumList(), m_hide, m_lastIsPara, m_listItemInfo, m_t, RTFDocVisitor::RTFListItemInfo::number, TRUE, RTFDocVisitor::RTFListItemInfo::type, and visitChildren().

◆ operator()() [3/57]

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

Definition at line 685 of file rtfdocvisitor.cpp.

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

◆ operator()() [4/57]

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

Definition at line 639 of file rtfdocvisitor.cpp.

640{
641 if (m_hide) return;
642 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
643 if (!cite.file().isEmpty())
644 {
645 startLink(cite.ref(),cite.file(),cite.anchor());
646 }
647 else
648 {
649 m_t << "{\\b ";
650 }
651 filter(cite.text());
652 if (!cite.file().isEmpty())
653 {
654 endLink(cite.ref());
655 }
656 else
657 {
658 m_t << "}";
659 }
660}
QCString text() const
Definition docnode.h:250
QCString anchor() const
Definition docnode.h:249
QCString ref() const
Definition docnode.h:248
QCString file() const
Definition docnode.h:246
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
void filter(const QCString &str, bool verbatim=FALSE)
void endLink(const QCString &ref)

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

◆ operator()() [5/57]

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

Definition at line 1299 of file rtfdocvisitor.cpp.

1300{
1301 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDiaFile &)}\n");
1302 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1303 writeDiaFile(df);
1304 visitChildren(df);
1306}
QCString file() const
Definition docnode.h:656
bool hasCaption() const
Definition docnode.h:658
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:6092

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

◆ operator()() [6/57]

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

Definition at line 1282 of file rtfdocvisitor.cpp.

1283{
1284 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDotFile &)}\n");
1285 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1286 writeDotFile(df);
1287 visitChildren(df);
1289}
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/57]

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

Definition at line 167 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [8/57]

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

Definition at line 606 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [9/57]

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

Definition at line 247 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [10/57]

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

Definition at line 1107 of file rtfdocvisitor.cpp.

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

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/57]

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

Definition at line 1616 of file rtfdocvisitor.cpp.

1617{
1618 if (m_hide) return;
1619 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1620 if (!m_lastIsPara) m_t << "\\par\n";
1621 m_t << "{"; // start desc
1623 m_t << rtf_Style_Reset << getStyle("DescContinue");
1624 visitChildren(q);
1625 if (!m_lastIsPara) m_t << "\\par\n";
1627 m_t << "}"; // end desc
1629}

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

◆ operator()() [12/57]

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

Definition at line 1049 of file rtfdocvisitor.cpp.

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

References DBG_RTF, m_t, and visitChildren().

◆ operator()() [13/57]

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

Definition at line 1090 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [14/57]

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

Definition at line 1012 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [15/57]

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

Definition at line 985 of file rtfdocvisitor.cpp.

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

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [16/57]

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

Definition at line 998 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [17/57]

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

Definition at line 1164 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [18/57]

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

Definition at line 1187 of file rtfdocvisitor.cpp.

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

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

Definition at line 902 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [20/57]

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

Definition at line 931 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [21/57]

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

Definition at line 1056 of file rtfdocvisitor.cpp.

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

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

Definition at line 1156 of file rtfdocvisitor.cpp.

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

References m_hide, m_t, and visitChildren().

◆ operator()() [23/57]

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

Definition at line 1025 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [24/57]

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

Definition at line 1273 of file rtfdocvisitor.cpp.

1274{
1275 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocImage &)}\n");
1277 visitChildren(img);
1279}
QCString name() const
Definition docnode.h:619
Type type() const
Definition docnode.h:618
bool isInlineImage() const
Definition docnode.h:625
bool hasCaption() const
Definition docnode.h:620
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/57]

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

Definition at line 460 of file rtfdocvisitor.cpp.

461{
462 if (m_hide) return;
464 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
465 switch(inc.type())
466 {
468 {
469 m_t << "{\n";
470 m_t << "\\par\n";
471 m_t << rtf_Style_Reset << getStyle("CodeExample");
472 FileInfo cfi( inc.file().str() );
473 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
475 inc.text(),
476 langExt,
477 inc.isExample(),
478 inc.exampleFile(),
479 fd.get(), // fileDef,
480 -1, // start line
481 -1, // end line
482 FALSE, // inline fragment
483 nullptr, // memberDef
484 TRUE // show line numbers
485 );
486 m_t << "\\par";
487 m_t << "}\n";
488 }
489 break;
491 m_t << "{\n";
492 m_t << "\\par\n";
493 m_t << rtf_Style_Reset << getStyle("CodeExample");
495 inc.text(),langExt,inc.isExample(),
496 inc.exampleFile(),
497 nullptr, // fileDef
498 -1, // startLine
499 -1, // endLine
500 TRUE, // inlineFragment
501 nullptr, // memberDef
502 FALSE // show line numbers
503 );
504 m_t << "\\par";
505 m_t << "}\n";
506 break;
514 break;
516 m_t << inc.text();
517 break;
519 m_t << "{\n";
520 m_t << "\\par\n";
521 m_t << rtf_Style_Reset << getStyle("CodeExample");
522 filter(inc.text());
523 m_t << "\\par";
524 m_t << "}\n";
525 break;
529 m_t << "{\n";
530 if (!m_lastIsPara) m_t << "\\par\n";
531 m_t << rtf_Style_Reset << getStyle("CodeExample");
533 inc.file(),
534 inc.blockId(),
535 inc.context(),
538 );
539 m_t << "}";
540 break;
541 }
543}
void parseCodeFragment(OutputCodeList &codeOutList, const QCString &fileName, const QCString &blockId, const QCString &scopeName, bool showLineNumbers, bool trimLeft)
static CodeFragmentManager & instance()
virtual void parseCode(OutputCodeList &codeOutList, const QCString &scopeName, const QCString &input, SrcLangExt lang, 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:432
QCString extension() const
Definition docnode.h:428
@ LatexInclude
Definition docnode.h:416
@ SnippetTrimLeft
Definition docnode.h:419
@ SnippetWithLines
Definition docnode.h:417
@ DontIncWithLines
Definition docnode.h:418
@ IncWithLines
Definition docnode.h:417
@ HtmlInclude
Definition docnode.h:416
@ VerbInclude
Definition docnode.h:416
@ DontInclude
Definition docnode.h:416
@ DocbookInclude
Definition docnode.h:418
Type type() const
Definition docnode.h:429
QCString exampleFile() const
Definition docnode.h:434
QCString text() const
Definition docnode.h:430
QCString file() const
Definition docnode.h:427
bool isExample() const
Definition docnode.h:433
QCString context() const
Definition docnode.h:431
CodeParserInterface & getCodeParser(const QCString &langExt)
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
std::unique_ptr< FileDef > createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition filedef.cpp:263
SrcLangExt
Language as given by extension.
Definition types.h:42
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition util.cpp:5472

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::SnippetTrimLeft, DocInclude::SnippetWithLines, QCString::str(), DocInclude::text(), TRUE, DocInclude::type(), DocInclude::VerbInclude, and DocInclude::XmlInclude.

◆ operator()() [26/57]

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

Definition at line 545 of file rtfdocvisitor.cpp.

546{
547 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
548 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
549 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
551 if (locLangExt.isEmpty()) locLangExt = m_langExt;
552 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
553 if (op.isFirst())
554 {
555 if (!m_hide)
556 {
557 m_t << "{\n";
558 m_t << "\\par\n";
559 m_t << rtf_Style_Reset << getStyle("CodeExample");
560 }
562 m_hide = TRUE;
563 }
564 if (op.type()!=DocIncOperator::Skip)
565 {
566 m_hide = popHidden();
567 if (!m_hide)
568 {
569 std::unique_ptr<FileDef> fd = nullptr;
570 if (!op.includeFileName().isEmpty())
571 {
572 FileInfo cfi( op.includeFileName().str() );
573 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
574 }
575
576 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
577 op.isExample(),op.exampleFile(),
578 fd.get(), // fileDef
579 op.line(), // startLine
580 -1, // endLine
581 FALSE, // inline fragment
582 nullptr, // memberDef
583 op.showLineNo() // show line numbers
584 );
585 }
587 m_hide=TRUE;
588 }
589 if (op.isLast())
590 {
591 m_hide = popHidden();
592 if (!m_hide)
593 {
594 m_t << "\\par";
595 m_t << "}\n";
596 }
598 }
599 else
600 {
601 if (!m_hide) m_t << "\n";
603 }
604}
bool isLast() const
Definition docnode.h:477
QCString includeFileName() const
Definition docnode.h:482
QCString text() const
Definition docnode.h:473
QCString context() const
Definition docnode.h:475
QCString exampleFile() const
Definition docnode.h:481
int line() const
Definition docnode.h:471
Type type() const
Definition docnode.h:459
bool isFirst() const
Definition docnode.h:476
bool showLineNo() const
Definition docnode.h:472
bool isExample() const
Definition docnode.h:480
QCString getFileNameExtension(const QCString &fn)
Definition util.cpp:5514

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::text(), TRUE, and DocIncOperator::type().

◆ operator()() [27/57]

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

Definition at line 627 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [28/57]

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

Definition at line 1101 of file rtfdocvisitor.cpp.

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

References m_hide, and visitChildren().

◆ operator()() [29/57]

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

Definition at line 1599 of file rtfdocvisitor.cpp.

1600{
1601 if (m_hide) return;
1602 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1603 startLink("",ref.file(),ref.anchor());
1604 visitChildren(ref);
1605 endLink("");
1606 m_t << " ";
1607}
QCString file() const
Definition docnode.h:773
QCString anchor() const
Definition docnode.h:775

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

◆ operator()() [30/57]

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

Definition at line 239 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [31/57]

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

Definition at line 1308 of file rtfdocvisitor.cpp.

1309{
1310 if (m_hide) return;
1311 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocLink &)}\n");
1312 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1313 visitChildren(lnk);
1314 endLink(lnk.ref());
1315}

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

◆ operator()() [32/57]

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

Definition at line 126 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [33/57]

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

Definition at line 1290 of file rtfdocvisitor.cpp.

1291{
1292 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocMscFile &)}\n");
1293 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1294 writeMscFile(df);
1295 visitChildren(df);
1297}
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/57]

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

Definition at line 725 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [35/57]

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

Definition at line 1407 of file rtfdocvisitor.cpp.

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

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/57]

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

Definition at line 1360 of file rtfdocvisitor.cpp.

1361{
1362 if (m_hide) return;
1363 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1364 m_t << "{"; // start param list
1365 if (!m_lastIsPara) m_t << "\\par\n";
1366 //m_t << "{\\b "; // start bold
1367 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1368 switch(s.type())
1369 {
1371 m_t << theTranslator->trParameters(); break;
1373 m_t << theTranslator->trReturnValues(); break;
1375 m_t << theTranslator->trExceptions(); break;
1378 default:
1379 ASSERT(0);
1380 }
1381 m_t << "\\par";
1382 m_t << "}\n";
1383 bool useTable = s.type()==DocParamSect::Param ||
1387 if (!useTable)
1388 {
1390 }
1391 m_t << rtf_Style_Reset << getStyle("DescContinue");
1393 visitChildren(s);
1394 //m_t << "\\par\n";
1395 if (!useTable)
1396 {
1398 }
1399 m_t << "}\n";
1400}
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, Translator::trExceptions(), Translator::trParameters(), Translator::trReturnValues(), Translator::trTemplateParameters(), TRUE, DocParamSect::type(), and visitChildren().

◆ operator()() [37/57]

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

Definition at line 1635 of file rtfdocvisitor.cpp.

1636{
1637 if (m_hide) return;
1638 visitChildren(pb);
1639}

References m_hide, and visitChildren().

◆ operator()() [38/57]

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

Definition at line 1317 of file rtfdocvisitor.cpp.

1318{
1319 if (m_hide) return;
1320 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1321 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1322 // ref.anchor() for LaTeX/RTF
1323 if (ref.isSubPage())
1324 {
1325 startLink(ref.ref(),QCString(),ref.anchor());
1326 }
1327 else
1328 {
1329 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1330 }
1331 if (!ref.hasLinkText()) filter(ref.targetTitle());
1332 visitChildren(ref);
1333 if (!ref.file().isEmpty()) endLink(ref.ref());
1334 //m_t << " ";
1335}
QCString anchor() const
Definition docnode.h:747
QCString targetTitle() const
Definition docnode.h:748
bool isSubPage() const
Definition docnode.h:754
QCString file() const
Definition docnode.h:744
QCString ref() const
Definition docnode.h:746
bool hasLinkText() const
Definition docnode.h:750

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()() [39/57]

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

Definition at line 742 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [40/57]

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

Definition at line 1338 of file rtfdocvisitor.cpp.

1339{
1340 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1341 visitChildren(ref);
1342}

References DBG_RTF, and visitChildren().

◆ operator()() [41/57]

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

Definition at line 1344 of file rtfdocvisitor.cpp.

1345{
1346 if (m_hide) return;
1347 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefList &)}\n");
1348 m_t << "{\n";
1350 m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
1351 m_t << "\\par\n";
1353 visitChildren(l);
1355 m_t << "\\par";
1356 m_t << "}\n";
1358}

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

◆ operator()() [42/57]

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

Definition at line 868 of file rtfdocvisitor.cpp.

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

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()() [43/57]

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

Definition at line 1402 of file rtfdocvisitor.cpp.

1403{
1404 m_t << " " << sep.chars() << " ";
1405}
QCString chars() const
Definition docnode.h:348

References DocSeparator::chars(), and m_t.

◆ operator()() [44/57]

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

Definition at line 839 of file rtfdocvisitor.cpp.

840{
841 if (m_hide) return;
842 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
843 m_t << "{\n";
847 visitChildren(l);
848 if (!m_lastIsPara) m_t << "\\par\n";
849 m_t << "}\n";
851}

References DBG_RTF, FALSE, indentLevel(), RTFDocVisitor::RTFListItemInfo::isCheck, RTFDocVisitor::RTFListItemInfo::isEnum, m_hide, m_lastIsPara, m_listItemInfo, m_t, TRUE, and visitChildren().

◆ operator()() [45/57]

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

Definition at line 853 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [46/57]

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

Definition at line 755 of file rtfdocvisitor.cpp.

756{
757 if (m_hide) return;
758 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
759 if (!m_lastIsPara) m_t << "\\par\n";
760 m_t << "{"; // start desc
761 //m_t << "{\\b "; // start bold
762 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
763 switch(s.type())
764 {
766 m_t << theTranslator->trSeeAlso(); break;
768 m_t << theTranslator->trReturns(); break;
770 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
772 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
774 m_t << theTranslator->trVersion(); break;
776 m_t << theTranslator->trSince(); break;
778 m_t << theTranslator->trDate(); break;
780 m_t << theTranslator->trNote(); break;
782 m_t << theTranslator->trWarning(); break;
784 m_t << theTranslator->trPrecondition(); break;
786 m_t << theTranslator->trPostcondition(); break;
788 m_t << theTranslator->trCopyright(); break;
790 m_t << theTranslator->trInvariant(); break;
792 m_t << theTranslator->trRemarks(); break;
794 m_t << theTranslator->trAttention(); break;
796 m_t << theTranslator->trImportant(); break;
797 case DocSimpleSect::User: break;
798 case DocSimpleSect::Rcs: break;
799 case DocSimpleSect::Unknown: break;
800 }
801
804 {
805 m_t << "\\par";
806 m_t << "}"; // end bold
807 m_t << rtf_Style_Reset << getStyle("DescContinue");
808 m_t << "{\\s17 \\sa60 \\sb30\n";
809 }
810 else
811 {
812 if (s.title())
813 {
814 std::visit(*this,*s.title());
815 }
816 m_t << "\\par\n";
817 m_t << "}"; // end bold
818 m_t << rtf_Style_Reset << getStyle("DescContinue");
819 }
821 visitChildren(s);
822 if (!m_lastIsPara) m_t << "\\par\n";
825 {
826 m_t << "}"; // end DescContinue
827 }
828 m_t << "}"; // end desc
830}
Type type() const
Definition docnode.h:988
const DocNodeVariant * title() const
Definition docnode.h:995
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(), Translator::trAttention(), Translator::trAuthor(), Translator::trCopyright(), Translator::trDate(), Translator::trImportant(), Translator::trInvariant(), Translator::trNote(), Translator::trPostcondition(), Translator::trPrecondition(), Translator::trRemarks(), Translator::trReturns(), Translator::trSeeAlso(), Translator::trSince(), TRUE, Translator::trVersion(), Translator::trWarning(), DocSimpleSect::type(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren(), and DocSimpleSect::Warning.

◆ operator()() [47/57]

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

Definition at line 635 of file rtfdocvisitor.cpp.

636{
637}

◆ operator()() [48/57]

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

Definition at line 255 of file rtfdocvisitor.cpp.

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

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DBG_RTF, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable(), FALSE, getStyle(), DocStyleChange::Ins, DocStyleChange::Italic, 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, and DocStyleChange::Underline.

◆ operator()() [49/57]

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

Definition at line 151 of file rtfdocvisitor.cpp.

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

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

Definition at line 1609 of file rtfdocvisitor.cpp.

1610{
1611 if (m_hide) return;
1612 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1613 visitChildren(t);
1614}

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [51/57]

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

Definition at line 832 of file rtfdocvisitor.cpp.

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

References DBG_RTF, m_hide, and visitChildren().

◆ operator()() [52/57]

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

Definition at line 209 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [53/57]

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

Definition at line 316 of file rtfdocvisitor.cpp.

317{
318 if (m_hide) return;
319 DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
320 QCString lang = m_langExt;
321 if (!s.language().isEmpty()) // explicit language setting
322 {
323 lang = s.language();
324 }
325 SrcLangExt langExt = getLanguageFromCodeLang(lang);
326 switch(s.type())
327 {
329 m_t << "{\n";
330 m_t << "\\par\n";
331 m_t << rtf_Style_Reset << getStyle("CodeExample");
332 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
333 s.isExample(),s.exampleFile());
334 //m_t << "\\par\n";
335 m_t << "}\n";
336 break;
338 filter(s.text(),TRUE);
339 break;
341 m_t << "{\n";
342 m_t << "{\\f2 ";
343 filter(s.text(),TRUE);
344 m_t << "}";
345 m_t << "}\n";
346 break;
348 m_t << "{\n";
349 m_t << "\\par\n";
350 m_t << rtf_Style_Reset << getStyle("CodeExample");
351 filter(s.text(),TRUE);
352 //m_t << "\\par\n";
353 m_t << "}\n";
354 break;
356 m_t << s.text();
357 break;
363 /* nothing */
364 break;
365 case DocVerbatim::Dot:
366 {
367 static int dotindex = 1;
368 QCString fileName(4096, QCString::ExplicitSize);
369
370 fileName.sprintf("%s%d%s",
371 qPrint(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_"),
372 dotindex++,
373 ".dot"
374 );
375 std::ofstream file = Portable::openOutputStream(fileName);
376 if (!file.is_open())
377 {
378 err("Could not open file %s for writing\n",qPrint(fileName));
379 }
380 else
381 {
382 QCString stext = s.text();
383 file.write( stext.data(), stext.length() );
384 file.close();
385 }
386
387 writeDotFile(fileName, s.hasCaption(), s.srcFile(), s.srcLine());
388 visitChildren(s);
390
391 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
392 }
393 break;
394 case DocVerbatim::Msc:
395 {
396 static int mscindex = 1;
397 QCString baseName(4096, QCString::ExplicitSize);
398
399 baseName.sprintf("%s%d%s",
400 qPrint(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_"),
401 mscindex++,
402 ".msc"
403 );
404 std::ofstream file = Portable::openOutputStream(baseName);
405 if (!file.is_open())
406 {
407 err("Could not open file %s for writing\n",qPrint(baseName));
408 }
409 QCString text = "msc {";
410 text+=s.text();
411 text+="}";
412 file.write( text.data(), text.length() );
413 file.close();
414
415 writeMscFile(baseName, s.hasCaption(), s.srcFile(), s.srcLine());
416 visitChildren(s);
418
419 if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str());
420 }
421 break;
423 {
424 QCString rtfOutput = Config_getString(RTF_OUTPUT);
427 s.engine(),s.srcFile(),s.srcLine());
428
429 writePlantUMLFile(baseName, s.hasCaption());
430 visitChildren(s);
432 }
433 break;
434 }
436}
Class representing a directory in the file system.
Definition dir.h:75
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition dir.cpp:314
QCString srcFile() const
Definition docnode.h:376
int srcLine() const
Definition docnode.h:377
bool hasCaption() const
Definition docnode.h:369
QCString language() const
Definition docnode.h:367
bool isExample() const
Definition docnode.h:364
QCString context() const
Definition docnode.h:363
Type type() const
Definition docnode.h:361
QCString text() const
Definition docnode.h:362
QCString exampleFile() const
Definition docnode.h:365
QCString engine() const
Definition docnode.h:372
@ JavaDocLiteral
Definition docnode.h:357
QCString writePlantUMLSource(const QCString &outDirArg, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition plantuml.cpp:27
static PlantumlManager & instance()
Definition plantuml.cpp:155
@ ExplicitSize
Definition qcstring.h:126
void writePlantUMLFile(const QCString &fileName, bool hasCaption)
std::ofstream openOutputStream(const QCString &name, bool append=false)
Definition portable.cpp:638
const char * qPrint(const char *s)
Definition qcstring.h:652
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:5490

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()() [54/57]

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

Definition at line 1631 of file rtfdocvisitor.cpp.

1632{
1633}

◆ operator()() [55/57]

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

Definition at line 136 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [56/57]

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

Definition at line 118 of file rtfdocvisitor.cpp.

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

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

◆ operator()() [57/57]

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

Definition at line 1538 of file rtfdocvisitor.cpp.

1539{
1540 if (m_hide) return;
1541 if (x.title().isEmpty()) return;
1542 bool anonymousEnum = x.file()=="@";
1543 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocXRefItem &)}\n");
1544 if (!m_lastIsPara)
1545 {
1546 m_t << "\\par\n";
1548 }
1549 m_t << "{"; // start param list
1550 //m_t << "{\\b "; // start bold
1551 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1552 if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1553 {
1554 QCString refName;
1555 if (!x.file().isEmpty())
1556 {
1557 refName+=stripPath(x.file());
1558 }
1559 if (!x.file().isEmpty() && !x.anchor().isEmpty())
1560 {
1561 refName+="_";
1562 }
1563 if (!x.anchor().isEmpty())
1564 {
1565 refName+=x.anchor();
1566 }
1567
1568 m_t << "{\\field "
1569 "{\\*\\fldinst "
1570 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1571 "}{}"
1572 "}"
1573 "{\\fldrslt "
1574 "{\\cs37\\ul\\cf2 ";
1575 filter(x.title());
1576 m_t << "}"
1577 "}"
1578 "}";
1579 }
1580 else
1581 {
1582 filter(x.title());
1583 }
1584 m_t << ":";
1585 m_t << "\\par";
1586 m_t << "}"; // end bold
1588 m_t << rtf_Style_Reset << getStyle("DescContinue");
1590 visitChildren(x);
1591 if (x.title().isEmpty()) return;
1592 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1593 m_t << "\\par\n";
1595 m_t << "}\n"; // end xref item
1597}
QCString anchor() const
Definition docnode.h:596
QCString file() const
Definition docnode.h:595
QCString title() const
Definition docnode.h:597

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

1678{
1679 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1680 {
1681 QCString refName;
1682 if (!file.isEmpty())
1683 {
1684 refName+=stripPath(file);
1685 }
1686 if (!file.isEmpty() && !anchor.isEmpty())
1687 {
1688 refName+='_';
1689 }
1690 if (!anchor.isEmpty())
1691 {
1692 refName+=anchor;
1693 }
1694
1695 m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1696 m_t << rtfFormatBmkStr(refName);
1697 m_t << "\" }{}";
1698 m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1699 }
1700 else
1701 {
1702 m_t << "{\\b ";
1703 }
1705}

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

1748{
1749 QCString baseName=makeBaseName(df.file());
1750 QCString outDir = Config_getString(RTF_OUTPUT);
1751 writeDiaGraphFromFile(df.file(),outDir,baseName,DIA_BITMAP,df.srcFile(),df.srcLine());
1752 includePicturePreRTF(baseName + ".png", true, df.hasCaption());
1753}
QCString srcFile() const
Definition docnode.h:662
int srcLine() const
Definition docnode.h:663
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition dia.cpp:26
@ DIA_BITMAP
Definition dia.h:23
static QCString makeBaseName(const QCString &name)

References Config_getString, DIA_BITMAP, 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 1724 of file rtfdocvisitor.cpp.

1726{
1727 QCString baseName=makeBaseName(filename);
1728 QCString outDir = Config_getString(RTF_OUTPUT);
1729 writeDotGraphFromFile(filename,outDir,baseName,GOF_BITMAP,srcFile,srcLine);
1730 QCString imgExt = getDotImageExtension();
1731 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1732}
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition dot.cpp:230
@ GOF_BITMAP
Definition dotgraph.h:29
QCString getDotImageExtension()
Definition util.cpp:6639

References Config_getString, getDotImageExtension(), GOF_BITMAP, 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 1738 of file rtfdocvisitor.cpp.

1740{
1741 QCString baseName=makeBaseName(fileName);
1742 QCString outDir = Config_getString(RTF_OUTPUT);
1743 writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP,srcFile,srcLine);
1744 includePicturePreRTF(baseName + ".png", true, hasCaption);
1745}
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition msc.cpp:156
@ MSC_BITMAP
Definition msc.h:22

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

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

◆ writePlantUMLFile()

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

Definition at line 1755 of file rtfdocvisitor.cpp.

1756{
1757 QCString baseName=makeBaseName(fileName);
1758 QCString outDir = Config_getString(RTF_OUTPUT);
1760 includePicturePreRTF(baseName + ".png", true, hasCaption);
1761}
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition plantuml.cpp:126

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

Referenced by operator()().

Member Data Documentation

◆ m_ci

OutputCodeList& RTFDocVisitor::m_ci
private

Definition at line 142 of file rtfdocvisitor.h.

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

◆ m_hide

◆ m_hierarchyLevel

int RTFDocVisitor::m_hierarchyLevel = 0
private

Definition at line 150 of file rtfdocvisitor.h.

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

◆ m_indentLevel

int RTFDocVisitor::m_indentLevel = 0
private

Definition at line 149 of file rtfdocvisitor.h.

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

◆ m_insidePre

bool RTFDocVisitor::m_insidePre = false
private

Definition at line 143 of file rtfdocvisitor.h.

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

◆ m_langExt

QCString RTFDocVisitor::m_langExt
private

Definition at line 146 of file rtfdocvisitor.h.

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

◆ m_lastIsPara

◆ m_listItemInfo

RTFListItemInfo RTFDocVisitor::m_listItemInfo[maxIndentLevels]
private

Definition at line 158 of file rtfdocvisitor.h.

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

◆ m_t

◆ maxIndentLevels

const int RTFDocVisitor::maxIndentLevels = 13
staticprivate

Definition at line 148 of file rtfdocvisitor.h.

Referenced by incIndentLevel(), and indentLevel().


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