Public Member Functions | Private Member Functions | Private Attributes | List of all members
RTFDocVisitor Class Reference

Concrete visitor implementation for RTF output. More...

#include <rtfdocvisitor.h>

Inheritance diagram for RTFDocVisitor:
DocVisitor

Public Member Functions

 RTFDocVisitor (FTextStream &t, CodeOutputInterface &ci, const char *langExt)
 
void visit (DocWord *)
 
void visit (DocLinkedWord *)
 
void visit (DocWhiteSpace *)
 
void visit (DocSymbol *)
 
void visit (DocURL *)
 
void visit (DocLineBreak *)
 
void visit (DocHorRuler *)
 
void visit (DocStyleChange *)
 
void visit (DocVerbatim *)
 
void visit (DocAnchor *)
 
void visit (DocInclude *)
 
void visit (DocIncOperator *)
 
void visit (DocFormula *)
 
void visit (DocIndexEntry *)
 
void visit (DocSimpleSectSep *)
 
void visit (DocCite *)
 
void visitPre (DocAutoList *)
 
void visitPost (DocAutoList *)
 
void visitPre (DocAutoListItem *)
 
void visitPost (DocAutoListItem *)
 
void visitPre (DocPara *)
 
void visitPost (DocPara *)
 
void visitPre (DocRoot *)
 
void visitPost (DocRoot *)
 
void visitPre (DocSimpleSect *)
 
void visitPost (DocSimpleSect *)
 
void visitPre (DocTitle *)
 
void visitPost (DocTitle *)
 
void visitPre (DocSimpleList *)
 
void visitPost (DocSimpleList *)
 
void visitPre (DocSimpleListItem *)
 
void visitPost (DocSimpleListItem *)
 
void visitPre (DocSection *s)
 
void visitPost (DocSection *)
 
void visitPre (DocHtmlList *s)
 
void visitPost (DocHtmlList *s)
 
void visitPre (DocHtmlListItem *)
 
void visitPost (DocHtmlListItem *)
 
void visitPre (DocHtmlDescList *)
 
void visitPost (DocHtmlDescList *)
 
void visitPre (DocHtmlDescTitle *)
 
void visitPost (DocHtmlDescTitle *)
 
void visitPre (DocHtmlDescData *)
 
void visitPost (DocHtmlDescData *)
 
void visitPre (DocHtmlTable *t)
 
void visitPost (DocHtmlTable *t)
 
void visitPre (DocHtmlCaption *)
 
void visitPost (DocHtmlCaption *)
 
void visitPre (DocHtmlRow *)
 
void visitPost (DocHtmlRow *)
 
void visitPre (DocHtmlCell *)
 
void visitPost (DocHtmlCell *)
 
void visitPre (DocInternal *)
 
void visitPost (DocInternal *)
 
void visitPre (DocHRef *)
 
void visitPost (DocHRef *)
 
void visitPre (DocHtmlHeader *)
 
void visitPost (DocHtmlHeader *)
 
void visitPre (DocImage *)
 
void visitPost (DocImage *)
 
void visitPre (DocDotFile *)
 
void visitPost (DocDotFile *)
 
void visitPre (DocMscFile *)
 
void visitPost (DocMscFile *)
 
void visitPre (DocDiaFile *)
 
void visitPost (DocDiaFile *)
 
void visitPre (DocLink *)
 
void visitPost (DocLink *)
 
void visitPre (DocRef *ref)
 
void visitPost (DocRef *)
 
void visitPre (DocSecRefItem *)
 
void visitPost (DocSecRefItem *)
 
void visitPre (DocSecRefList *)
 
void visitPost (DocSecRefList *)
 
void visitPre (DocParamSect *)
 
void visitPost (DocParamSect *)
 
void visitPre (DocParamList *)
 
void visitPost (DocParamList *)
 
void visitPre (DocXRefItem *)
 
void visitPost (DocXRefItem *)
 
void visitPre (DocInternalRef *)
 
void visitPost (DocInternalRef *)
 
void visitPre (DocCopy *)
 
void visitPost (DocCopy *)
 
void visitPre (DocText *)
 
void visitPost (DocText *)
 
void visitPre (DocHtmlBlockQuote *)
 
void visitPost (DocHtmlBlockQuote *)
 
void visitPre (DocVhdlFlow *)
 
void visitPost (DocVhdlFlow *)
 
void visitPre (DocParBlock *)
 
void visitPost (DocParBlock *)
 
- Public Member Functions inherited from DocVisitor
 DocVisitor (int id)
 
virtual ~DocVisitor ()
 
int id () const
 

Private Member Functions

void filter (const char *str, bool verbatim=FALSE)
 
void startLink (const QCString &ref, const QCString &file, const QCString &anchor)
 
void endLink (const QCString &ref)
 
QCString getStyle (const char *name)
 
void incIndentLevel ()
 
void decIndentLevel ()
 
void pushEnabled ()
 
void popEnabled ()
 
void writeDotFile (const QCString &fileName)
 
void writeMscFile (const QCString &fileName)
 
void writeDiaFile (const QCString &fileName)
 
void writePlantUMLFile (const QCString &fileName)
 

Private Attributes

FTextStreamm_t
 
CodeOutputInterfacem_ci
 
bool m_insidePre
 
bool m_hide
 
int m_indentLevel
 
QStack< boolm_enabled
 
bool m_lastIsPara
 
QCString m_langExt
 

Detailed Description

Concrete visitor implementation for RTF output.

Definition at line 30 of file rtfdocvisitor.h.

Constructor & Destructor Documentation

RTFDocVisitor::RTFDocVisitor ( FTextStream t,
CodeOutputInterface ci,
const char *  langExt 
)

Definition at line 60 of file rtfdocvisitor.cpp.

64 {
65 }
const int DocVisitor_RTF
Definition: docvisitor.h:26
CodeOutputInterface & m_ci
const bool FALSE
Definition: qglobal.h:370
QCString m_langExt
FTextStream & m_t
DocVisitor(int id)
Definition: docvisitor.h:94

Member Function Documentation

void RTFDocVisitor::decIndentLevel ( )
private

Definition at line 81 of file rtfdocvisitor.cpp.

82 {
84 }
void RTFDocVisitor::endLink ( const QCString ref)
private

Definition at line 1639 of file rtfdocvisitor.cpp.

1640 {
1641  if (ref.isEmpty() && Config_getBool("RTF_HYPERLINKS"))
1642  {
1643  m_t << "}}}";
1644  }
1645  else
1646  {
1647  m_t << "}";
1648  }
1650 }
bool isEmpty() const
Definition: qcstring.h:189
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define Config_getBool(val)
Definition: config.cpp:664
void RTFDocVisitor::filter ( const char *  str,
bool  verbatim = FALSE 
)
private

Definition at line 1563 of file rtfdocvisitor.cpp.

1564 {
1565  if (str)
1566  {
1567  const unsigned char *p=(const unsigned char *)str;
1568  unsigned char c;
1569  //unsigned char pc='\0';
1570  while (*p)
1571  {
1572  //static bool MultiByte = FALSE;
1573  c=*p++;
1574 
1575  //if ( MultiByte )
1576  //{
1577  // m_t << getMultiByte( c );
1578  // MultiByte = FALSE;
1579  // continue;
1580  //}
1581  //if ( c >= 0x80 )
1582  //{
1583  // MultiByte = TRUE;
1584  // m_t << getMultiByte( c );
1585  // continue;
1586  //}
1587 
1588  switch (c)
1589  {
1590  case '{': m_t << "\\{"; break;
1591  case '}': m_t << "\\}"; break;
1592  case '\\': m_t << "\\\\"; break;
1593  case '\n': if (verbatim)
1594  {
1595  m_t << "\\par" << endl;
1596  }
1597  else
1598  {
1599  m_t << '\n';
1600  }
1601  break;
1602  default: m_t << (char)c;
1603  }
1604  //pc = c;
1605  }
1606  }
1607 }
p
Definition: test.py:223
FTextStream & m_t
static QCString str
QTextStream & endl(QTextStream &s)
QCString RTFDocVisitor::getStyle ( const char *  name)
private

Definition at line 67 of file rtfdocvisitor.cpp.

68 {
69  QCString n;
70  n.sprintf("%s%d",name,m_indentLevel);
71  StyleData *sd = rtf_Style[n];
72  ASSERT(sd!=0);
73  return sd->reference;
74 }
static QCString name
Definition: declinfo.cpp:673
QDict< StyleData > rtf_Style
std::void_t< T > n
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
char * reference
Definition: rtfstyle.h:67
#define ASSERT(x)
Definition: qglobal.h:590
void RTFDocVisitor::incIndentLevel ( )
private

Definition at line 76 of file rtfdocvisitor.cpp.

77 {
79 }
const int rtf_maxIndentLevels
Definition: rtfstyle.h:45
void RTFDocVisitor::popEnabled ( )
private

Definition at line 1657 of file rtfdocvisitor.cpp.

1658 {
1659  bool *v=m_enabled.pop();
1660  ASSERT(v!=0);
1661  m_hide = *v;
1662  delete v;
1663 }
type * pop()
Definition: qstack.h:59
QStack< bool > m_enabled
#define ASSERT(x)
Definition: qglobal.h:590
void RTFDocVisitor::pushEnabled ( )
private

Definition at line 1652 of file rtfdocvisitor.cpp.

1653 {
1654  m_enabled.push(new bool(m_hide));
1655 }
void push(const type *d)
Definition: qstack.h:58
QStack< bool > m_enabled
void RTFDocVisitor::startLink ( const QCString ref,
const QCString file,
const QCString anchor 
)
private

Definition at line 1609 of file rtfdocvisitor.cpp.

1610 {
1611  if (ref.isEmpty() && Config_getBool("RTF_HYPERLINKS"))
1612  {
1613  QCString refName;
1614  if (!file.isEmpty())
1615  {
1616  refName+=file;
1617  }
1618  if (!file.isEmpty() && anchor)
1619  {
1620  refName+='_';
1621  }
1622  if (anchor)
1623  {
1624  refName+=anchor;
1625  }
1626 
1627  m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1628  m_t << rtfFormatBmkStr(refName);
1629  m_t << "\" }{}";
1630  m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1631  }
1632  else
1633  {
1634  m_t << "{\\b ";
1635  }
1637 }
bool isEmpty() const
Definition: qcstring.h:189
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define Config_getBool(val)
Definition: config.cpp:664
QCString rtfFormatBmkStr(const char *name)
Definition: util.cpp:6744
void RTFDocVisitor::visit ( DocWord w)
virtual

Implements DocVisitor.

Definition at line 90 of file rtfdocvisitor.cpp.

91 {
92  if (m_hide) return;
93  DBG_RTF("{\\comment RTFDocVisitor::visit(DocWord)}\n");
94  filter(w->word());
96 }
void filter(const char *str, bool verbatim=FALSE)
const bool FALSE
Definition: qglobal.h:370
QCString word() const
Definition: docparser.h:199
#define DBG_RTF(x)
void RTFDocVisitor::visit ( DocLinkedWord w)
virtual

Implements DocVisitor.

Definition at line 98 of file rtfdocvisitor.cpp.

99 {
100  if (m_hide) return;
101  DBG_RTF("{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
102  startLink(w->ref(),w->file(),w->anchor());
103  filter(w->word());
104  endLink(w->ref());
106 }
void filter(const char *str, bool verbatim=FALSE)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString ref() const
Definition: docparser.h:219
const bool FALSE
Definition: qglobal.h:370
QCString word() const
Definition: docparser.h:215
QCString file() const
Definition: docparser.h:217
QCString anchor() const
Definition: docparser.h:220
void endLink(const QCString &ref)
#define DBG_RTF(x)
void RTFDocVisitor::visit ( DocWhiteSpace w)
virtual

Implements DocVisitor.

Definition at line 108 of file rtfdocvisitor.cpp.

109 {
110  if (m_hide) return;
111  DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
112  if (m_insidePre)
113  {
114  m_t << w->chars();
115  }
116  else
117  {
118  m_t << " ";
119  }
121 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
QCString chars() const
Definition: docparser.h:434
#define DBG_RTF(x)
void RTFDocVisitor::visit ( DocSymbol s)
virtual

Implements DocVisitor.

Definition at line 123 of file rtfdocvisitor.cpp.

124 {
125  if (m_hide) return;
126  DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
127  const char *res = HtmlEntityMapper::instance()->rtf(s->symbol());
128  if (res)
129  {
130  m_t << res;
131  }
132  else
133  {
134  err("RTF: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
135  }
137 }
const bool FALSE
Definition: qglobal.h:370
static HtmlEntityMapper * instance()
Definition: htmlentity.cpp:341
FTextStream & m_t
const char * rtf(DocSymbol::SymType symb) const
Access routine to the RTF code of the HTML entity.
Definition: htmlentity.cpp:448
void err(const char *fmt,...)
Definition: message.cpp:226
SymType symbol() const
Definition: docparser.h:418
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
void RTFDocVisitor::visit ( DocURL u)
virtual

Implements DocVisitor.

Definition at line 139 of file rtfdocvisitor.cpp.

140 {
141  if (m_hide) return;
142  DBG_RTF("{\\comment RTFDocVisitor::visit(DocURL)}\n");
143  if (Config_getBool("RTF_HYPERLINKS"))
144  {
145  m_t << "{\\field "
146  "{\\*\\fldinst "
147  "{ HYPERLINK \"";
148  if (u->isEmail()) m_t << "mailto:";
149  m_t << u->url();
150  m_t << "\" }"
151  "{}";
152  m_t << "}"
153  "{\\fldrslt "
154  "{\\cs37\\ul\\cf2 ";
155  filter(u->url());
156  m_t << "}"
157  "}"
158  "}" << endl;
159  }
160  else
161  {
162  m_t << "{\\f2 ";
163  filter(u->url());
164  m_t << "}";
165  }
167 }
void filter(const char *str, bool verbatim=FALSE)
QCString url() const
Definition: docparser.h:239
bool isEmail() const
Definition: docparser.h:242
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define Config_getBool(val)
Definition: config.cpp:664
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocLineBreak )
virtual

Implements DocVisitor.

Definition at line 169 of file rtfdocvisitor.cpp.

170 {
171  if (m_hide) return;
172  DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
173  m_t << "\\par" << endl;
175 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocHorRuler )
virtual

Implements DocVisitor.

Definition at line 177 of file rtfdocvisitor.cpp.

178 {
179  if (m_hide) return;
180  DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
181  m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl;
183 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocStyleChange s)
virtual

Implements DocVisitor.

Definition at line 185 of file rtfdocvisitor.cpp.

186 {
187  if (m_hide) return;
189  DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
190  switch (s->style())
191  {
193  if (s->enable()) m_t << "{\\b "; else m_t << "} ";
194  break;
196  if (s->enable()) m_t << "{\\i "; else m_t << "} ";
197  break;
199  if (s->enable()) m_t << "{\\f2 "; else m_t << "} ";
200  break;
202  if (s->enable()) m_t << "{\\sub "; else m_t << "} ";
203  break;
205  if (s->enable()) m_t << "{\\super "; else m_t << "} ";
206  break;
208  if (s->enable()) m_t << "{\\qc "; else m_t << "} ";
209  break;
211  if (s->enable()) m_t << "{\\sub "; else m_t << "} ";
212  break;
214  if (s->enable())
215  {
216  m_t << "{" << endl;
217  m_t << "\\par" << endl;
218  m_t << rtf_Style_Reset << getStyle("CodeExample");
220  }
221  else
222  {
224  m_t << "\\par";
225  m_t << "}" << endl;
226  }
228  break;
229  case DocStyleChange::Div: /* HTML only */ break;
230  case DocStyleChange::Span: /* HTML only */ break;
231  }
232 }
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
FTextStream & m_t
Style style() const
Definition: docparser.h:329
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
bool enable() const
Definition: docparser.h:331
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocVerbatim s)
virtual

Implements DocVisitor.

Definition at line 234 of file rtfdocvisitor.cpp.

235 {
236  if (m_hide) return;
237  DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
238  QCString lang = m_langExt;
239  if (!s->language().isEmpty()) // explicit language setting
240  {
241  lang = s->language();
242  }
243  SrcLangExt langExt = getLanguageFromFileName(lang);
244  switch(s->type())
245  {
246  case DocVerbatim::Code: // fall though
247  m_t << "{" << endl;
248  m_t << "\\par" << endl;
249  m_t << rtf_Style_Reset << getStyle("CodeExample");
251  ->parseCode(m_ci,s->context(),s->text(),langExt,
252  s->isExample(),s->exampleFile());
253  //m_t << "\\par" << endl;
254  m_t << "}" << endl;
255  break;
256  case DocVerbatim::Verbatim:
257  m_t << "{" << endl;
258  m_t << "\\par" << endl;
259  m_t << rtf_Style_Reset << getStyle("CodeExample");
260  filter(s->text(),TRUE);
261  //m_t << "\\par" << endl;
262  m_t << "}" << endl;
263  break;
264  case DocVerbatim::RtfOnly:
265  m_t << s->text();
266  break;
267  case DocVerbatim::HtmlOnly:
269  case DocVerbatim::XmlOnly:
272  /* nothing */
273  break;
274  case DocVerbatim::Dot:
275  {
276  static int dotindex = 1;
277  QCString fileName(4096);
278 
279  fileName.sprintf("%s%d%s",
280  (Config_getString("RTF_OUTPUT")+"/inline_dotgraph_").data(),
281  dotindex++,
282  ".dot"
283  );
285  if (!file.open(IO_WriteOnly))
286  {
287  err("Could not open file %s for writing\n",fileName.data());
288  }
289  file.writeBlock( s->text(), s->text().length() );
290  file.close();
291  m_t << "\\par{\\qc "; // center picture
293  m_t << "} ";
294  if (Config_getBool("DOT_CLEANUP")) file.remove();
295  }
296  break;
297  case DocVerbatim::Msc:
298  {
299  static int mscindex = 1;
300  QCString baseName(4096);
301 
302  baseName.sprintf("%s%d%s",
303  (Config_getString("RTF_OUTPUT")+"/inline_mscgraph_").data(),
304  mscindex++,
305  ".msc"
306  );
308  if (!file.open(IO_WriteOnly))
309  {
310  err("Could not open file %s for writing\n",baseName.data());
311  }
312  QCString text = "msc {";
313  text+=s->text();
314  text+="}";
315  file.writeBlock( text, text.length() );
316  file.close();
317  m_t << "\\par{\\qc "; // center picture
319  m_t << "} ";
320  if (Config_getBool("DOT_CLEANUP")) file.remove();
321  }
322  break;
324  {
325  static QCString rtfOutput = Config_getString("RTF_OUTPUT");
326  QCString baseName = writePlantUMLSource(rtfOutput,s->exampleFile(),s->text());
327 
328  m_t << "\\par{\\qc "; // center picture
329  writePlantUMLFile(baseName);
330  m_t << "} ";
331  }
332  break;
333  }
335 }
QCString exampleFile() const
Definition: docparser.h:454
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
void filter(const char *str, bool verbatim=FALSE)
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
#define IO_WriteOnly
Definition: qiodevice.h:62
CodeOutputInterface & m_ci
const bool FALSE
Definition: qglobal.h:370
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content)
Definition: plantuml.cpp:25
QCString m_langExt
void writePlantUMLFile(const QCString &fileName)
SrcLangExt
Definition: types.h:41
QCString getStyle(const char *name)
bool isExample() const
Definition: docparser.h:453
static ParserManager * parserManager
Definition: doxygen.h:141
QCString text() const
Definition: docparser.h:450
fileName
Definition: dumpTree.py:9
void writeMscFile(const QCString &fileName)
FTextStream & m_t
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
void err(const char *fmt,...)
Definition: message.cpp:226
QCString language() const
Definition: docparser.h:456
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
QCString context() const
Definition: docparser.h:451
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
static QCString baseName
Definition: scanner.cpp:10890
Type type() const
Definition: docparser.h:449
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
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocAnchor anc)
virtual

Implements DocVisitor.

Definition at line 337 of file rtfdocvisitor.cpp.

338 {
339  if (m_hide) return;
340  DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
341  QCString anchor;
342  if (!anc->file().isEmpty())
343  {
344  anchor+=anc->file();
345  }
346  if (!anc->file().isEmpty() && !anc->anchor().isEmpty())
347  {
348  anchor+="_";
349  }
350  if (!anc->anchor().isEmpty())
351  {
352  anchor+=anc->anchor();
353  }
354  m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl;
355  m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl;
357 }
QCString anchor() const
Definition: docparser.h:277
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:278
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define DBG_RTF(x)
QCString rtfFormatBmkStr(const char *name)
Definition: util.cpp:6744
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocInclude inc)
virtual

Implements DocVisitor.

Definition at line 359 of file rtfdocvisitor.cpp.

360 {
361  if (m_hide) return;
362  SrcLangExt langExt = getLanguageFromFileName(inc->extension());
363  DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
364  switch(inc->type())
365  {
367  {
368  m_t << "{" << endl;
369  m_t << "\\par" << endl;
370  m_t << rtf_Style_Reset << getStyle("CodeExample");
371  QFileInfo cfi( inc->file() );
372  FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
374  ->parseCode(m_ci,inc->context(),
375  inc->text(),
376  langExt,
377  inc->isExample(),
378  inc->exampleFile(), &fd);
379  m_t << "\\par";
380  m_t << "}" << endl;
381  }
382  break;
383  case DocInclude::Include:
384  m_t << "{" << endl;
385  m_t << "\\par" << endl;
386  m_t << rtf_Style_Reset << getStyle("CodeExample");
388  ->parseCode(m_ci,inc->context(),
389  inc->text(),langExt,inc->isExample(),
390  inc->exampleFile());
391  m_t << "\\par";
392  m_t << "}" << endl;
393  break;
395  break;
397  break;
399  break;
401  m_t << "{" << endl;
402  m_t << "\\par" << endl;
403  m_t << rtf_Style_Reset << getStyle("CodeExample");
404  filter(inc->text());
405  m_t << "\\par";
406  m_t << "}" << endl;
407  break;
408  case DocInclude::Snippet:
409  m_t << "{" << endl;
410  if (!m_lastIsPara) m_t << "\\par" << endl;
411  m_t << rtf_Style_Reset << getStyle("CodeExample");
413  ->parseCode(m_ci,
414  inc->context(),
415  extractBlock(inc->text(),inc->blockId()),
416  langExt,
417  inc->isExample(),
418  inc->exampleFile()
419  );
420  m_t << "}";
421  break;
422  }
424 }
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
void filter(const char *str, bool verbatim=FALSE)
static TemplateVariant parseCode(MemberDef *md, const QCString &scopeName, const QCString &relPath, const QCString &code, int startLine=-1, int endLine=-1, bool showLineNumbers=FALSE)
Definition: context.cpp:1266
QCString blockId() const
Definition: docparser.h:505
QCString text() const
Definition: docparser.h:503
CodeOutputInterface & m_ci
Type type() const
Definition: docparser.h:502
SrcLangExt
Definition: types.h:41
QCString getStyle(const char *name)
QCString extractBlock(const QCString text, const QCString marker)
Definition: util.cpp:7998
static ParserManager * parserManager
Definition: doxygen.h:141
FTextStream & m_t
bool isExample() const
Definition: docparser.h:506
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
QCString file() const
Definition: docparser.h:495
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
QCString exampleFile() const
Definition: docparser.h:507
QCString context() const
Definition: docparser.h:504
QCString extension() const
Definition: docparser.h:496
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocIncOperator op)
virtual

Implements DocVisitor.

Definition at line 426 of file rtfdocvisitor.cpp.

427 {
428  //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
429  // op->type(),op->isFirst(),op->isLast(),op->text().data());
430  DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
432  if (op->isFirst())
433  {
434  if (!m_hide)
435  {
436  m_t << "{" << endl;
437  m_t << "\\par" << endl;
438  m_t << rtf_Style_Reset << getStyle("CodeExample");
439  }
440  pushEnabled();
441  m_hide = TRUE;
442  }
443  if (op->type()!=DocIncOperator::Skip)
444  {
445  popEnabled();
446  if (!m_hide)
447  {
449  ->parseCode(m_ci,op->context(),op->text(),langExt,
450  op->isExample(),op->exampleFile());
451  }
452  pushEnabled();
453  m_hide=TRUE;
454  }
455  if (op->isLast())
456  {
457  popEnabled();
458  if (!m_hide)
459  {
460  m_t << "\\par";
461  m_t << "}" << endl;
462  }
464  }
465  else
466  {
467  if (!m_hide) m_t << endl;
469  }
470 }
Type type() const
Definition: docparser.h:532
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
bool isFirst() const
Definition: docparser.h:537
CodeOutputInterface & m_ci
const bool FALSE
Definition: qglobal.h:370
QCString m_langExt
SrcLangExt
Definition: types.h:41
QCString getStyle(const char *name)
QCString exampleFile() const
Definition: docparser.h:542
static ParserManager * parserManager
Definition: doxygen.h:141
bool isExample() const
Definition: docparser.h:541
QCString context() const
Definition: docparser.h:535
FTextStream & m_t
QCString text() const
Definition: docparser.h:533
bool isLast() const
Definition: docparser.h:538
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
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
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocFormula f)
virtual

Implements DocVisitor.

Definition at line 472 of file rtfdocvisitor.cpp.

473 {
474  if (m_hide) return;
475  // TODO: do something sensible here, like including a bitmap
476  DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
477  m_t << f->text();
479 }
const bool FALSE
Definition: qglobal.h:370
QCString text() const
Definition: docparser.h:563
FTextStream & m_t
#define DBG_RTF(x)
void RTFDocVisitor::visit ( DocIndexEntry i)
virtual

Implements DocVisitor.

Definition at line 481 of file rtfdocvisitor.cpp.

482 {
483  if (m_hide) return;
484  DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
485  m_t << "{\\xe \\v " << i->entry() << "}" << endl;
487 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
QCString entry() const
Definition: docparser.h:586
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visit ( DocSimpleSectSep )
virtual

Implements DocVisitor.

Definition at line 489 of file rtfdocvisitor.cpp.

490 {
491 }
void RTFDocVisitor::visit ( DocCite cite)
virtual

Implements DocVisitor.

Definition at line 493 of file rtfdocvisitor.cpp.

494 {
495  if (m_hide) return;
496  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocCite)}\n");
497  if (!cite->file().isEmpty())
498  {
499  startLink(cite->ref(),cite->file(),cite->anchor());
500  }
501  else
502  {
503  m_t << "{\\b ";
504  }
505  filter(cite->text());
506  if (!cite->file().isEmpty())
507  {
508  endLink(cite->ref());
509  }
510  else
511  {
512  m_t << "}";
513  }
514 }
void filter(const char *str, bool verbatim=FALSE)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString text() const
Definition: docparser.h:296
bool isEmpty() const
Definition: qcstring.h:189
QCString ref() const
Definition: docparser.h:294
QCString file() const
Definition: docparser.h:292
FTextStream & m_t
QCString anchor() const
Definition: docparser.h:295
void endLink(const QCString &ref)
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocAutoList )
virtual

Implements DocVisitor.

Definition at line 531 of file rtfdocvisitor.cpp.

532 {
533  if (m_hide) return;
534  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoList)}\n");
535  m_t << "\\par";
536  m_t << "}" << endl;
538 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 560 of file rtfdocvisitor.cpp.

561 {
562  decIndentLevel();
563  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoListItem)}\n");
564 }
void decIndentLevel()
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocPara p)
virtual

Implements DocVisitor.

Definition at line 571 of file rtfdocvisitor.cpp.

572 {
573  if (m_hide) return;
574  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
575  if (!m_lastIsPara &&
576  !p->isLast() && // omit <p> for last paragraph
577  !(p->parent() && // and for parameters & sections
579  )
580  )
581  {
582  m_t << "\\par" << endl;
584  }
585 }
DocNode * parent() const
Definition: docparser.h:147
virtual Kind kind() const =0
FTextStream & m_t
bool isLast() const
Definition: docparser.h:1125
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocRoot r)
virtual

Implements DocVisitor.

Definition at line 595 of file rtfdocvisitor.cpp.

596 {
597  if (m_hide) return;
598  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRoot)}\n");
599  if (!m_lastIsPara && !r->singleLine()) m_t << "\\par" << endl;
600  m_t << "}";
602  if (r->indent()) decIndentLevel();
603 }
bool singleLine() const
Definition: docparser.h:1408
FTextStream & m_t
bool indent() const
Definition: docparser.h:1407
void decIndentLevel()
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocSimpleSect )
virtual

Implements DocVisitor.

Definition at line 662 of file rtfdocvisitor.cpp.

663 {
664  if (m_hide) return;
665  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
666  if (!m_lastIsPara) m_t << "\\par" << endl;
667  decIndentLevel();
668  m_t << "}"; // end desc
670 }
FTextStream & m_t
void decIndentLevel()
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 677 of file rtfdocvisitor.cpp.

678 {
679  if (m_hide) return;
680  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocTitle)}\n");
681  m_t << "\\par" << endl;
682  m_t << "}"; // end bold
683  incIndentLevel();
684  m_t << rtf_Style_Reset << getStyle("DescContinue");
686 }
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
void incIndentLevel()
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 697 of file rtfdocvisitor.cpp.

698 {
699  if (m_hide) return;
700  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
701  if (!m_lastIsPara) m_t << "\\par" << endl;
702  m_t << "}" << endl;
704 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 715 of file rtfdocvisitor.cpp.

716 {
717  decIndentLevel();
718  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
719 }
void decIndentLevel()
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocSection )
virtual

Implements DocVisitor.

Definition at line 744 of file rtfdocvisitor.cpp.

745 {
746  if (m_hide) return;
747  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSection)}\n");
748  m_t << "\\par}" << endl; // end section
750 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 762 of file rtfdocvisitor.cpp.

763 {
764  if (m_hide) return;
765  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlList)}\n");
766  m_t << "\\par" << "}" << endl;
768 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 790 of file rtfdocvisitor.cpp.

791 {
792  decIndentLevel();
793  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
794 }
void decIndentLevel()
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocHtmlDescList )
virtual

Implements DocVisitor.

Definition at line 805 of file rtfdocvisitor.cpp.

806 {
807  if (m_hide) return;
808  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescList)}\n");
809  //m_t << "}" << endl;
810  //m_t << "\\par" << endl;
811  //m_lastIsPara=TRUE;
812 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 824 of file rtfdocvisitor.cpp.

825 {
826  if (m_hide) return;
827  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescTitle)}\n");
828  m_t << "\\par" << endl;
829  m_t << "}" << endl;
831 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 841 of file rtfdocvisitor.cpp.

842 {
843  if (m_hide) return;
844  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescData)}\n");
845  m_t << "\\par";
846  m_t << "}" << endl;
847  decIndentLevel();
849 }
FTextStream & m_t
void decIndentLevel()
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 859 of file rtfdocvisitor.cpp.

860 {
861  if (m_hide) return;
862  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n");
863  m_t << "\\pard\\plain" << endl;
864  m_t << "\\par" << endl;
866 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlCaption )
virtual

Implements DocVisitor.

Definition at line 873 of file rtfdocvisitor.cpp.

874 {
875  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n");
876 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocHtmlRow )
virtual

Implements DocVisitor.

Definition at line 907 of file rtfdocvisitor.cpp.

908 {
909  if (m_hide) return;
910  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlRow)}\n");
911  m_t << endl;
912  m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
913  m_t << "{\\row }" << endl;
915 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocHtmlCell )
virtual

Implements DocVisitor.

Definition at line 925 of file rtfdocvisitor.cpp.

926 {
927  if (m_hide) return;
928  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCell)}\n");
929  m_t << "\\cell }";
931 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 947 of file rtfdocvisitor.cpp.

948 {
949  if (m_hide) return;
950  //DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternal)}\n");
951  //m_t << "\\par";
952  //decIndentLevel();
953  //m_t << "}"; // end desc
954  //m_lastIsPara=TRUE;
955 }
void RTFDocVisitor::visitPost ( DocHRef )
virtual

Implements DocVisitor.

Definition at line 979 of file rtfdocvisitor.cpp.

980 {
981  if (m_hide) return;
982  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHRef)}\n");
983  if (Config_getBool("RTF_HYPERLINKS"))
984  {
985  m_t << "}"
986  "}"
987  "}";
988  }
989  else
990  {
991  m_t << "}";
992  }
994 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define Config_getBool(val)
Definition: config.cpp:664
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocHtmlHeader )
virtual

Implements DocVisitor.

Definition at line 1013 of file rtfdocvisitor.cpp.

1014 {
1015  if (m_hide) return;
1016  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n");
1017  m_t << "\\par";
1018  m_t << "}" << endl; // end section
1020 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocImage )
virtual

Implements DocVisitor.

Definition at line 1044 of file rtfdocvisitor.cpp.

1045 {
1046  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocImage)}\n");
1047  popEnabled();
1048 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocDotFile )
virtual

Implements DocVisitor.

Definition at line 1060 of file rtfdocvisitor.cpp.

1061 {
1062  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDotFile)}\n");
1063  popEnabled();
1064 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocMscFile )
virtual

Implements DocVisitor.

Definition at line 1075 of file rtfdocvisitor.cpp.

1076 {
1077  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocMscFile)}\n");
1078  popEnabled();
1079 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocDiaFile )
virtual

Implements DocVisitor.

Definition at line 1091 of file rtfdocvisitor.cpp.

1092 {
1093  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDiaFile)}\n");
1094  popEnabled();
1095 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 1104 of file rtfdocvisitor.cpp.

1105 {
1106  if (m_hide) return;
1107  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLink)}\n");
1108  endLink(lnk->ref());
1109 }
void endLink(const QCString &ref)
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1128 of file rtfdocvisitor.cpp.

1129 {
1130  if (m_hide) return;
1131  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRef)}\n");
1132  if (!ref->file().isEmpty()) endLink(ref->ref());
1133  //m_t << " ";
1134 }
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:827
QCString ref() const
Definition: docparser.h:829
void endLink(const QCString &ref)
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocSecRefItem )
virtual

Implements DocVisitor.

Definition at line 1142 of file rtfdocvisitor.cpp.

1143 {
1144  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefItem)}\n");
1145 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 1158 of file rtfdocvisitor.cpp.

1159 {
1160  if (m_hide) return;
1161  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n");
1162  decIndentLevel();
1163  m_t << "\\par";
1164  m_t << "}" << endl;
1166 }
FTextStream & m_t
void decIndentLevel()
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1228 of file rtfdocvisitor.cpp.

1229 {
1230  if (m_hide) return;
1231  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamSect)}\n");
1232  //m_t << "\\par" << endl;
1233  bool useTable = s->type()==DocParamSect::Param ||
1234  s->type()==DocParamSect::RetVal ||
1235  s->type()==DocParamSect::Exception ||
1237  if (!useTable)
1238  {
1239  decIndentLevel();
1240  }
1241  m_t << "}" << endl;
1242 }
Type type() const
Definition: docparser.h:1101
FTextStream & m_t
void decIndentLevel()
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 1381 of file rtfdocvisitor.cpp.

1382 {
1383  if (m_hide) return;
1384  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamList)}\n");
1385 
1387  //DocParamSect *sect = 0;
1388  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1389  {
1390  parentType = ((DocParamSect*)pl->parent())->type();
1391  //sect=(DocParamSect*)pl->parent();
1392  }
1393  bool useTable = parentType==DocParamSect::Param ||
1394  parentType==DocParamSect::RetVal ||
1395  parentType==DocParamSect::Exception ||
1396  parentType==DocParamSect::TemplateParam;
1397  if (useTable)
1398  {
1399  m_t << "\\cell }" << endl;
1400  //m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
1401  m_t << "{\\row }" << endl;
1402  }
1403  else
1404  {
1405  m_t << "\\par" << endl;
1406  }
1407 
1409 }
DocNode * parent() const
Definition: docparser.h:147
virtual Kind kind() const =0
FTextStream & m_t
static QCString type
Definition: declinfo.cpp:672
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1465 of file rtfdocvisitor.cpp.

1466 {
1467  if (m_hide) return;
1468  if (x->title().isEmpty()) return;
1469  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1470  m_t << "\\par" << endl;
1471  decIndentLevel();
1472  m_t << "}" << endl; // end xref item
1474 }
bool isEmpty() const
Definition: qcstring.h:189
FTextStream & m_t
void decIndentLevel()
QCString title() const
Definition: docparser.h:671
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocInternalRef )
virtual

Implements DocVisitor.

Definition at line 1483 of file rtfdocvisitor.cpp.

1484 {
1485  if (m_hide) return;
1486  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternalRef)}\n");
1487  endLink("");
1488  m_t << " ";
1489 }
FTextStream & m_t
void endLink(const QCString &ref)
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1497 of file rtfdocvisitor.cpp.

1498 {
1499  if (m_hide) return;
1500  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocCopy)}\n");
1501 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocText )
virtual

Implements DocVisitor.

Definition at line 1509 of file rtfdocvisitor.cpp.

1510 {
1511  if (m_hide) return;
1512  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocText)}\n");
1513 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPost ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1525 of file rtfdocvisitor.cpp.

1526 {
1527  if (m_hide) return;
1528  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlBlockQuote)}\n");
1529  if (!m_lastIsPara) m_t << "\\par" << endl;
1530  decIndentLevel();
1531  m_t << "}"; // end desc
1533 }
FTextStream & m_t
void decIndentLevel()
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPost ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1540 of file rtfdocvisitor.cpp.

1541 {
1542  if (m_hide) return;
1543 }
void RTFDocVisitor::visitPost ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1550 of file rtfdocvisitor.cpp.

1551 {
1552  if (m_hide) return;
1553 }
void RTFDocVisitor::visitPre ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 521 of file rtfdocvisitor.cpp.

522 {
523  if (m_hide) return;
524  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoList)}\n");
525  m_t << "{" << endl;
529 }
const bool FALSE
Definition: qglobal.h:370
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
Definition: rtfstyle.cpp:28
FTextStream & m_t
bool isEnumList() const
Definition: docparser.h:621
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 540 of file rtfdocvisitor.cpp.

541 {
542  if (m_hide) return;
543  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoListItem)}\n");
544  if (!m_lastIsPara) m_t << "\\par" << endl;
545  m_t << rtf_Style_Reset;
546  if (rtf_listItemInfo[m_indentLevel].isEnum)
547  {
548  m_t << getStyle("ListEnum") << endl;
549  m_t << rtf_listItemInfo[m_indentLevel].number << ".\\tab ";
551  }
552  else
553  {
554  m_t << getStyle("ListBullet") << endl;
555  }
556  incIndentLevel();
558 }
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
void incIndentLevel()
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
Definition: rtfstyle.cpp:28
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocPara )
virtual

Implements DocVisitor.

Definition at line 566 of file rtfdocvisitor.cpp.

567 {
568  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
569 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocRoot r)
virtual

Implements DocVisitor.

Definition at line 587 of file rtfdocvisitor.cpp.

588 {
589  if (m_hide) return;
590  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRoot)}\n");
591  if (r->indent()) incIndentLevel();
592  m_t << "{" << rtf_Style["BodyText"]->reference << endl;
593 }
QDict< StyleData > rtf_Style
void incIndentLevel()
FTextStream & m_t
bool indent() const
Definition: docparser.h:1407
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 605 of file rtfdocvisitor.cpp.

606 {
607  if (m_hide) return;
608  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
609  if (!m_lastIsPara) m_t << "\\par" << endl;
610  m_t << "{"; // start desc
611  //m_t << "{\\b "; // start bold
612  m_t << "{" << rtf_Style["Heading5"]->reference << endl;
613  switch(s->type())
614  {
615  case DocSimpleSect::See:
616  m_t << theTranslator->trSeeAlso(); break;
617  case DocSimpleSect::Return:
618  m_t << theTranslator->trReturns(); break;
619  case DocSimpleSect::Author:
620  m_t << theTranslator->trAuthor(TRUE,TRUE); break;
622  m_t << theTranslator->trAuthor(TRUE,FALSE); break;
624  m_t << theTranslator->trVersion(); break;
625  case DocSimpleSect::Since:
626  m_t << theTranslator->trSince(); break;
627  case DocSimpleSect::Date:
628  m_t << theTranslator->trDate(); break;
629  case DocSimpleSect::Note:
630  m_t << theTranslator->trNote(); break;
632  m_t << theTranslator->trWarning(); break;
633  case DocSimpleSect::Pre:
634  m_t << theTranslator->trPrecondition(); break;
635  case DocSimpleSect::Post:
636  m_t << theTranslator->trPostcondition(); break;
638  m_t << theTranslator->trCopyright(); break;
640  m_t << theTranslator->trInvariant(); break;
642  m_t << theTranslator->trRemarks(); break;
644  m_t << theTranslator->trAttention(); break;
645  case DocSimpleSect::User: break;
646  case DocSimpleSect::Rcs: break;
647  case DocSimpleSect::Unknown: break;
648  }
649 
650  // special case 1: user defined title
651  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
652  {
653  m_t << ":";
654  m_t << "\\par";
655  m_t << "}"; // end bold
656  incIndentLevel();
657  m_t << rtf_Style_Reset << getStyle("DescContinue");
658  }
660 }
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trAttention()=0
virtual QCString trInvariant()=0
QDict< StyleData > rtf_Style
virtual QCString trPostcondition()=0
const bool FALSE
Definition: qglobal.h:370
virtual QCString trWarning()=0
virtual QCString trCopyright()=0
QCString getStyle(const char *name)
virtual QCString trReturns()=0
virtual QCString trDate()=0
virtual QCString trNote()=0
void incIndentLevel()
virtual QCString trAuthor(bool first_capital, bool singular)=0
FTextStream & m_t
virtual QCString trVersion()=0
Type type() const
Definition: docparser.h:1057
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
Translator * theTranslator
Definition: language.cpp:157
virtual QCString trRemarks()=0
virtual QCString trSeeAlso()=0
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 672 of file rtfdocvisitor.cpp.

673 {
674  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocTitle)}\n");
675 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 688 of file rtfdocvisitor.cpp.

689 {
690  if (m_hide) return;
691  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
692  m_t << "{" << endl;
695 }
const bool FALSE
Definition: qglobal.h:370
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
Definition: rtfstyle.cpp:28
FTextStream & m_t
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 706 of file rtfdocvisitor.cpp.

707 {
708  if (m_hide) return;
709  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleListItem)}\n");
710  m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << endl;
712  incIndentLevel();
713 }
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
void incIndentLevel()
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 721 of file rtfdocvisitor.cpp.

722 {
723  if (m_hide) return;
724  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSection)}\n");
725  if (!m_lastIsPara) m_t << "\\par" << endl;
726  m_t << "{\\bkmkstart " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl;
727  m_t << "{\\bkmkend " << rtfFormatBmkStr(s->file()+"_"+s->anchor()) << "}" << endl;
728  m_t << "{{" // start section
729  << rtf_Style_Reset;
730  QCString heading;
731  int level = QMIN(s->level()+1,4);
732  heading.sprintf("Heading%d",level);
733  // set style
734  m_t << rtf_Style[heading]->reference << endl;
735  // make table of contents entry
736  filter(s->title());
737  m_t << endl << "\\par" << "}" << endl;
738  m_t << "{\\tc\\tcl" << level << " \\v ";
739  filter(s->title());
740  m_t << "}" << endl;
742 }
QCString file() const
Definition: docparser.h:946
void filter(const char *str, bool verbatim=FALSE)
int level() const
Definition: docparser.h:942
QCString anchor() const
Definition: docparser.h:944
QDict< StyleData > rtf_Style
#define QMIN(a, b)
Definition: qglobal.h:391
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
QCString title() const
Definition: docparser.h:943
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QCString rtfFormatBmkStr(const char *name)
Definition: util.cpp:6744
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 752 of file rtfdocvisitor.cpp.

753 {
754  if (m_hide) return;
755  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlList)}\n");
756  m_t << "{" << endl;
760 }
const bool FALSE
Definition: qglobal.h:370
static QStrList * l
Definition: config.cpp:1044
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
Definition: rtfstyle.cpp:28
FTextStream & m_t
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 770 of file rtfdocvisitor.cpp.

771 {
772  if (m_hide) return;
773  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlListItem)}\n");
774  m_t << "\\par" << endl;
775  m_t << rtf_Style_Reset;
776  if (rtf_listItemInfo[m_indentLevel].isEnum)
777  {
778  m_t << getStyle("ListEnum") << endl;
779  m_t << rtf_listItemInfo[m_indentLevel].number << ".\\tab ";
781  }
782  else
783  {
784  m_t << getStyle("ListBullet") << endl;
785  }
786  incIndentLevel();
788 }
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
void incIndentLevel()
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels]
Definition: rtfstyle.cpp:28
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlDescList )
virtual

Implements DocVisitor.

Definition at line 796 of file rtfdocvisitor.cpp.

797 {
798  if (m_hide) return;
799  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescList)}\n");
800  //m_t << "{" << endl;
801  //m_t << rtf_Style_Reset << getStyle("ListContinue");
802  //m_lastIsPara=FALSE;
803 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 814 of file rtfdocvisitor.cpp.

815 {
816  if (m_hide) return;
817  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescTitle)}\n");
818  //m_t << "\\par" << endl;
819  //m_t << "{\\b ";
820  m_t << "{" << rtf_Style["Heading5"]->reference << endl;
822 }
QDict< StyleData > rtf_Style
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 833 of file rtfdocvisitor.cpp.

834 {
835  if (m_hide) return;
836  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescData)}\n");
837  incIndentLevel();
838  m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
839 }
QCString getStyle(const char *name)
void incIndentLevel()
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 851 of file rtfdocvisitor.cpp.

852 {
853  if (m_hide) return;
854  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlTable)}\n");
855  if (!m_lastIsPara) m_t << "\\par" << endl;
857 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlCaption )
virtual

Implements DocVisitor.

Definition at line 868 of file rtfdocvisitor.cpp.

869 {
870  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCaption)}\n");
871 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocHtmlRow r)
virtual

Implements DocVisitor.

Definition at line 878 of file rtfdocvisitor.cpp.

879 {
880  if (m_hide) return;
881  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n");
882  uint i,columnWidth=r->numCells()>0 ? rtf_pageWidth/r->numCells() : 10;
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;
890  for (i=0;i<r->numCells();i++)
891  {
892  if (r->isHeading())
893  {
894  m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
895  }
896  m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
897  "\\clbrdrl\\brdrs\\brdrw10 "
898  "\\clbrdrb\\brdrs\\brdrw10 "
899  "\\clbrdrr \\brdrs\\brdrw10 "
900  "\\cltxlrtb "
901  "\\cellx" << ((i+1)*columnWidth) << endl;
902  }
903  m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
905 }
std::size_t columnWidth(T const &coll, std::string const Elem::*cp, std::string const &header)
const bool FALSE
Definition: qglobal.h:370
bool isHeading() const
Definition: docparser.h:1320
FTextStream & m_t
const int rtf_pageWidth
Definition: rtfstyle.h:26
uint numCells() const
Definition: docparser.h:1315
unsigned uint
Definition: qglobal.h:351
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 917 of file rtfdocvisitor.cpp.

918 {
919  if (m_hide) return;
920  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCell)}\n");
921  m_t << "{" << align(c);
923 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
static QCString align(DocHtmlCell *cell)
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 933 of file rtfdocvisitor.cpp.

934 {
935  if (m_hide) return;
936  //DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocInternal)}\n");
937  //m_t << "{"; // start desc
938  //m_t << "{\\b "; // start bold
939  //m_t << theTranslator->trForInternalUseOnly();
940  //m_t << "}"; // end bold
941  //m_t << "\\par" << endl;
942  //incIndentLevel();
943  //m_t << rtf_Style_Reset << getStyle("DescContinue");
944  //m_lastIsPara=FALSE;
945 }
void RTFDocVisitor::visitPre ( DocHRef href)
virtual

Implements DocVisitor.

Definition at line 957 of file rtfdocvisitor.cpp.

958 {
959  if (m_hide) return;
960  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n");
961  if (Config_getBool("RTF_HYPERLINKS"))
962  {
963  m_t << "{\\field "
964  "{\\*\\fldinst "
965  "{ HYPERLINK \"" << href->url() << "\" "
966  "}{}"
967  "}"
968  "{\\fldrslt "
969  "{\\cs37\\ul\\cf2 ";
970 
971  }
972  else
973  {
974  m_t << "{\\f2 ";
975  }
977 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
QCString url() const
Definition: docparser.h:876
#define Config_getBool(val)
Definition: config.cpp:664
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocHtmlHeader header)
virtual

Implements DocVisitor.

Definition at line 996 of file rtfdocvisitor.cpp.

997 {
998  if (m_hide) return;
999  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlHeader)}\n");
1000  m_t << "{" // start section
1001  << rtf_Style_Reset;
1002  QCString heading;
1003  int level = QMIN(header->level()+2,4);
1004  heading.sprintf("Heading%d",level);
1005  // set style
1006  m_t << rtf_Style[heading]->reference;
1007  // make table of contents entry
1008  m_t << "{\\tc\\tcl \\v " << level << "}";
1010 
1011 }
QDict< StyleData > rtf_Style
const bool FALSE
Definition: qglobal.h:370
int level() const
Definition: docparser.h:894
#define QMIN(a, b)
Definition: qglobal.h:391
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 1022 of file rtfdocvisitor.cpp.

1023 {
1024  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocImage)}\n");
1025  if (img->type()==DocImage::Rtf)
1026  {
1027  m_t << "\\par" << endl;
1028  m_t << "{" << endl;
1029  m_t << rtf_Style_Reset << endl;
1030  m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1031  m_t << img->name();
1032  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1033  m_t << "}" << endl;
1035  }
1036  else // other format -> skip
1037  {
1038  }
1039  // hide caption since it is not supported at the moment
1040  pushEnabled();
1041  m_hide=TRUE;
1042 }
QCString name() const
Definition: docparser.h:695
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
Type type() const
Definition: docparser.h:694
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 1050 of file rtfdocvisitor.cpp.

1051 {
1052  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocDotFile)}\n");
1053  writeDotFile(df->file());
1054 
1055  // hide caption since it is not supported at the moment
1056  pushEnabled();
1057  m_hide=TRUE;
1058 }
QCString file() const
Definition: docparser.h:723
void writeDotFile(const QCString &fileName)
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 1065 of file rtfdocvisitor.cpp.

1066 {
1067  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocMscFile)}\n");
1068  writeMscFile(df->file());
1069 
1070  // hide caption since it is not supported at the moment
1071  pushEnabled();
1072  m_hide=TRUE;
1073 }
QCString file() const
Definition: docparser.h:747
void writeMscFile(const QCString &fileName)
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 1081 of file rtfdocvisitor.cpp.

1082 {
1083  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocDiaFile)}\n");
1084  writeDiaFile(df->file());
1085 
1086  // hide caption since it is not supported at the moment
1087  pushEnabled();
1088  m_hide=TRUE;
1089 }
void writeDiaFile(const QCString &fileName)
QCString file() const
Definition: docparser.h:771
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 1097 of file rtfdocvisitor.cpp.

1098 {
1099  if (m_hide) return;
1100  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLink)}\n");
1101  startLink(lnk->ref(),lnk->file(),lnk->anchor());
1102 }
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1111 of file rtfdocvisitor.cpp.

1112 {
1113  if (m_hide) return;
1114  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRef)}\n");
1115  // when ref->isSubPage()==TRUE we use ref->file() for HTML and
1116  // ref->anchor() for LaTeX/RTF
1117  if (ref->isSubPage())
1118  {
1119  startLink(ref->ref(),0,ref->anchor());
1120  }
1121  else
1122  {
1123  if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor());
1124  }
1125  if (!ref->hasLinkText()) filter(ref->targetTitle());
1126 }
void filter(const char *str, bool verbatim=FALSE)
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString anchor() const
Definition: docparser.h:830
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:827
bool isSubPage() const
Definition: docparser.h:836
QCString targetTitle() const
Definition: docparser.h:831
QCString ref() const
Definition: docparser.h:829
bool hasLinkText() const
Definition: docparser.h:832
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocSecRefItem )
virtual

Implements DocVisitor.

Definition at line 1137 of file rtfdocvisitor.cpp.

1138 {
1139  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefItem)}\n");
1140 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 1147 of file rtfdocvisitor.cpp.

1148 {
1149  if (m_hide) return;
1150  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefList)}\n");
1151  m_t << "{" << endl;
1152  incIndentLevel();
1153  m_t << rtf_Style_Reset << getStyle("LatexTOC") << endl;
1154  m_t << "\\par" << endl;
1156 }
QCString getStyle(const char *name)
void incIndentLevel()
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1189 of file rtfdocvisitor.cpp.

1190 {
1191  if (m_hide) return;
1192  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamSect)}\n");
1193  m_t << "{"; // start param list
1194  if (!m_lastIsPara) m_t << "\\par" << endl;
1195  //m_t << "{\\b "; // start bold
1196  m_t << "{" << rtf_Style["Heading5"]->reference << endl;
1197  switch(s->type())
1198  {
1199  case DocParamSect::Param:
1200  m_t << theTranslator->trParameters(); break;
1201  case DocParamSect::RetVal:
1202  m_t << theTranslator->trReturnValues(); break;
1204  m_t << theTranslator->trExceptions(); break;
1206  /* TODO: add this
1207  m_t << theTranslator->trTemplateParam(); break;
1208  */
1209  m_t << "Template Parameters"; break;
1210  default:
1211  ASSERT(0);
1212  }
1213  m_t << ":";
1214  m_t << "\\par";
1215  m_t << "}" << endl;
1216  bool useTable = s->type()==DocParamSect::Param ||
1217  s->type()==DocParamSect::RetVal ||
1218  s->type()==DocParamSect::Exception ||
1220  if (!useTable)
1221  {
1222  incIndentLevel();
1223  }
1224  m_t << rtf_Style_Reset << getStyle("DescContinue");
1226 }
QDict< StyleData > rtf_Style
Type type() const
Definition: docparser.h:1101
QCString getStyle(const char *name)
virtual QCString trExceptions()=0
void incIndentLevel()
virtual QCString trParameters()=0
virtual QCString trReturnValues()=0
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
Translator * theTranslator
Definition: language.cpp:157
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
#define ASSERT(x)
Definition: qglobal.h:590
void RTFDocVisitor::visitPre ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 1244 of file rtfdocvisitor.cpp.

1245 {
1246  static int columnPos[4][5] =
1247  { { 2, 25, 100, 100, 100 }, // no inout, no type
1248  { 3, 14, 35, 100, 100 }, // inout, no type
1249  { 3, 25, 50, 100, 100 }, // no inout, type
1250  { 4, 14, 35, 55, 100 }, // inout, type
1251  };
1252  int config=0;
1253  if (m_hide) return;
1254  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamList)}\n");
1255 
1257  DocParamSect *sect = 0;
1258  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1259  {
1260  parentType = ((DocParamSect*)pl->parent())->type();
1261  sect=(DocParamSect*)pl->parent();
1262  }
1263  bool useTable = parentType==DocParamSect::Param ||
1264  parentType==DocParamSect::RetVal ||
1265  parentType==DocParamSect::Exception ||
1266  parentType==DocParamSect::TemplateParam;
1267  if (sect && sect->hasInOutSpecifier()) config+=1;
1268  if (sect && sect->hasTypeSpecifier()) config+=2;
1269  if (useTable)
1270  {
1271  int i;
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++)
1280  {
1281  m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1282  "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1283  "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1284  "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
1285  "\\cltxlrtb "
1286  "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << endl;
1287  }
1288  m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl;
1289  }
1290 
1291  if (sect && sect->hasInOutSpecifier())
1292  {
1293  if (useTable)
1294  {
1295  m_t << "{";
1296  }
1297 
1298  // Put in the direction: in/out/in,out if specified.
1300  {
1301  if (pl->direction()==DocParamSect::In)
1302  {
1303  m_t << "in";
1304  }
1305  else if (pl->direction()==DocParamSect::Out)
1306  {
1307  m_t << "out";
1308  }
1309  else if (pl->direction()==DocParamSect::InOut)
1310  {
1311  m_t << "in,out";
1312  }
1313  }
1314 
1315  if (useTable)
1316  {
1317  m_t << "\\cell }";
1318  }
1319  }
1320 
1321  if (sect && sect->hasTypeSpecifier())
1322  {
1323  if (useTable)
1324  {
1325  m_t << "{";
1326  }
1328  DocNode *type;
1329  bool first=TRUE;
1330  for (li.toFirst();(type=li.current());++li)
1331  {
1332  if (!first) m_t << " | "; else first=FALSE;
1333  if (type->kind()==DocNode::Kind_Word)
1334  {
1335  visit((DocWord*)type);
1336  }
1337  else if (type->kind()==DocNode::Kind_LinkedWord)
1338  {
1339  visit((DocLinkedWord*)type);
1340  }
1341  }
1342  if (useTable)
1343  {
1344  m_t << "\\cell }";
1345  }
1346  }
1347 
1348 
1349  if (useTable)
1350  {
1351  m_t << "{";
1352  }
1353 
1354  m_t << "{\\i ";
1355  //QStrListIterator li(pl->parameters());
1356  //const char *s;
1358  DocNode *param;
1359  bool first=TRUE;
1360  for (li.toFirst();(param=li.current());++li)
1361  {
1362  if (!first) m_t << ","; else first=FALSE;
1363  if (param->kind()==DocNode::Kind_Word)
1364  {
1365  visit((DocWord*)param);
1366  }
1367  else if (param->kind()==DocNode::Kind_LinkedWord)
1368  {
1369  visit((DocLinkedWord*)param);
1370  }
1371  }
1372  m_t << "} ";
1373 
1374  if (useTable)
1375  {
1376  m_t << "\\cell }{";
1377  }
1379 }
DocNode * parent() const
Definition: docparser.h:147
void visit(DocWord *)
const bool FALSE
Definition: qglobal.h:370
const QList< DocNode > & paramTypes()
Definition: docparser.h:1170
virtual Kind kind() const =0
static Config * config
Definition: config.cpp:1054
FTextStream & m_t
type * current() const
Definition: qlist.h:146
DocParamSect::Direction direction() const
Definition: docparser.h:1172
const int rtf_pageWidth
Definition: rtfstyle.h:26
bool hasInOutSpecifier() const
Definition: docparser.h:1103
const QList< DocNode > & parameters()
Definition: docparser.h:1169
bool hasTypeSpecifier() const
Definition: docparser.h:1104
static QCString type
Definition: declinfo.cpp:672
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1411 of file rtfdocvisitor.cpp.

1412 {
1413  if (m_hide) return;
1414  if (x->title().isEmpty()) return;
1415  bool anonymousEnum = x->file()=="@";
1416  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n");
1417  if (!m_lastIsPara)
1418  {
1419  m_t << "\\par" << endl;
1421  }
1422  m_t << "{"; // start param list
1423  //m_t << "{\\b "; // start bold
1424  m_t << "{" << rtf_Style["Heading5"]->reference << endl;
1425  if (Config_getBool("RTF_HYPERLINKS") && !anonymousEnum)
1426  {
1427  QCString refName;
1428  if (!x->file().isEmpty())
1429  {
1430  refName+=x->file();
1431  }
1432  if (!x->file().isEmpty() && !x->anchor().isEmpty())
1433  {
1434  refName+="_";
1435  }
1436  if (!x->anchor().isEmpty())
1437  {
1438  refName+=x->anchor();
1439  }
1440 
1441  m_t << "{\\field "
1442  "{\\*\\fldinst "
1443  "{ HYPERLINK \\\\l \"" << refName << "\" "
1444  "}{}"
1445  "}"
1446  "{\\fldrslt "
1447  "{\\cs37\\ul\\cf2 ";
1448  filter(x->title());
1449  m_t << "}"
1450  "}"
1451  "}";
1452  }
1453  else
1454  {
1455  filter(x->title());
1456  }
1457  m_t << ":";
1458  m_t << "\\par";
1459  m_t << "}"; // end bold
1460  incIndentLevel();
1461  m_t << rtf_Style_Reset << getStyle("DescContinue");
1463 }
void filter(const char *str, bool verbatim=FALSE)
bool isEmpty() const
Definition: qcstring.h:189
QDict< StyleData > rtf_Style
const bool FALSE
Definition: qglobal.h:370
QCString getStyle(const char *name)
void incIndentLevel()
QCString anchor() const
Definition: docparser.h:670
FTextStream & m_t
#define Config_getBool(val)
Definition: config.cpp:664
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
QCString file() const
Definition: docparser.h:669
QCString title() const
Definition: docparser.h:671
const bool TRUE
Definition: qglobal.h:371
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocInternalRef ref)
virtual

Implements DocVisitor.

Definition at line 1476 of file rtfdocvisitor.cpp.

1477 {
1478  if (m_hide) return;
1479  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocInternalRef)}\n");
1480  startLink("",ref->file(),ref->anchor());
1481 }
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString anchor() const
Definition: docparser.h:859
QCString file() const
Definition: docparser.h:857
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1491 of file rtfdocvisitor.cpp.

1492 {
1493  if (m_hide) return;
1494  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocCopy)}\n");
1495 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocText )
virtual

Implements DocVisitor.

Definition at line 1503 of file rtfdocvisitor.cpp.

1504 {
1505  if (m_hide) return;
1506  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocText)}\n");
1507 }
#define DBG_RTF(x)
void RTFDocVisitor::visitPre ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1515 of file rtfdocvisitor.cpp.

1516 {
1517  if (m_hide) return;
1518  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlBlockQuote)}\n");
1519  if (!m_lastIsPara) m_t << "\\par" << endl;
1520  m_t << "{"; // start desc
1521  incIndentLevel();
1522  m_t << rtf_Style_Reset << getStyle("DescContinue");
1523 }
QCString getStyle(const char *name)
void incIndentLevel()
FTextStream & m_t
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
#define DBG_RTF(x)
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::visitPre ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1535 of file rtfdocvisitor.cpp.

1536 {
1537  if (m_hide) return;
1538 }
void RTFDocVisitor::visitPre ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1545 of file rtfdocvisitor.cpp.

1546 {
1547  if (m_hide) return;
1548 }
void RTFDocVisitor::writeDiaFile ( const QCString fileName)
private

Definition at line 1706 of file rtfdocvisitor.cpp.

1707 {
1709  int i;
1710  if ((i=baseName.findRev('/'))!=-1)
1711  {
1712  baseName=baseName.right(baseName.length()-i-1);
1713  }
1714  QCString outDir = Config_getString("RTF_OUTPUT");
1715  writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP);
1716  if (!m_lastIsPara) m_t << "\\par" << endl;
1717  m_t << "{" << endl;
1718  m_t << rtf_Style_Reset;
1719  m_t << "\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1720  m_t << baseName << ".png";
1721  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1722  m_t << "}" << endl;
1724 }
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
FTextStream & m_t
#define Config_getString(val)
Definition: config.cpp:660
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
void writeDiaGraphFromFile(const char *inFile, const char *outDir, const char *outFile, DiaOutputFormat format)
Definition: dia.cpp:28
static QCString baseName
Definition: scanner.cpp:10890
Definition: dia.h:24
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::writeDotFile ( const QCString fileName)
private

Definition at line 1665 of file rtfdocvisitor.cpp.

1666 {
1668  int i;
1669  if ((i=baseName.findRev('/'))!=-1)
1670  {
1671  baseName=baseName.right(baseName.length()-i-1);
1672  }
1673  QCString outDir = Config_getString("RTF_OUTPUT");
1674  writeDotGraphFromFile(fileName,outDir,baseName,GOF_BITMAP);
1675  if (!m_lastIsPara) m_t << "\\par" << endl;
1676  m_t << "{" << endl;
1677  m_t << rtf_Style_Reset;
1678  m_t << "\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1679  QCString imgExt = getDotImageExtension();
1680  m_t << baseName << "." << imgExt;
1681  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1682  m_t << "}" << endl;
1684 }
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
void writeDotGraphFromFile(const char *inFile, const char *outDir, const char *outFile, GraphOutputFormat format)
Definition: dot.cpp:4203
FTextStream & m_t
#define Config_getString(val)
Definition: config.cpp:660
QCString getDotImageExtension(void)
Definition: util.cpp:8562
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
static QCString baseName
Definition: scanner.cpp:10890
Definition: dot.h:42
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::writeMscFile ( const QCString fileName)
private

Definition at line 1686 of file rtfdocvisitor.cpp.

1687 {
1689  int i;
1690  if ((i=baseName.findRev('/'))!=-1)
1691  {
1692  baseName=baseName.right(baseName.length()-i-1);
1693  }
1694  QCString outDir = Config_getString("RTF_OUTPUT");
1695  writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP);
1696  if (!m_lastIsPara) m_t << "\\par" << endl;
1697  m_t << "{" << endl;
1698  m_t << rtf_Style_Reset;
1699  m_t << "\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1700  m_t << baseName << ".png";
1701  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1702  m_t << "}" << endl;
1704 }
void writeMscGraphFromFile(const char *inFile, const char *outDir, const char *outFile, MscOutputFormat format)
Definition: msc.cpp:92
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
FTextStream & m_t
Definition: msc.h:24
#define Config_getString(val)
Definition: config.cpp:660
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
static QCString baseName
Definition: scanner.cpp:10890
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
void RTFDocVisitor::writePlantUMLFile ( const QCString fileName)
private

Definition at line 1726 of file rtfdocvisitor.cpp.

1727 {
1729  int i;
1730  if ((i=baseName.findRev('/'))!=-1)
1731  {
1732  baseName=baseName.right(baseName.length()-i-1);
1733  }
1734  QCString outDir = Config_getString("RTF_OUTPUT");
1735  generatePlantUMLOutput(fileName,outDir,PUML_BITMAP);
1736  if (!m_lastIsPara) m_t << "\\par" << endl;
1737  m_t << "{" << endl;
1738  m_t << rtf_Style_Reset;
1739  m_t << "\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1740  m_t << baseName << ".png";
1741  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
1742  m_t << "}" << endl;
1744 }
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
FTextStream & m_t
#define Config_getString(val)
Definition: config.cpp:660
void generatePlantUMLOutput(const char *baseName, const char *outDir, PlantUMLOutputFormat format)
Definition: plantuml.cpp:54
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:41
static QCString baseName
Definition: scanner.cpp:10890
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)

Member Data Documentation

CodeOutputInterface& RTFDocVisitor::m_ci
private

Definition at line 165 of file rtfdocvisitor.h.

QStack<bool> RTFDocVisitor::m_enabled
private

Definition at line 169 of file rtfdocvisitor.h.

bool RTFDocVisitor::m_hide
private

Definition at line 167 of file rtfdocvisitor.h.

int RTFDocVisitor::m_indentLevel
private

Definition at line 168 of file rtfdocvisitor.h.

bool RTFDocVisitor::m_insidePre
private

Definition at line 166 of file rtfdocvisitor.h.

QCString RTFDocVisitor::m_langExt
private

Definition at line 171 of file rtfdocvisitor.h.

bool RTFDocVisitor::m_lastIsPara
private

Definition at line 170 of file rtfdocvisitor.h.

FTextStream& RTFDocVisitor::m_t
private

Definition at line 164 of file rtfdocvisitor.h.


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