40 #define DBG_RTF(x) do {} while(0) 46 for (i=0; i<attrs.
count(); ++i)
63 m_hide(
FALSE), m_indentLevel(0), m_lastIsPara(
FALSE), m_langExt(langExt)
93 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocWord)}\n");
101 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
111 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
126 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
142 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocURL)}\n");
172 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
180 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
181 m_t <<
"{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" <<
endl;
189 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
237 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
276 static int dotindex = 1;
287 err(
"Could not open file %s for writing\n",fileName.
data());
291 m_t <<
"\\par{\\qc ";
299 static int mscindex = 1;
310 err(
"Could not open file %s for writing\n",baseName.
data());
317 m_t <<
"\\par{\\qc ";
328 m_t <<
"\\par{\\qc ";
340 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
363 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocInclude)}\n");
372 FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
430 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
476 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocFormula)}\n");
484 DBG_RTF(
"{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
496 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocCite)}\n");
524 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocAutoList)}\n");
534 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocAutoList)}\n");
543 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocAutoListItem)}\n");
563 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocAutoListItem)}\n");
568 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
574 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
590 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocRoot)}\n");
598 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocRoot)}\n");
608 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
665 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
674 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocTitle)}\n");
680 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocTitle)}\n");
691 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
700 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
709 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSimpleListItem)}\n");
718 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
724 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSection)}\n");
732 heading.
sprintf(
"Heading%d",level);
737 m_t << endl <<
"\\par" <<
"}" <<
endl;
738 m_t <<
"{\\tc\\tcl" << level <<
" \\v ";
747 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSection)}\n");
755 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlList)}\n");
765 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlList)}\n");
773 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlListItem)}\n");
793 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
799 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlDescList)}\n");
808 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlDescList)}\n");
817 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlDescTitle)}\n");
827 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlDescTitle)}\n");
836 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlDescData)}\n");
844 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlDescData)}\n");
854 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlTable)}\n");
862 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n");
863 m_t <<
"\\pard\\plain" <<
endl;
870 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlCaption)}\n");
875 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n");
881 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n");
883 m_t <<
"\\trowd \\trgaph108\\trleft-108" 884 "\\trbrdrt\\brdrs\\brdrw10 " 885 "\\trbrdrl\\brdrs\\brdrw10 " 886 "\\trbrdrb\\brdrs\\brdrw10 " 887 "\\trbrdrr\\brdrs\\brdrw10 " 888 "\\trbrdrh\\brdrs\\brdrw10 " 889 "\\trbrdrv\\brdrs\\brdrw10 "<<
endl;
894 m_t <<
"\\clcbpat16";
896 m_t <<
"\\clvertalt\\clbrdrt\\brdrs\\brdrw10 " 897 "\\clbrdrl\\brdrs\\brdrw10 " 898 "\\clbrdrb\\brdrs\\brdrw10 " 899 "\\clbrdrr \\brdrs\\brdrw10 " 901 "\\cellx" << ((i+1)*columnWidth) <<
endl;
903 m_t <<
"\\pard \\widctlpar\\intbl\\adjustright" <<
endl;
910 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlRow)}\n");
912 m_t <<
"\\pard \\widctlpar\\intbl\\adjustright" <<
endl;
920 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlCell)}\n");
928 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlCell)}\n");
960 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHRef)}\n");
965 "{ HYPERLINK \"" << href->
url() <<
"\" " 982 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHRef)}\n");
999 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlHeader)}\n");
1004 heading.
sprintf(
"Heading%d",level);
1008 m_t <<
"{\\tc\\tcl \\v " << level <<
"}";
1016 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n");
1024 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocImage)}\n");
1030 m_t <<
"\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1032 m_t <<
"\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" <<
endl;
1046 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocImage)}\n");
1052 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocDotFile)}\n");
1062 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocDotFile)}\n");
1067 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocMscFile)}\n");
1077 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocMscFile)}\n");
1083 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocDiaFile)}\n");
1093 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocDiaFile)}\n");
1100 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocLink)}\n");
1107 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocLink)}\n");
1114 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocRef)}\n");
1131 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocRef)}\n");
1139 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSecRefItem)}\n");
1144 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSecRefItem)}\n");
1150 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocSecRefList)}\n");
1161 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n");
1192 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocParamSect)}\n");
1209 m_t <<
"Template Parameters";
break;
1231 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocParamSect)}\n");
1246 static int columnPos[4][5] =
1247 { { 2, 25, 100, 100, 100 },
1248 { 3, 14, 35, 100, 100 },
1249 { 3, 25, 50, 100, 100 },
1250 { 4, 14, 35, 55, 100 },
1254 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocParamList)}\n");
1272 m_t <<
"\\trowd \\trgaph108\\trleft426\\tblind426" 1273 "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 " 1274 "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 " 1275 "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 " 1276 "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 " 1277 "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 " 1278 "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<<
endl;
1279 for (i=0;i<columnPos[
config][0];i++)
1281 m_t <<
"\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 " 1282 "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 " 1283 "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 " 1284 "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 " 1288 m_t <<
"\\pard \\widctlpar\\intbl\\adjustright" <<
endl;
1330 for (li.toFirst();(type=li.
current());++li)
1332 if (!first)
m_t <<
" | ";
else first=
FALSE;
1360 for (li.toFirst();(param=li.
current());++li)
1362 if (!first)
m_t <<
",";
else first=
FALSE;
1384 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocParamList)}\n");
1415 bool anonymousEnum = x->
file()==
"@";
1416 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n");
1443 "{ HYPERLINK \\\\l \"" << refName <<
"\" " 1447 "{\\cs37\\ul\\cf2 ";
1469 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1479 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocInternalRef)}\n");
1486 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocInternalRef)}\n");
1494 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocCopy)}\n");
1500 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocCopy)}\n");
1506 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocText)}\n");
1512 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocText)}\n");
1518 DBG_RTF(
"{\\comment RTFDocVisitor::visitPre(DocHtmlBlockQuote)}\n");
1528 DBG_RTF(
"{\\comment RTFDocVisitor::visitPost(DocHtmlBlockQuote)}\n");
1567 const unsigned char *
p=(
const unsigned char *)str;
1590 case '{':
m_t <<
"\\{";
break;
1591 case '}':
m_t <<
"\\}";
break;
1592 case '\\':
m_t <<
"\\\\";
break;
1593 case '\n':
if (verbatim)
1602 default:
m_t << (char)c;
1618 if (!file.
isEmpty() && anchor)
1627 m_t <<
"{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1630 m_t <<
"}{\\fldrslt {\\cs37\\ul\\cf2 ";
1669 if ((i=baseName.
findRev(
'/'))!=-1)
1678 m_t <<
"\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1680 m_t << baseName <<
"." << imgExt;
1681 m_t <<
"\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" <<
endl;
1690 if ((i=baseName.
findRev(
'/'))!=-1)
1699 m_t <<
"\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1700 m_t << baseName <<
".png";
1701 m_t <<
"\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" <<
endl;
1710 if ((i=baseName.
findRev(
'/'))!=-1)
1719 m_t <<
"\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1720 m_t << baseName <<
".png";
1721 m_t <<
"\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" <<
endl;
1730 if ((i=baseName.
findRev(
'/'))!=-1)
1739 m_t <<
"\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1740 m_t << baseName <<
".png";
1741 m_t <<
"\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" <<
endl;
QCString exampleFile() const
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
const HtmlAttribList & attribs() const
ParserInterface * getParser(const char *extension)
void filter(const char *str, bool verbatim=FALSE)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
void writeMscGraphFromFile(const char *inFile, const char *outDir, const char *outFile, MscOutputFormat format)
virtual QCString trAttention()=0
static TemplateVariant parseCode(MemberDef *md, const QCString &scopeName, const QCString &relPath, const QCString &code, int startLine=-1, int endLine=-1, bool showLineNumbers=FALSE)
virtual QCString trInvariant()=0
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
QDict< StyleData > rtf_Style
virtual QCString trPostcondition()=0
CodeOutputInterface & m_ci
virtual QCString trWarning()=0
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content)
virtual QCString trCopyright()=0
const QList< DocNode > & paramTypes()
static HtmlEntityMapper * instance()
Simplified and optimized version of QTextStream.
virtual Kind kind() const =0
void writePlantUMLFile(const QCString &fileName)
QCString getStyle(const char *name)
int findRev(char c, int index=-1, bool cs=TRUE) const
virtual QCString trReturns()=0
virtual QCString trDate()=0
virtual QCString trNote()=0
QCString exampleFile() const
QCString extractBlock(const QCString text, const QCString marker)
Abstract visitor that participates in the visitor pattern.
virtual QCString trExceptions()=0
static ParserManager * parserManager
QCString targetTitle() const
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
void writeDiaFile(const QCString &fileName)
int writeBlock(const char *data, uint len)
virtual QCString trParameters()=0
void writeMscFile(const QCString &fileName)
QCString right(uint len) const
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trReturnValues()=0
void writeDotGraphFromFile(const char *inFile, const char *outDir, const char *outFile, GraphOutputFormat format)
A bunch of utility functions.
const char * data() const
#define Config_getString(val)
virtual QCString trVersion()=0
#define Config_getBool(val)
QCString getDotImageExtension(void)
void generatePlantUMLOutput(const char *baseName, const char *outDir, PlantUMLOutputFormat format)
const char * rtf(DocSymbol::SymType symb) const
Access routine to the RTF code of the HTML entity.
void err(const char *fmt,...)
QCString language() const
The QFile class is an I/O device that operates on files.
QCString & sprintf(const char *format,...)
DocParamSect::Direction direction() const
bool hasInOutSpecifier() const
void visitPre(DocAutoList *)
const QList< DocNode > & parameters()
void writeDiaGraphFromFile(const char *inFile, const char *outDir, const char *outFile, DiaOutputFormat format)
RTFDocVisitor(FTextStream &t, CodeOutputInterface &ci, const char *langExt)
SrcLangExt getLanguageFromFileName(const QCString fileName)
bool hasTypeSpecifier() const
Translator * theTranslator
QCString exampleFile() const
virtual QCString trRemarks()=0
virtual QCString trSeeAlso()=0
static QCString align(DocHtmlCell *cell)
QCString extension() const
The QFileInfo class provides system-independent file information.
A list of Html attributes.
void writeDotFile(const QCString &fileName)
virtual void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)=0
void endLink(const QCString &ref)
QCString rtfFormatBmkStr(const char *name)
void visitPost(DocAutoList *)
QTextStream & endl(QTextStream &s)
const int rtf_maxIndentLevels