Doxygen
rtfdocvisitor.cpp
浏览该文件的文档.
1 /******************************************************************************
2  *
3  *
4  *
5  *
6  * Copyright (C) 1997-2015 by Dimitri van Heesch.
7  *
8  * Permission to use, copy, modify, and distribute this software and its
9  * documentation under the terms of the GNU General Public License is hereby
10  * granted. No representations are made about the suitability of this software
11  * for any purpose. It is provided "as is" without express or implied warranty.
12  * See the GNU General Public License for more details.
13  *
14  * Documents produced by Doxygen are derivative works derived from the
15  * input used in their production; they are not affected by this license.
16  *
17  */
18 
19 #include <algorithm>
20 
21 #include "rtfdocvisitor.h"
22 #include "docparser.h"
23 #include "language.h"
24 #include "doxygen.h"
25 #include "outputgen.h"
26 #include "dot.h"
27 #include "msc.h"
28 #include "util.h"
29 #include "rtfstyle.h"
30 #include "message.h"
31 #include "parserintf.h"
32 #include "msc.h"
33 #include "dia.h"
34 #include "filedef.h"
35 #include "config.h"
36 #include "htmlentity.h"
37 #include "emoji.h"
38 #include "plantuml.h"
39 #include "fileinfo.h"
40 
41 //#define DBG_RTF(x) m_t << x
42 #define DBG_RTF(x) do {} while(0)
43 
44 static QCString align(DocHtmlCell *cell)
45 {
46  for (const auto &attr : cell->attribs())
47  {
48  if (attr.name.lower()=="align")
49  {
50  if (attr.value.lower()=="center") return "\\qc ";
51  else if (attr.value.lower()=="right") return "\\qr ";
52  else return "";
53  }
54  }
55  return "";
56 }
57 
59  const QCString &langExt)
60  : DocVisitor(DocVisitor_RTF), m_t(t), m_ci(ci), m_langExt(langExt)
61 {
62 }
63 
65 {
66  QCString n = name + QCString().setNum(indentLevel());
67  StyleData &sd = rtf_Style[n.str()];
68  return sd.reference();
69 }
70 
72 {
73  return std::min(m_indentLevel,maxIndentLevels-1);
74 }
75 
77 {
78  m_indentLevel++;
80  {
81  err("Maximum indent level (%d) exceeded while generating RTF output!\n",maxIndentLevels-1);
82  }
83 }
84 
86 {
88 }
89 
90  //------------------------------------
91  // visitor functions for leaf nodes
92  //--------------------------------------
93 
95 {
96  if (m_hide) return;
97  DBG_RTF("{\\comment RTFDocVisitor::visit(DocWord)}\n");
98  filter(w->word());
100 }
101 
103 {
104  if (m_hide) return;
105  DBG_RTF("{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
106  startLink(w->ref(),w->file(),w->anchor());
107  filter(w->word());
108  endLink(w->ref());
110 }
111 
113 {
114  if (m_hide) return;
115  DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
116  if (m_insidePre)
117  {
118  m_t << w->chars();
119  }
120  else
121  {
122  m_t << " ";
123  }
125 }
126 
128 {
129  if (m_hide) return;
130  DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
131  const char *res = HtmlEntityMapper::instance()->rtf(s->symbol());
132  if (res)
133  {
134  m_t << res;
135  }
136  else
137  {
138  err("RTF: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
139  }
141 }
142 
144 {
145  if (m_hide) return;
146  DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n");
147  const char *res = EmojiEntityMapper::instance()->unicode(s->index());
148  if (res)
149  {
150  const char *p = res;
151  int val = 0;
152  int val1 = 0;
153  while (*p)
154  {
155  switch(*p)
156  {
157  case '&': case '#': case 'x':
158  break;
159  case ';':
160  val1 = val;
161  val = 0xd800 + ( ( val1 - 0x10000 ) & 0xffc00 ) / 0x400 - 0x10000;
162  m_t << "\\u" << val << "?";
163  val = 0xdC00 + ( ( val1 - 0x10000 ) & 0x3ff ) - 0x10000 ;
164  m_t << "\\u" << val << "?";
165  val = 0;
166  break;
167  case '0': case '1': case '2': case '3': case '4':
168  case '5': case '6': case '7': case '8': case '9':
169  val = val * 16 + *p - '0';
170  break;
171  case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
172  val = val * 16 + *p - 'a' + 10;
173  break;
174  }
175  p++;
176  }
177  }
178  else
179  {
180  m_t << s->name();
181  }
183 }
184 
186 {
187  if (m_hide) return;
188  DBG_RTF("{\\comment RTFDocVisitor::visit(DocURL)}\n");
189  if (Config_getBool(RTF_HYPERLINKS))
190  {
191  m_t << "{\\field "
192  "{\\*\\fldinst "
193  "{ HYPERLINK \"";
194  if (u->isEmail()) m_t << "mailto:";
195  m_t << u->url();
196  m_t << "\" }"
197  "{}";
198  m_t << "}"
199  "{\\fldrslt "
200  "{\\cs37\\ul\\cf2 ";
201  filter(u->url());
202  m_t << "}"
203  "}"
204  "}\n";
205  }
206  else
207  {
208  m_t << "{\\f2 ";
209  filter(u->url());
210  m_t << "}";
211  }
213 }
214 
216 {
217  if (m_hide) return;
218  DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
219  m_t << "\\par\n";
221 }
222 
224 {
225  if (m_hide) return;
226  DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
227  m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
229 }
230 
232 {
233  if (m_hide) return;
235  DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
236  switch (s->style())
237  {
239  if (s->enable()) m_t << "{\\b "; else m_t << "} ";
240  break;
241  case DocStyleChange::S:
243  case DocStyleChange::Del:
244  if (s->enable()) m_t << "{\\strike "; else m_t << "} ";
245  break;
247  case DocStyleChange::Ins:
248  if (s->enable()) m_t << "{\\ul "; else m_t << "} ";
249  break;
251  if (s->enable()) m_t << "{\\i "; else m_t << "} ";
252  break;
254  if (s->enable()) m_t << "{\\f2 "; else m_t << "} ";
255  break;
257  if (s->enable()) m_t << "{\\sub "; else m_t << "} ";
258  break;
260  if (s->enable()) m_t << "{\\super "; else m_t << "} ";
261  break;
263  if (s->enable()) m_t << "{\\qc "; else m_t << "} ";
264  break;
266  if (s->enable()) m_t << "{\\sub "; else m_t << "} ";
267  break;
269  if (s->enable())
270  {
271  m_t << "{\n";
272  m_t << "\\par\n";
273  m_t << rtf_Style_Reset << getStyle("CodeExample");
275  }
276  else
277  {
279  m_t << "\\par";
280  m_t << "}\n";
281  }
283  break;
284  case DocStyleChange::Div: /* HTML only */ break;
285  case DocStyleChange::Span: /* HTML only */ break;
286  }
287 }
288 
289 static void visitCaption(RTFDocVisitor *parent, const DocNodeList &children)
290 {
291  for (const auto &n : children) n->accept(parent);
292 }
293 
295 {
296  if (m_hide) return;
297  DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
298  QCString lang = m_langExt;
299  if (!s->language().isEmpty()) // explicit language setting
300  {
301  lang = s->language();
302  }
303  SrcLangExt langExt = getLanguageFromCodeLang(lang);
304  switch(s->type())
305  {
306  case DocVerbatim::Code:
307  m_t << "{\n";
308  m_t << "\\par\n";
309  m_t << rtf_Style_Reset << getStyle("CodeExample");
310  getCodeParser(lang).parseCode(m_ci,s->context(),s->text(),langExt,
311  s->isExample(),s->exampleFile());
312  //m_t << "\\par\n";
313  m_t << "}\n";
314  break;
316  m_t << "{\n";
317  m_t << "\\par\n";
318  m_t << rtf_Style_Reset << getStyle("CodeExample");
319  filter(s->text(),TRUE);
320  //m_t << "\\par\n";
321  m_t << "}\n";
322  break;
324  m_t << s->text();
325  break;
331  /* nothing */
332  break;
333  case DocVerbatim::Dot:
334  {
335  static int dotindex = 1;
336  QCString fileName(4096);
337 
338  fileName.sprintf("%s%d%s",
339  qPrint(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_"),
340  dotindex++,
341  ".dot"
342  );
343  std::ofstream file(fileName.str(),std::ofstream::out | std::ofstream::binary);
344  if (!file.is_open())
345  {
346  err("Could not open file %s for writing\n",qPrint(fileName));
347  }
348  else
349  {
350  QCString stext = s->text();
351  file.write( stext.data(), stext.length() );
352  file.close();
353  }
354 
355  writeDotFile(fileName, s->hasCaption(), s->srcFile(), s->srcLine());
356  visitCaption(this, s->children());
357  includePicturePostRTF(true, s->hasCaption());
358 
359  if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
360  }
361  break;
362  case DocVerbatim::Msc:
363  {
364  static int mscindex = 1;
365  QCString baseName(4096);
366 
367  baseName.sprintf("%s%d%s",
368  qPrint(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_"),
369  mscindex++,
370  ".msc"
371  );
372  std::ofstream file(baseName.str(),std::ofstream::out | std::ofstream::binary);
373  if (!file.is_open())
374  {
375  err("Could not open file %s for writing\n",qPrint(baseName));
376  }
377  QCString text = "msc {";
378  text+=s->text();
379  text+="}";
380  file.write( text.data(), text.length() );
381  file.close();
382 
383  writeMscFile(baseName, s->hasCaption(), s->srcFile(), s->srcLine());
384  visitCaption(this, s->children());
385  includePicturePostRTF(true, s->hasCaption());
386 
387  if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str());
388  }
389  break;
391  {
392  static QCString rtfOutput = Config_getString(RTF_OUTPUT);
394  rtfOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_BITMAP,
395  s->engine(),s->srcFile(),s->srcLine());
396 
397  writePlantUMLFile(baseName, s->hasCaption());
398  visitCaption(this, s->children());
399  includePicturePostRTF(true, s->hasCaption());
400  }
401  break;
402  }
404 }
405 
407 {
408  if (m_hide) return;
409  DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
410  QCString anchor;
411  if (!anc->file().isEmpty())
412  {
413  anchor+=stripPath(anc->file());
414  }
415  if (!anc->file().isEmpty() && !anc->anchor().isEmpty())
416  {
417  anchor+="_";
418  }
419  if (!anc->anchor().isEmpty())
420  {
421  anchor+=anc->anchor();
422  }
423  m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
424  m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
426 }
427 
429 {
430  if (m_hide) return;
431  SrcLangExt langExt = getLanguageFromFileName(inc->extension());
432  DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
433  switch(inc->type())
434  {
436  {
437  m_t << "{\n";
438  m_t << "\\par\n";
439  m_t << rtf_Style_Reset << getStyle("CodeExample");
440  FileInfo cfi( inc->file().str() );
441  FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
443  inc->text(),
444  langExt,
445  inc->isExample(),
446  inc->exampleFile(),
447  fd, // fileDef,
448  -1, // start line
449  -1, // end line
450  FALSE, // inline fragment
451  0, // memberDef
452  TRUE // show line numbers
453  );
454  delete fd;
455  m_t << "\\par";
456  m_t << "}\n";
457  }
458  break;
459  case DocInclude::Include:
460  m_t << "{\n";
461  m_t << "\\par\n";
462  m_t << rtf_Style_Reset << getStyle("CodeExample");
464  inc->text(),langExt,inc->isExample(),
465  inc->exampleFile(),
466  0, // fileDef
467  -1, // startLine
468  -1, // endLine
469  TRUE, // inlineFragment
470  0, // memberDef
471  FALSE // show line numbers
472  );
473  m_t << "\\par";
474  m_t << "}\n";
475  break;
483  break;
485  m_t << inc->text();
486  break;
488  m_t << "{\n";
489  m_t << "\\par\n";
490  m_t << rtf_Style_Reset << getStyle("CodeExample");
491  filter(inc->text());
492  m_t << "\\par";
493  m_t << "}\n";
494  break;
495  case DocInclude::Snippet:
496  m_t << "{\n";
497  if (!m_lastIsPara) m_t << "\\par\n";
498  m_t << rtf_Style_Reset << getStyle("CodeExample");
500  inc->context(),
501  extractBlock(inc->text(),inc->blockId()),
502  langExt,
503  inc->isExample(),
504  inc->exampleFile()
505  );
506  m_t << "}";
507  break;
509  {
510  FileInfo cfi( inc->file().str() );
511  FileDef *fd = createFileDef( cfi.dirPath(), cfi.fileName() );
512  m_t << "{\n";
513  if (!m_lastIsPara) m_t << "\\par\n";
514  m_t << rtf_Style_Reset << getStyle("CodeExample");
516  inc->context(),
517  extractBlock(inc->text(),inc->blockId()),
518  langExt,
519  inc->isExample(),
520  inc->exampleFile(),
521  fd,
522  lineBlock(inc->text(),inc->blockId()),
523  -1, // endLine
524  FALSE, // inlineFragment
525  0, // memberDef
526  TRUE // show line number
527  );
528  delete fd;
529  m_t << "}";
530  }
531  break;
534  err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
535  "Please create a bug report\n",__FILE__);
536  break;
537  }
539 }
540 
542 {
543  //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
544  // op->type(),op->isFirst(),op->isLast(),qPrint(op->text()));
545  DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
546  QCString locLangExt = getFileNameExtension(op->includeFileName());
547  if (locLangExt.isEmpty()) locLangExt = m_langExt;
548  SrcLangExt langExt = getLanguageFromFileName(locLangExt);
549  if (op->isFirst())
550  {
551  if (!m_hide)
552  {
553  m_t << "{\n";
554  m_t << "\\par\n";
555  m_t << rtf_Style_Reset << getStyle("CodeExample");
556  }
558  m_hide = TRUE;
559  }
560  if (op->type()!=DocIncOperator::Skip)
561  {
562  m_hide = popHidden();
563  if (!m_hide)
564  {
565  FileDef *fd = 0;
566  if (!op->includeFileName().isEmpty())
567  {
568  FileInfo cfi( op->includeFileName().str() );
569  fd = createFileDef( cfi.dirPath(), cfi.fileName() );
570  }
571 
572  getCodeParser(locLangExt).parseCode(m_ci,op->context(),op->text(),langExt,
573  op->isExample(),op->exampleFile(),
574  fd, // fileDef
575  op->line(), // startLine
576  -1, // endLine
577  FALSE, // inline fragment
578  0, // memberDef
579  op->showLineNo() // show line numbers
580  );
581  if (fd) delete fd;
582  }
584  m_hide=TRUE;
585  }
586  if (op->isLast())
587  {
588  m_hide = popHidden();
589  if (!m_hide)
590  {
591  m_t << "\\par";
592  m_t << "}\n";
593  }
595  }
596  else
597  {
598  if (!m_hide) m_t << "\n";
600  }
601 }
602 
604 {
605  if (m_hide) return;
606  DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
607  bool bDisplay = !f->isInline();
608  if (bDisplay)
609  {
610  m_t << "\\par";
611  m_t << "{";
612  m_t << "\\pard\\plain";
613  m_t << "\\pard";
614  m_t << "\\qc";
615  }
616  m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f->relPath() << f->name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
617  if (bDisplay)
618  {
619  m_t << "\\par}";
620  }
622 }
623 
625 {
626  if (m_hide) return;
627  DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
628  m_t << "{\\xe \\v " << i->entry() << "}\n";
630 }
631 
633 {
634 }
635 
637 {
638  if (m_hide) return;
639  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocCite)}\n");
640  if (!cite->file().isEmpty())
641  {
642  startLink(cite->ref(),cite->file(),cite->anchor());
643  }
644  else
645  {
646  m_t << "{\\b ";
647  }
648  filter(cite->text());
649  if (!cite->file().isEmpty())
650  {
651  endLink(cite->ref());
652  }
653  else
654  {
655  m_t << "}";
656  }
657 }
658 
659 
660 //--------------------------------------
661 // visitor functions for compound nodes
662 //--------------------------------------
663 
665 {
666  if (m_hide) return;
667  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoList)}\n");
668  m_t << "{\n";
669  int level = indentLevel();
670  m_listItemInfo[level].isEnum = l->isEnumList();
671  m_listItemInfo[level].type = '1';
672  m_listItemInfo[level].number = 1;
674 }
675 
677 {
678  if (m_hide) return;
679  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoList)}\n");
680  if (!m_lastIsPara) m_t << "\\par";
681  m_t << "}\n";
683  if (indentLevel()==0) m_t << "\\par\n";
684 }
685 
687 {
688  if (m_hide) return;
689  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocAutoListItem)}\n");
690  if (!m_lastIsPara) m_t << "\\par\n";
691  m_t << rtf_Style_Reset;
692  int level = indentLevel();
693  if (m_listItemInfo[level].isEnum)
694  {
695  m_t << getStyle("ListEnum") << "\n";
696  m_t << m_listItemInfo[level].number << ".\\tab ";
697  m_listItemInfo[level].number++;
698  }
699  else
700  {
701  m_t << getStyle("ListBullet") << "\n";
702  }
703  incIndentLevel();
705 }
706 
708 {
709  decIndentLevel();
710  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocAutoListItem)}\n");
711 }
712 
714 {
715  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
716 }
717 
719 {
720  if (m_hide) return;
721  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n");
722  if (!m_lastIsPara &&
723  !p->isLast() && // omit <p> for last paragraph
724  !(p->parent() && // and for parameters & sections
726  )
727  )
728  {
729  m_t << "\\par\n";
731  }
732 }
733 
735 {
736  if (m_hide) return;
737  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRoot)}\n");
738  if (r->indent()) incIndentLevel();
739  m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
740 }
741 
743 {
744  if (m_hide) return;
745  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRoot)}\n");
746  if (!m_lastIsPara && !r->singleLine()) m_t << "\\par\n";
747  m_t << "}";
749  if (r->indent()) decIndentLevel();
750 }
751 
753 {
754  if (m_hide) return;
755  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
756  if (!m_lastIsPara) m_t << "\\par\n";
757  m_t << "{"; // start desc
758  //m_t << "{\\b "; // start bold
759  m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
760  switch(s->type())
761  {
762  case DocSimpleSect::See:
763  m_t << theTranslator->trSeeAlso(); break;
765  m_t << theTranslator->trReturns(); break;
767  m_t << theTranslator->trAuthor(TRUE,TRUE); break;
769  m_t << theTranslator->trAuthor(TRUE,FALSE); break;
771  m_t << theTranslator->trVersion(); break;
773  m_t << theTranslator->trSince(); break;
774  case DocSimpleSect::Date:
775  m_t << theTranslator->trDate(); break;
776  case DocSimpleSect::Note:
777  m_t << theTranslator->trNote(); break;
779  m_t << theTranslator->trWarning(); break;
780  case DocSimpleSect::Pre:
781  m_t << theTranslator->trPrecondition(); break;
782  case DocSimpleSect::Post:
783  m_t << theTranslator->trPostcondition(); break;
785  m_t << theTranslator->trCopyright(); break;
787  m_t << theTranslator->trInvariant(); break;
789  m_t << theTranslator->trRemarks(); break;
791  m_t << theTranslator->trAttention(); break;
792  case DocSimpleSect::User: break;
793  case DocSimpleSect::Rcs: break;
794  case DocSimpleSect::Unknown: break;
795  }
796 
797  // special case 1: user defined title
798  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
799  {
800  m_t << "\\par";
801  m_t << "}"; // end bold
802  incIndentLevel();
803  m_t << rtf_Style_Reset << getStyle("DescContinue");
804  m_t << "{\\s17 \\sa60 \\sb30\n";
805  }
807 }
808 
810 {
811  if (m_hide) return;
812  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
813  if (!m_lastIsPara) m_t << "\\par\n";
814  decIndentLevel();
815  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) m_t << "}";
816  m_t << "}"; // end desc
818 }
819 
821 {
822  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocTitle)}\n");
823 }
824 
826 {
827  if (m_hide) return;
828  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocTitle)}\n");
829  m_t << "\\par\n";
830  m_t << "}"; // end bold
831  incIndentLevel();
832  m_t << rtf_Style_Reset << getStyle("DescContinue");
834 }
835 
837 {
838  if (m_hide) return;
839  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n");
840  m_t << "{\n";
843 }
844 
846 {
847  if (m_hide) return;
848  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleSect)}\n");
849  if (!m_lastIsPara) m_t << "\\par\n";
850  m_t << "}\n";
852 }
853 
855 {
856  if (m_hide) return;
857  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleListItem)}\n");
858  m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
860  incIndentLevel();
861 }
862 
864 {
865  decIndentLevel();
866  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
867 }
868 
870 {
871  if (m_hide) return;
872  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSection)}\n");
873  if (!m_lastIsPara) m_t << "\\par\n";
874  m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(s->file())+"_"+s->anchor()) << "}\n";
875  m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(s->file())+"_"+s->anchor()) << "}\n";
876  m_t << "{{" // start section
877  << rtf_Style_Reset;
878  QCString heading;
879  int level = std::min(s->level()+1,4);
880  heading.sprintf("Heading%d",level);
881  // set style
882  m_t << rtf_Style[heading.str()].reference() << "\n";
883  // make table of contents entry
884  filter(s->title());
885  m_t << "\n\\par" << "}\n";
886  m_t << "{\\tc\\tcl" << level << " \\v ";
887  filter(s->title());
888  m_t << "}\n";
890 }
891 
893 {
894  if (m_hide) return;
895  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSection)}\n");
896  m_t << "\\par}\n"; // end section
898 }
899 
901 {
902  if (m_hide) return;
903  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlList)}\n");
904  m_t << "{\n";
905  int level = indentLevel();
907  m_listItemInfo[level].number = 1;
908  m_listItemInfo[level].type = '1';
909  for (const auto &opt : l->attribs())
910  {
911  if (opt.name=="type")
912  {
913  m_listItemInfo[level].type = opt.value[0];
914  }
915  if (opt.name=="start")
916  {
917  bool ok;
918  int val = opt.value.toInt(&ok);
919  if (ok) m_listItemInfo[level].number = val;
920  }
921  }
923 }
924 
926 {
927  if (m_hide) return;
928  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlList)}\n");
929  m_t << "\\par" << "}\n";
931 }
932 
934 {
935  if (m_hide) return;
936  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlListItem)}\n");
937  m_t << "\\par\n";
938  m_t << rtf_Style_Reset;
939  int level = indentLevel();
940  if (m_listItemInfo[level].isEnum)
941  {
942  for (const auto &opt : l->attribs())
943  {
944  if (opt.name=="value")
945  {
946  bool ok;
947  int val = opt.value.toInt(&ok);
948  if (ok) m_listItemInfo[level].number = val;
949  }
950  }
951  m_t << getStyle("ListEnum") << "\n";
952  switch (m_listItemInfo[level].type)
953  {
954  case '1':
955  m_t << m_listItemInfo[level].number;
956  break;
957  case 'a':
958  m_t << integerToAlpha(m_listItemInfo[level].number,false);
959  break;
960  case 'A':
961  m_t << integerToAlpha(m_listItemInfo[level].number);
962  break;
963  case 'i':
964  m_t << integerToRoman(m_listItemInfo[level].number,false);
965  break;
966  case 'I':
967  m_t << integerToRoman(m_listItemInfo[level].number);
968  break;
969  default:
970  m_t << m_listItemInfo[level].number;
971  break;
972  }
973  m_t << ".\\tab ";
974  m_listItemInfo[level].number++;
975  }
976  else
977  {
978  m_t << getStyle("ListBullet") << "\n";
979  }
980  incIndentLevel();
982 }
983 
985 {
986  decIndentLevel();
987  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
988 }
989 
991 {
992  if (m_hide) return;
993  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescList)}\n");
994  //m_t << "{\n";
995  //m_t << rtf_Style_Reset << getStyle("ListContinue");
996  //m_lastIsPara=FALSE;
997 }
998 
1000 {
1001  if (m_hide) return;
1002  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescList)}\n");
1003  //m_t << "}\n";
1004  //m_t << "\\par\n";
1005  //m_lastIsPara=TRUE;
1006 }
1007 
1009 {
1010  if (m_hide) return;
1011  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescTitle)}\n");
1012  //m_t << "\\par\n";
1013  //m_t << "{\\b ";
1014  m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1016 }
1017 
1019 {
1020  if (m_hide) return;
1021  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescTitle)}\n");
1022  m_t << "\\par\n";
1023  m_t << "}\n";
1025 }
1026 
1028 {
1029  if (m_hide) return;
1030  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlDescData)}\n");
1031  incIndentLevel();
1032  m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
1033 }
1034 
1036 {
1037  if (m_hide) return;
1038  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlDescData)}\n");
1039  m_t << "\\par";
1040  m_t << "}\n";
1041  decIndentLevel();
1043 }
1044 
1046 {
1047  if (m_hide) return;
1048  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlTable)}\n");
1049  if (!m_lastIsPara) m_t << "\\par\n";
1051 }
1052 
1054 {
1055  if (m_hide) return;
1056  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlTable)}\n");
1057  m_t << "\\pard\\plain\n";
1058  m_t << "\\par\n";
1060 }
1061 
1063 {
1064  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCaption)}\n");
1065  m_t << "\\pard \\qc \\b";
1066  m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1067 }
1068 
1070 {
1071  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n");
1072  m_t << "}\n\\par\n";
1073 }
1074 
1076 {
1077  if (m_hide) return;
1078  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n");
1079  uint i,columnWidth=(uint)r->numCells()>0 ? rtf_pageWidth/(uint)r->numCells() : 10;
1080  m_t << "\\trowd \\trgaph108\\trleft-108"
1081  "\\trbrdrt\\brdrs\\brdrw10 "
1082  "\\trbrdrl\\brdrs\\brdrw10 "
1083  "\\trbrdrb\\brdrs\\brdrw10 "
1084  "\\trbrdrr\\brdrs\\brdrw10 "
1085  "\\trbrdrh\\brdrs\\brdrw10 "
1086  "\\trbrdrv\\brdrs\\brdrw10 \n";
1087  for (i=0;i<r->numCells();i++)
1088  {
1089  if (r->isHeading())
1090  {
1091  m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
1092  }
1093  m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
1094  "\\clbrdrl\\brdrs\\brdrw10 "
1095  "\\clbrdrb\\brdrs\\brdrw10 "
1096  "\\clbrdrr \\brdrs\\brdrw10 "
1097  "\\cltxlrtb "
1098  "\\cellx" << ((i+1)*columnWidth) << "\n";
1099  }
1100  m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1102 }
1103 
1105 {
1106  if (m_hide) return;
1107  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlRow)}\n");
1108  m_t << "\n";
1109  m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1110  m_t << "{\\row }\n";
1112 }
1113 
1115 {
1116  if (m_hide) return;
1117  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlCell)}\n");
1118  m_t << "{" << align(c);
1120 }
1121 
1123 {
1124  if (m_hide) return;
1125  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCell)}\n");
1126  m_t << "\\cell }";
1128 }
1129 
1131 {
1132  if (m_hide) return;
1133  //DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocInternal)}\n");
1134  //m_t << "{"; // start desc
1135  //m_t << "{\\b "; // start bold
1136  //m_t << theTranslator->trForInternalUseOnly();
1137  //m_t << "}"; // end bold
1138  //m_t << "\\par\n";
1139  //incIndentLevel();
1140  //m_t << rtf_Style_Reset << getStyle("DescContinue");
1141  //m_lastIsPara=FALSE;
1142 }
1143 
1145 {
1146  if (m_hide) return;
1147  //DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternal)}\n");
1148  //m_t << "\\par";
1149  //decIndentLevel();
1150  //m_t << "}"; // end desc
1151  //m_lastIsPara=TRUE;
1152 }
1153 
1155 {
1156  if (m_hide) return;
1157  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n");
1158  if (Config_getBool(RTF_HYPERLINKS))
1159  {
1160  if (href->url().startsWith("#"))
1161  {
1162  // when starting with # so a local link
1163  QCString cite;
1164  cite = href->file() + "_" + href->url().right(href->url().length()-1);
1165  m_t << "{\\field "
1166  "{\\*\\fldinst "
1167  "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
1168  "}{}"
1169  "}"
1170  "{\\fldrslt "
1171  "{\\cs37\\ul\\cf2 ";
1172  }
1173  else
1174  {
1175  m_t << "{\\field "
1176  "{\\*\\fldinst "
1177  "{ HYPERLINK \"" << href->url() << "\" "
1178  "}{}"
1179  "}"
1180  "{\\fldrslt "
1181  "{\\cs37\\ul\\cf2 ";
1182  }
1183  }
1184  else
1185  {
1186  m_t << "{\\f2 ";
1187  }
1189 }
1190 
1192 {
1193  if (m_hide) return;
1194  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHRef)}\n");
1195  if (Config_getBool(RTF_HYPERLINKS))
1196  {
1197  m_t << "}"
1198  "}"
1199  "}";
1200  }
1201  else
1202  {
1203  m_t << "}";
1204  }
1206 }
1207 
1209 {
1210  if (m_hide) return;
1211  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlHeader)}\n");
1212  m_t << "{" // start section
1213  << rtf_Style_Reset;
1214  QCString heading;
1215  int level = std::min(header->level(),5);
1216  heading.sprintf("Heading%d",level);
1217  // set style
1218  m_t << rtf_Style[heading.str()].reference();
1219  // make open table of contents entry that will be closed in visitPost method
1220  m_t << "{\\tc\\tcl" << level << " ";
1222 }
1223 
1225 {
1226  if (m_hide) return;
1227  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n");
1228  // close open table of contents entry
1229  m_t << "} \\par";
1230  m_t << "}\n"; // end section
1232 }
1233 
1235 {
1236  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocImage)}\n");
1237  includePicturePreRTF(img->name(), img->type()==DocImage::Rtf, img->hasCaption(), img->isInlineImage());
1238 }
1239 void RTFDocVisitor::includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage)
1240 {
1241  if (isTypeRTF)
1242  {
1243  if (!inlineImage)
1244  {
1245  m_t << "\\par\n";
1246  m_t << "{\n";
1247  m_t << rtf_Style_Reset << "\n";
1248  if (hasCaption || m_lastIsPara) m_t << "\\par\n";
1249  m_t << "\\pard \\qc ";
1250  }
1251  m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1252  m_t << name;
1253  m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
1254  if (!inlineImage)
1255  {
1256  m_t << "\\par\n";
1257  if (hasCaption)
1258  {
1259  m_t << "\\pard \\qc \\b";
1260  m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1261  }
1263  }
1264  else
1265  {
1266  if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown
1267  }
1268  }
1269  else // other format -> skip
1270  {
1271  pushHidden(m_hide);
1272  m_hide=TRUE;
1273  }
1274 }
1275 
1277 {
1278  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocImage)}\n");
1280 }
1281 
1282 void RTFDocVisitor::includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage)
1283 {
1284  if (isTypeRTF)
1285  {
1286  if (m_hide) return;
1287  if (inlineImage)
1288  {
1289  if (hasCaption) m_t << " }";
1290  }
1291  else
1292  {
1293  if (hasCaption)
1294  {
1295  m_t << "}\n";
1296  m_t << "\\par}\n";
1297  }
1298  else
1299  {
1300  m_t << "}\n";
1301  }
1302  }
1303  }
1304  else
1305  {
1306  m_hide = popHidden();
1307  }
1308 }
1309 
1311 {
1312  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocDotFile)}\n");
1313  writeDotFile(df);
1314 }
1315 
1317 {
1318  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDotFile)}\n");
1319  includePicturePostRTF(true, df->hasCaption());
1320 }
1322 {
1323  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocMscFile)}\n");
1324  writeMscFile(df);
1325 }
1326 
1328 {
1329  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocMscFile)}\n");
1330  includePicturePostRTF(true, df->hasCaption());
1331 }
1332 
1334 {
1335  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocDiaFile)}\n");
1336  writeDiaFile(df);
1337 }
1338 
1340 {
1341  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocDiaFile)}\n");
1342  includePicturePostRTF(true, df->hasCaption());
1343 }
1344 
1346 {
1347  if (m_hide) return;
1348  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLink)}\n");
1349  startLink(lnk->ref(),lnk->file(),lnk->anchor());
1350 }
1351 
1353 {
1354  if (m_hide) return;
1355  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLink)}\n");
1356  endLink(lnk->ref());
1357 }
1358 
1360 {
1361  if (m_hide) return;
1362  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRef)}\n");
1363  // when ref->isSubPage()==TRUE we use ref->file() for HTML and
1364  // ref->anchor() for LaTeX/RTF
1365  if (ref->isSubPage())
1366  {
1367  startLink(ref->ref(),QCString(),ref->anchor());
1368  }
1369  else
1370  {
1371  if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor());
1372  }
1373  if (!ref->hasLinkText()) filter(ref->targetTitle());
1374 }
1375 
1377 {
1378  if (m_hide) return;
1379  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocRef)}\n");
1380  if (!ref->file().isEmpty()) endLink(ref->ref());
1381  //m_t << " ";
1382 }
1383 
1384 
1386 {
1387  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefItem)}\n");
1388 }
1389 
1391 {
1392  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefItem)}\n");
1393 }
1394 
1396 {
1397  if (m_hide) return;
1398  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefList)}\n");
1399  m_t << "{\n";
1400  incIndentLevel();
1401  m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
1402  m_t << "\\par\n";
1404 }
1405 
1407 {
1408  if (m_hide) return;
1409  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n");
1410  decIndentLevel();
1411  m_t << "\\par";
1412  m_t << "}\n";
1414 }
1415 
1417 {
1418  if (m_hide) return;
1419  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamSect)}\n");
1420  m_t << "{"; // start param list
1421  if (!m_lastIsPara) m_t << "\\par\n";
1422  //m_t << "{\\b "; // start bold
1423  m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1424  switch(s->type())
1425  {
1426  case DocParamSect::Param:
1427  m_t << theTranslator->trParameters(); break;
1428  case DocParamSect::RetVal:
1429  m_t << theTranslator->trReturnValues(); break;
1431  m_t << theTranslator->trExceptions(); break;
1433  m_t << theTranslator->trTemplateParameters(); break;
1434  default:
1435  ASSERT(0);
1436  }
1437  m_t << "\\par";
1438  m_t << "}\n";
1439  bool useTable = s->type()==DocParamSect::Param ||
1440  s->type()==DocParamSect::RetVal ||
1441  s->type()==DocParamSect::Exception ||
1443  if (!useTable)
1444  {
1445  incIndentLevel();
1446  }
1447  m_t << rtf_Style_Reset << getStyle("DescContinue");
1449 }
1450 
1452 {
1453  if (m_hide) return;
1454  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamSect)}\n");
1455  //m_t << "\\par\n";
1456  bool useTable = s->type()==DocParamSect::Param ||
1457  s->type()==DocParamSect::RetVal ||
1458  s->type()==DocParamSect::Exception ||
1460  if (!useTable)
1461  {
1462  decIndentLevel();
1463  }
1464  m_t << "}\n";
1465 }
1466 
1468 {
1469  static int columnPos[4][5] =
1470  { { 2, 25, 100, 100, 100 }, // no inout, no type
1471  { 3, 14, 35, 100, 100 }, // inout, no type
1472  { 3, 25, 50, 100, 100 }, // no inout, type
1473  { 4, 14, 35, 55, 100 }, // inout, type
1474  };
1475  int config=0;
1476  if (m_hide) return;
1477  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamList)}\n");
1478 
1480  DocParamSect *sect = 0;
1481  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1482  {
1483  parentType = ((DocParamSect*)pl->parent())->type();
1484  sect=(DocParamSect*)pl->parent();
1485  }
1486  bool useTable = parentType==DocParamSect::Param ||
1487  parentType==DocParamSect::RetVal ||
1488  parentType==DocParamSect::Exception ||
1489  parentType==DocParamSect::TemplateParam;
1490  if (sect && sect->hasInOutSpecifier()) config+=1;
1491  if (sect && sect->hasTypeSpecifier()) config+=2;
1492  if (useTable)
1493  {
1494  int i;
1495  m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
1496  "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1497  "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1498  "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1499  "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
1500  "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
1501  "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< "\n";
1502  for (i=0;i<columnPos[config][0];i++)
1503  {
1504  m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1505  "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1506  "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1507  "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
1508  "\\cltxlrtb "
1509  "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << "\n";
1510  }
1511  m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1512  }
1513 
1514  if (sect && sect->hasInOutSpecifier())
1515  {
1516  if (useTable)
1517  {
1518  m_t << "{";
1519  }
1520 
1521  // Put in the direction: in/out/in,out if specified.
1523  {
1524  if (pl->direction()==DocParamSect::In)
1525  {
1526  m_t << "in";
1527  }
1528  else if (pl->direction()==DocParamSect::Out)
1529  {
1530  m_t << "out";
1531  }
1532  else if (pl->direction()==DocParamSect::InOut)
1533  {
1534  m_t << "in,out";
1535  }
1536  }
1537 
1538  if (useTable)
1539  {
1540  m_t << "\\cell }";
1541  }
1542  }
1543 
1544  if (sect && sect->hasTypeSpecifier())
1545  {
1546  if (useTable)
1547  {
1548  m_t << "{";
1549  }
1550  for (const auto &type : pl->paramTypes())
1551  {
1552  if (type->kind()==DocNode::Kind_Word)
1553  {
1554  visit((DocWord*)type.get());
1555  }
1556  else if (type->kind()==DocNode::Kind_LinkedWord)
1557  {
1558  visit((DocLinkedWord*)type.get());
1559  }
1560  else if (type->kind()==DocNode::Kind_Sep)
1561  {
1562  m_t << " " << ((DocSeparator *)type.get())->chars() << " ";
1563  }
1564  }
1565  if (useTable)
1566  {
1567  m_t << "\\cell }";
1568  }
1569  }
1570 
1571 
1572  if (useTable)
1573  {
1574  m_t << "{";
1575  }
1576 
1577  m_t << "{\\i ";
1578  bool first=TRUE;
1579  for (const auto &param : pl->parameters())
1580  {
1581  if (!first) m_t << ","; else first=FALSE;
1582  if (param->kind()==DocNode::Kind_Word)
1583  {
1584  visit((DocWord*)param.get());
1585  }
1586  else if (param->kind()==DocNode::Kind_LinkedWord)
1587  {
1588  visit((DocLinkedWord*)param.get());
1589  }
1590  }
1591  m_t << "} ";
1592 
1593  if (useTable)
1594  {
1595  m_t << "\\cell }{";
1596  }
1598 }
1599 
1601 {
1602  if (m_hide) return;
1603  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamList)}\n");
1604 
1606  //DocParamSect *sect = 0;
1607  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1608  {
1609  parentType = ((DocParamSect*)pl->parent())->type();
1610  //sect=(DocParamSect*)pl->parent();
1611  }
1612  bool useTable = parentType==DocParamSect::Param ||
1613  parentType==DocParamSect::RetVal ||
1614  parentType==DocParamSect::Exception ||
1615  parentType==DocParamSect::TemplateParam;
1616  if (useTable)
1617  {
1618  m_t << "\\cell }\n";
1619  //m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1620  m_t << "{\\row }\n";
1621  }
1622  else
1623  {
1624  m_t << "\\par\n";
1625  }
1626 
1628 }
1629 
1631 {
1632  if (m_hide) return;
1633  if (x->title().isEmpty()) return;
1634  bool anonymousEnum = x->file()=="@";
1635  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n");
1636  if (!m_lastIsPara)
1637  {
1638  m_t << "\\par\n";
1640  }
1641  m_t << "{"; // start param list
1642  //m_t << "{\\b "; // start bold
1643  m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1644  if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1645  {
1646  QCString refName;
1647  if (!x->file().isEmpty())
1648  {
1649  refName+=stripPath(x->file());
1650  }
1651  if (!x->file().isEmpty() && !x->anchor().isEmpty())
1652  {
1653  refName+="_";
1654  }
1655  if (!x->anchor().isEmpty())
1656  {
1657  refName+=x->anchor();
1658  }
1659 
1660  m_t << "{\\field "
1661  "{\\*\\fldinst "
1662  "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1663  "}{}"
1664  "}"
1665  "{\\fldrslt "
1666  "{\\cs37\\ul\\cf2 ";
1667  filter(x->title());
1668  m_t << "}"
1669  "}"
1670  "}";
1671  }
1672  else
1673  {
1674  filter(x->title());
1675  }
1676  m_t << ":";
1677  m_t << "\\par";
1678  m_t << "}"; // end bold
1679  incIndentLevel();
1680  m_t << rtf_Style_Reset << getStyle("DescContinue");
1682 }
1683 
1685 {
1686  if (m_hide) return;
1687  if (x->title().isEmpty()) return;
1688  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1689  m_t << "\\par\n";
1690  decIndentLevel();
1691  m_t << "}\n"; // end xref item
1693 }
1694 
1696 {
1697  if (m_hide) return;
1698  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocInternalRef)}\n");
1699  startLink("",ref->file(),ref->anchor());
1700 }
1701 
1703 {
1704  if (m_hide) return;
1705  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocInternalRef)}\n");
1706  endLink("");
1707  m_t << " ";
1708 }
1709 
1711 {
1712  if (m_hide) return;
1713  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocText)}\n");
1714 }
1715 
1717 {
1718  if (m_hide) return;
1719  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocText)}\n");
1720 }
1721 
1723 {
1724  if (m_hide) return;
1725  DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlBlockQuote)}\n");
1726  if (!m_lastIsPara) m_t << "\\par\n";
1727  m_t << "{"; // start desc
1728  incIndentLevel();
1729  m_t << rtf_Style_Reset << getStyle("DescContinue");
1730 }
1731 
1733 {
1734  if (m_hide) return;
1735  DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlBlockQuote)}\n");
1736  if (!m_lastIsPara) m_t << "\\par\n";
1737  decIndentLevel();
1738  m_t << "}"; // end desc
1740 }
1741 
1743 {
1744  if (m_hide) return;
1745 }
1746 
1748 {
1749  if (m_hide) return;
1750 }
1751 
1753 {
1754  if (m_hide) return;
1755 }
1756 
1758 {
1759  if (m_hide) return;
1760 }
1761 
1762 
1763 //static char* getMultiByte(int c)
1764 //{
1765 // static char s[10];
1766 // sprintf(s,"\\'%X",c);
1767 // return s;
1768 //}
1769 
1770 void RTFDocVisitor::filter(const QCString &str,bool verbatim)
1771 {
1772  if (!str.isEmpty())
1773  {
1774  const unsigned char *p=(const unsigned char *)str.data();
1775  unsigned char c;
1776  //unsigned char pc='\0';
1777  while (*p)
1778  {
1779  //static bool MultiByte = FALSE;
1780  c=*p++;
1781 
1782  //if ( MultiByte )
1783  //{
1784  // m_t << getMultiByte( c );
1785  // MultiByte = FALSE;
1786  // continue;
1787  //}
1788  //if ( c >= 0x80 )
1789  //{
1790  // MultiByte = TRUE;
1791  // m_t << getMultiByte( c );
1792  // continue;
1793  //}
1794 
1795  switch (c)
1796  {
1797  case '{': m_t << "\\{"; break;
1798  case '}': m_t << "\\}"; break;
1799  case '\\': m_t << "\\\\"; break;
1800  case '\n': if (verbatim)
1801  {
1802  m_t << "\\par\n";
1803  }
1804  else
1805  {
1806  m_t << '\n';
1807  }
1808  break;
1809  default: m_t << (char)c;
1810  }
1811  //pc = c;
1812  }
1813  }
1814 }
1815 
1816 void RTFDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor)
1817 {
1818  if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1819  {
1820  QCString refName;
1821  if (!file.isEmpty())
1822  {
1823  refName+=stripPath(file);
1824  }
1825  if (!file.isEmpty() && !anchor.isEmpty())
1826  {
1827  refName+='_';
1828  }
1829  if (!anchor.isEmpty())
1830  {
1831  refName+=anchor;
1832  }
1833 
1834  m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1835  m_t << rtfFormatBmkStr(refName);
1836  m_t << "\" }{}";
1837  m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1838  }
1839  else
1840  {
1841  m_t << "{\\b ";
1842  }
1844 }
1845 
1847 {
1848  if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1849  {
1850  m_t << "}}}";
1851  }
1852  else
1853  {
1854  m_t << "}";
1855  }
1857 }
1858 
1860 {
1861  writeDotFile(df->file(), df->hasCaption(), df->srcFile(), df->srcLine());
1862 }
1863 void RTFDocVisitor::writeDotFile(const QCString &filename, bool hasCaption,
1864  const QCString &srcFile, int srcLine)
1865 {
1866  QCString baseName=filename;
1867  int i;
1868  if ((i=baseName.findRev('/'))!=-1)
1869  {
1870  baseName=baseName.right(baseName.length()-i-1);
1871  }
1872  QCString outDir = Config_getString(RTF_OUTPUT);
1873  writeDotGraphFromFile(filename,outDir,baseName,GOF_BITMAP,srcFile,srcLine);
1874  QCString imgExt = getDotImageExtension();
1875  includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1876 }
1877 
1879 {
1880  writeMscFile(df->file(), df->hasCaption(), df->srcFile(), df->srcLine());
1881 }
1882 void RTFDocVisitor::writeMscFile(const QCString &fileName, bool hasCaption,
1883  const QCString &srcFile, int srcLine)
1884 {
1885  QCString baseName=fileName;
1886  int i;
1887  if ((i=baseName.findRev('/'))!=-1)
1888  {
1889  baseName=baseName.right(baseName.length()-i-1);
1890  }
1891  QCString outDir = Config_getString(RTF_OUTPUT);
1892  writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP,srcFile,srcLine);
1893  includePicturePreRTF(baseName + ".png", true, hasCaption);
1894 }
1895 
1897 {
1898  QCString baseName=df->file();
1899  int i;
1900  if ((i=baseName.findRev('/'))!=-1)
1901  {
1902  baseName=baseName.right(baseName.length()-i-1);
1903  }
1904  QCString outDir = Config_getString(RTF_OUTPUT);
1905  writeDiaGraphFromFile(df->file(),outDir,baseName,DIA_BITMAP,df->srcFile(),df->srcLine());
1906  includePicturePreRTF(baseName + ".png", true, df->hasCaption());
1907 }
1908 
1909 void RTFDocVisitor::writePlantUMLFile(const QCString &fileName, bool hasCaption)
1910 {
1911  QCString baseName=fileName;
1912  int i;
1913  if ((i=baseName.findRev('/'))!=-1)
1914  {
1915  baseName=baseName.right(baseName.length()-i-1);
1916  }
1917  QCString outDir = Config_getString(RTF_OUTPUT);
1919  includePicturePreRTF(baseName + ".png", true, hasCaption);
1920 }
DocHtmlBlockQuote
Node representing an HTML blockquote
Definition: docparser.h:1433
DocAutoListItem
Node representing an item of a auto list
Definition: docparser.h:720
writeDiaGraphFromFile
void writeDiaGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, DiaOutputFormat format, const QCString &srcFile, int srcLine)
Definition: dia.cpp:26
PlantumlManager::writePlantUMLSource
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content, OutputFormat format, const QCString &engine, const QCString &srcFile, int srcLine)
Write a PlantUML compatible file.
Definition: plantuml.cpp:26
getDotImageExtension
QCString getDotImageExtension()
Definition: util.cpp:7032
DocHRef
Node representing a Hypertext reference
Definition: docparser.h:936
DocStyleChange
Node representing a style change
Definition: docparser.h:343
DocVerbatim::isExample
bool isExample() const
Definition: docparser.h:522
DocVerbatim
Node representing a verbatim, unparsed text fragment
Definition: docparser.h:510
Translator::trCopyright
virtual QCString trCopyright()=0
integerToRoman
QCString integerToRoman(int n, bool upper)
Definition: util.cpp:7363
DocParamList::paramTypes
DocNodeList & paramTypes()
Definition: docparser.h:1239
DocTitle
Node representing a simple section title
Definition: docparser.h:736
DocXRefItem::file
QCString file() const
Definition: docparser.h:754
Translator::trPostcondition
virtual QCString trPostcondition()=0
DocPara
Node representing a paragraph in the documentation tree
Definition: docparser.h:1178
DocImage::isInlineImage
bool isInlineImage() const
Definition: docparser.h:785
fileinfo.h
DocInclude::HtmlInclude
@ HtmlInclude
Definition: docparser.h:566
DocParamSect::In
@ In
Definition: docparser.h:1160
RTFDocVisitor::startLink
void startLink(const QCString &ref, const QCString &file, const QCString &anchor)
Definition: rtfdocvisitor.cpp:1816
DocSimpleSect::Return
@ Return
Definition: docparser.h:1116
DocVerbatim::text
QCString text() const
Definition: docparser.h:519
DocDotFile
Node representing a dot file
Definition: docparser.h:830
DocVisitor::pushHidden
void pushHidden(bool hide)
Definition: docvisitor.cpp:62
rtfstyle.h
DocHtmlTable
Node representing a HTML table
Definition: docparser.h:1405
Translator::trNote
virtual QCString trNote()=0
DocIncOperator::showLineNo
bool showLineNo() const
Definition: docparser.h:629
DocSimpleSect::Warning
@ Warning
Definition: docparser.h:1117
Dir::remove
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Definition: dir.cpp:256
Dir
Class representing a directory in the file system
Definition: dir.h:68
DocNode::Kind_Word
@ Kind_Word
Definition: docparser.h:101
RTFDocVisitor::endLink
void endLink(const QCString &ref)
Definition: rtfdocvisitor.cpp:1846
DocRoot
Root node of documentation tree
Definition: docparser.h:1457
DocVerbatim::HtmlOnly
@ HtmlOnly
Definition: docparser.h:513
RTFDocVisitor::m_hide
bool m_hide
Definition: rtfdocvisitor.h:171
QCString::length
uint length() const
Returns the length of the string, not counting the 0-terminator.
Definition: qcstring.h:147
DocStyleChange::Center
@ Center
Definition: docparser.h:349
DocImage::hasCaption
bool hasCaption() const
Definition: docparser.h:780
DocVisitor::popHidden
bool popHidden()
Definition: docvisitor.cpp:67
DocHtmlHeader
Node Html heading
Definition: docparser.h:957
DIA_BITMAP
@ DIA_BITMAP
Definition: dia.h:23
DocParamSect::Out
@ Out
Definition: docparser.h:1160
DocSimpleSect::Unknown
@ Unknown
Definition: docparser.h:1116
DocStyleChange::Strike
@ Strike
Definition: docparser.h:356
DocVerbatim::context
QCString context() const
Definition: docparser.h:520
QCString::findRev
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:86
DocParamSect::InOut
@ InOut
Definition: docparser.h:1160
Translator::trExceptions
virtual QCString trExceptions()=0
DocInclude::Snippet
@ Snippet
Definition: docparser.h:567
DocHtmlListItem
Node representing a HTML list item
Definition: docparser.h:1286
QCString::isEmpty
bool isEmpty() const
Returns TRUE iff the string is empty
Definition: qcstring.h:144
RTFDocVisitor::writePlantUMLFile
void writePlantUMLFile(const QCString &fileName, bool hasCaption)
Definition: rtfdocvisitor.cpp:1909
DocStyleChange::Del
@ Del
Definition: docparser.h:358
DocRef::isSubPage
bool isSubPage() const
Definition: docparser.h:906
DocVhdlFlow
Node representing a VHDL flow chart
Definition: docparser.h:860
DocInclude::isExample
bool isExample() const
Definition: docparser.h:588
DocVerbatim::Msc
@ Msc
Definition: docparser.h:513
MSC_BITMAP
@ MSC_BITMAP
Definition: msc.h:22
DocHRef::file
QCString file() const
Definition: docparser.h:944
DocDiagramFileBase::file
QCString file() const
Definition: docparser.h:809
DocHtmlDescData
Node representing a HTML description data
Definition: docparser.h:1303
DocSimpleSect::type
Type type() const
Definition: docparser.h:1122
rtf_Style_Reset
char rtf_Style_Reset[]
Definition: rtfstyle.cpp:49
DocHtmlDescTitle
Node representing a Html description item
Definition: docparser.h:973
DocAnchor::anchor
QCString anchor() const
Definition: docparser.h:308
DocInclude::XmlInclude
@ XmlInclude
Definition: docparser.h:568
DocVerbatim::PlantUML
@ PlantUML
Definition: docparser.h:513
msc.h
DocEmoji
Node representing a n emoji
Definition: docparser.h:469
DocRef::ref
QCString ref() const
Definition: docparser.h:899
DocLinkedWord::anchor
QCString anchor() const
Definition: docparser.h:242
DocInternalRef::anchor
QCString anchor() const
Definition: docparser.h:927
DocStyleChange::Italic
@ Italic
Definition: docparser.h:347
DocMscFile
Node representing a msc file
Definition: docparser.h:840
SrcLangExt
SrcLangExt
Language as given by extension
Definition: types.h:41
Translator::trReturns
virtual QCString trReturns()=0
DocHtmlRow::isHeading
bool isHeading() const
Definition: docparser.h:1382
align
static QCString align(DocHtmlCell *cell)
Definition: rtfdocvisitor.cpp:44
DocVerbatim::Code
@ Code
Definition: docparser.h:513
DocStyleChange::Bold
@ Bold
Definition: docparser.h:346
RTFDocVisitor::writeMscFile
void writeMscFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
Definition: rtfdocvisitor.cpp:1882
DocRef::targetTitle
QCString targetTitle() const
Definition: docparser.h:901
DocInclude::IncludeDoc
@ IncludeDoc
Definition: docparser.h:567
DocRef::anchor
QCString anchor() const
Definition: docparser.h:900
DocEmoji::name
QCString name() const
Definition: docparser.h:473
DocVerbatim::RtfOnly
@ RtfOnly
Definition: docparser.h:513
QCString::str
std::string str() const
Definition: qcstring.h:442
DocIncOperator::exampleFile
QCString exampleFile() const
Definition: docparser.h:639
DocParamSect::TemplateParam
@ TemplateParam
Definition: docparser.h:1156
DocVerbatim::type
Type type() const
Definition: docparser.h:518
DocIndexEntry::entry
QCString entry() const
Definition: docparser.h:691
DocSecRefItem
Node representing a reference to a section
Definition: docparser.h:1023
DocStyleChange::Span
@ Span
Definition: docparser.h:354
PlantumlManager::instance
static PlantumlManager & instance()
Definition: plantuml.cpp:124
DocAnchor
Node representing an anchor
Definition: docparser.h:303
DocXRefItem::anchor
QCString anchor() const
Definition: docparser.h:755
RTFDocVisitor::m_langExt
QCString m_langExt
Definition: rtfdocvisitor.h:173
RTFDocVisitor::m_indentLevel
int m_indentLevel
Definition: rtfdocvisitor.h:176
Translator::trPrecondition
virtual QCString trPrecondition()=0
DocRef::hasLinkText
bool hasLinkText() const
Definition: docparser.h:902
DocStyleChange::Superscript
@ Superscript
Definition: docparser.h:352
err
void err(const char *fmt,...)
Definition: message.cpp:203
DocInclude::text
QCString text() const
Definition: docparser.h:585
DocDiagramFileBase::srcLine
int srcLine() const
Definition: docparser.h:816
TextStream
Text streaming class that buffers data.
Definition: textstream.h:33
DocText
Root node of a text fragment
Definition: docparser.h:1447
DocHtmlList::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1101
DocVisitor
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:92
DocSimpleSect::Author
@ Author
Definition: docparser.h:1116
DocSimpleSect::Note
@ Note
Definition: docparser.h:1117
DocURL::isEmail
bool isEmail() const
Definition: docparser.h:264
DocInclude::DocbookInclude
@ DocbookInclude
Definition: docparser.h:568
RTFDocVisitor::m_lastIsPara
bool m_lastIsPara
Definition: rtfdocvisitor.h:172
DocImage::name
QCString name() const
Definition: docparser.h:779
DocInclude::DontInclude
@ DontInclude
Definition: docparser.h:566
HtmlEntityMapper::instance
static HtmlEntityMapper * instance()
Returns the one and only instance of the HTML entity mapper
Definition: htmlentity.cpp:341
DocVisitor_RTF
const int DocVisitor_RTF
Definition: docvisitor.h:27
DocInclude::VerbInclude
@ VerbInclude
Definition: docparser.h:566
DocIncOperator::isFirst
bool isFirst() const
Definition: docparser.h:634
DocFormula
Node representing an item of a cross-referenced list
Definition: docparser.h:658
DocVerbatim::DocbookOnly
@ DocbookOnly
Definition: docparser.h:513
DocLinkedWord::word
QCString word() const
Definition: docparser.h:237
DocHtmlDescList
Node representing a Html description list
Definition: docparser.h:987
RTFDocVisitor::incIndentLevel
void incIndentLevel()
Definition: rtfdocvisitor.cpp:76
DocVisitor::getCodeParser
CodeParserInterface & getCodeParser(const QCString &langExt)
Definition: docvisitor.cpp:41
DocIncOperator
Node representing a include/dontinclude operator block
Definition: docparser.h:606
DocSymbol::symbol
SymType symbol() const
Definition: docparser.h:459
DocHtmlList::Ordered
@ Ordered
Definition: docparser.h:1096
DocIndexEntry
Node representing an entry in the index.
Definition: docparser.h:682
DocSimpleSect::User
@ User
Definition: docparser.h:1117
DocSecRefList
Node representing a list of section references
Definition: docparser.h:1048
DocRoot::indent
bool indent() const
Definition: docparser.h:1463
Translator::trSeeAlso
virtual QCString trSeeAlso()=0
DocLineBreak
Node representing a line break
Definition: docparser.h:272
DocWord
Node representing a word
Definition: docparser.h:217
StyleData
Definition: rtfstyle.h:48
DocSymbol
Node representing a special symbol
Definition: docparser.h:385
uint
unsigned uint
Definition: qcstring.h:40
rtfFormatBmkStr
QCString rtfFormatBmkStr(const QCString &name)
Definition: util.cpp:5230
outputgen.h
dot.h
extractBlock
QCString extractBlock(const QCString &text, const QCString &marker)
Returns the section of text, in between a pair of markers.
Definition: util.cpp:6453
PlantumlManager::PUML_BITMAP
@ PUML_BITMAP
Definition: plantuml.h:44
EmojiEntityMapper::unicode
const char * unicode(int index) const
Access routine to the unicode sequence for the Emoji entity
Definition: emoji.cpp:1580
DocXRefItem
Node representing an item of a cross-referenced list
Definition: docparser.h:749
DocURL::url
QCString url() const
Definition: docparser.h:261
DocSection::level
int level() const
Definition: docparser.h:1007
createFileDef
FileDef * createFileDef(const QCString &p, const QCString &n, const QCString &ref, const QCString &dn)
Definition: filedef.cpp:190
DocImage
Node representing an image
Definition: docparser.h:771
rtf_Style
StyleDataMap rtf_Style
Definition: rtfstyle.cpp:313
DocHtmlCell::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1330
DocNode::kind
virtual Kind kind() const =0
DocInclude::file
QCString file() const
Definition: docparser.h:577
Translator::trVersion
virtual QCString trVersion()=0
DocNodeList
std::vector< std::unique_ptr< DocNode > > DocNodeList
Definition: docparser.h:190
DocURL
Node representing a URL (or email address)
Definition: docparser.h:256
message.h
writeDotGraphFromFile
void writeDotGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, GraphOutputFormat format, const QCString &srcFile, int srcLine)
Definition: dot.cpp:272
DocParamSect::Unspecified
@ Unspecified
Definition: docparser.h:1160
DocSimpleSect::See
@ See
Definition: docparser.h:1116
RTFDocVisitor::RTFListItemInfo::type
char type
Definition: rtfdocvisitor.h:181
DocHtmlCaption
Node representing a HTML table caption
Definition: docparser.h:1352
DocIncOperator::isExample
bool isExample() const
Definition: docparser.h:638
DocStyleChange::Ins
@ Ins
Definition: docparser.h:359
DocInclude::SnipWithLines
@ SnipWithLines
Definition: docparser.h:567
DocParamList
Node representing a parameter list.
Definition: docparser.h:1228
DocSimpleSect::Rcs
@ Rcs
Definition: docparser.h:1117
Translator::trAttention
virtual QCString trAttention()=0
DocRoot::singleLine
bool singleLine() const
Definition: docparser.h:1464
theTranslator
Translator * theTranslator
Definition: language.cpp:156
doxygen.h
DocSeparator
Node representing a separator
Definition: docparser.h:497
parserintf.h
DocCite::ref
QCString ref() const
Definition: docparser.h:328
DocInternalRef::file
QCString file() const
Definition: docparser.h:925
DocIncOperator::Skip
@ Skip
Definition: docparser.h:609
DocVerbatim::exampleFile
QCString exampleFile() const
Definition: docparser.h:523
RTFDocVisitor::visit
void visit(DocWord *)
Definition: rtfdocvisitor.cpp:94
DocParBlock
Node representing an block of paragraphs
Definition: docparser.h:1070
DocVerbatim::ManOnly
@ ManOnly
Definition: docparser.h:513
DocSimpleSectSep
Node representing a separator between two simple sections of the same type.
Definition: docparser.h:1139
DocImage::Rtf
@ Rtf
Definition: docparser.h:774
language.h
stripPath
QCString stripPath(const QCString &s)
Definition: util.cpp:5318
DocFormula::name
QCString name() const
Definition: docparser.h:663
DocHRef::url
QCString url() const
Definition: docparser.h:943
DocIncOperator::line
int line() const
Definition: docparser.h:628
DocStyleChange::Small
@ Small
Definition: docparser.h:350
DocCite
Node representing a citation of some bibliographic reference
Definition: docparser.h:321
Translator::trParameters
virtual QCString trParameters()=0
RTFDocVisitor::writeDotFile
void writeDotFile(const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
Definition: rtfdocvisitor.cpp:1863
DocRef
Node representing a reference to some item
Definition: docparser.h:891
DocSimpleSect::Date
@ Date
Definition: docparser.h:1116
docparser.h
getLanguageFromFileName
SrcLangExt getLanguageFromFileName(const QCString &fileName, SrcLangExt defLang)
Definition: util.cpp:5574
TRUE
#define TRUE
Definition: qcstring.h:36
DocSimpleSect::Authors
@ Authors
Definition: docparser.h:1116
DocParamSect
Node representing a parameter section
Definition: docparser.h:1150
DocInclude::IncWithLines
@ IncWithLines
Definition: docparser.h:567
RTFDocVisitor::indentLevel
int indentLevel() const
Definition: rtfdocvisitor.cpp:71
DocVerbatim::children
const DocNodeList & children() const
Definition: docparser.h:532
DocVerbatim::srcFile
QCString srcFile() const
Definition: docparser.h:534
DocHtmlList
Node representing a Html list
Definition: docparser.h:1093
filedef.h
RTFDocVisitor::maxIndentLevels
static const int maxIndentLevels
Definition: rtfdocvisitor.h:175
integerToAlpha
QCString integerToAlpha(int n, bool upper)
Definition: util.cpp:7347
Translator::trRemarks
virtual QCString trRemarks()=0
RTFDocVisitor::includePicturePreRTF
void includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
Definition: rtfdocvisitor.cpp:1239
RTFDocVisitor::m_listItemInfo
RTFListItemInfo m_listItemInfo[maxIndentLevels]
Definition: rtfdocvisitor.h:183
lineBlock
int lineBlock(const QCString &text, const QCString &marker)
Returns the line number of the line following the line with the marker.
Definition: util.cpp:6498
dia.h
DocNode::Kind_ParamSect
@ Kind_ParamSect
Definition: docparser.h:143
DocRef::file
QCString file() const
Definition: docparser.h:897
DocVerbatim::hasCaption
bool hasCaption() const
Definition: docparser.h:527
DocParamSect::type
Type type() const
Definition: docparser.h:1167
RTFDocVisitor::m_ci
CodeOutputInterface & m_ci
Definition: rtfdocvisitor.h:169
DocParamList::direction
DocParamSect::Direction direction() const
Definition: docparser.h:1241
DocSimpleSect
Node representing a simple section
Definition: docparser.h:1111
DocSection
Node representing a normal section
Definition: docparser.h:1001
RTFDocVisitor::m_insidePre
bool m_insidePre
Definition: rtfdocvisitor.h:170
DocHorRuler
Node representing a horizontal ruler
Definition: docparser.h:288
DocVerbatim::language
QCString language() const
Definition: docparser.h:525
DocAnchor::file
QCString file() const
Definition: docparser.h:309
DocWord::word
QCString word() const
Definition: docparser.h:221
DocInclude
Node representing an included text block from file
Definition: docparser.h:563
RTFDocVisitor::decIndentLevel
void decIndentLevel()
Definition: rtfdocvisitor.cpp:85
RTFDocVisitor::writeDiaFile
void writeDiaFile(DocDiaFile *)
Definition: rtfdocvisitor.cpp:1896
DocStyleChange::Subscript
@ Subscript
Definition: docparser.h:351
DocFormula::relPath
QCString relPath() const
Definition: docparser.h:665
DocLinkedWord::ref
QCString ref() const
Definition: docparser.h:241
CodeParserInterface::parseCode
virtual void parseCode(CodeOutputInterface &codeOutIntf, const QCString &scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const QCString &exampleName=QCString(), const FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, const MemberDef *memberDef=0, bool showLineNumbers=TRUE, const Definition *searchCtx=0, bool collectXRefs=TRUE)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
DocAutoList
Node representing an auto List
Definition: docparser.h:703
QCString::setNum
QCString & setNum(short n)
Definition: qcstring.h:372
Translator::trSince
virtual QCString trSince()=0
RTFDocVisitor::visitPre
void visitPre(DocAutoList *)
Definition: rtfdocvisitor.cpp:664
DocNode::Kind_Sep
@ Kind_Sep
Definition: docparser.h:154
DocWhiteSpace::chars
QCString chars() const
Definition: docparser.h:490
DocNode::Kind_LinkedWord
@ Kind_LinkedWord
Definition: docparser.h:142
DocXRefItem::title
QCString title() const
Definition: docparser.h:756
DocInternal
Node representing an internal section of documentation
Definition: docparser.h:1059
Translator::trInvariant
virtual QCString trInvariant()=0
DocParamSect::Exception
@ Exception
Definition: docparser.h:1156
writeMscGraphFromFile
void writeMscGraphFromFile(const QCString &inFile, const QCString &outDir, const QCString &outFile, MscOutputFormat format, const QCString &srcFile, int srcLine)
Definition: msc.cpp:92
RTFDocVisitor::filter
void filter(const QCString &str, bool verbatim=FALSE)
Definition: rtfdocvisitor.cpp:1770
DocHtmlList::type
Type type() const
Definition: docparser.h:1100
DocInclude::RtfInclude
@ RtfInclude
Definition: docparser.h:568
DocInclude::SnippetDoc
@ SnippetDoc
Definition: docparser.h:567
DocInclude::LatexInclude
@ LatexInclude
Definition: docparser.h:566
DocParamSect::hasTypeSpecifier
bool hasTypeSpecifier() const
Definition: docparser.h:1169
DocSection::title
QCString title() const
Definition: docparser.h:1008
DocEmoji::index
int index() const
Definition: docparser.h:474
GOF_BITMAP
@ GOF_BITMAP
Definition: dotgraph.h:27
FileInfo::dirPath
std::string dirPath(bool absPath=true) const
Definition: fileinfo.cpp:137
DocCite::anchor
QCString anchor() const
Definition: docparser.h:329
DocVerbatim::engine
QCString engine() const
Definition: docparser.h:530
DocStyleChange::style
Style style() const
Definition: docparser.h:368
DocLinkedWord
Node representing a word that can be linked to something
Definition: docparser.h:231
RTFDocVisitor::m_t
TextStream & m_t
Definition: rtfdocvisitor.h:168
DocStyleChange::Code
@ Code
Definition: docparser.h:348
DocDiagramFileBase::hasCaption
bool hasCaption() const
Definition: docparser.h:811
DocInclude::Include
@ Include
Definition: docparser.h:566
HtmlEntityMapper::rtf
const char * rtf(DocSymbol::SymType symb) const
Access routine to the RTF code of the HTML entity
Definition: htmlentity.cpp:448
Config_getBool
#define Config_getBool(name)
Definition: config.h:33
DocCite::file
QCString file() const
Definition: docparser.h:326
RTFDocVisitor::includePicturePostRTF
void includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
Definition: rtfdocvisitor.cpp:1282
DocDiagramFileBase::srcFile
QCString srcFile() const
Definition: docparser.h:815
DocIncOperator::type
Type type() const
Definition: docparser.h:616
getLanguageFromCodeLang
SrcLangExt getLanguageFromCodeLang(QCString &fileName)
Routine to handle the language attribute of the \code command
Definition: util.cpp:5592
CodeOutputInterface
Output interface for code parser.
Definition: outputgen.h:61
DocParamSect::Type
Type
Definition: docparser.h:1154
DocParamSect::Param
@ Param
Definition: docparser.h:1156
DocSection::file
QCString file() const
Definition: docparser.h:1011
DocAutoList::isEnumList
bool isEnumList() const
Definition: docparser.h:708
DocSimpleSect::Copyright
@ Copyright
Definition: docparser.h:1117
DocDiaFile
Node representing a dia file
Definition: docparser.h:850
DocParamSect::Unknown
@ Unknown
Definition: docparser.h:1156
DocVerbatim::LatexOnly
@ LatexOnly
Definition: docparser.h:513
QCString::startsWith
bool startsWith(const char *s) const
Definition: qcstring.h:408
FileInfo
Minimal replacement for QFileInfo.
Definition: fileinfo.h:22
qPrint
const char * qPrint(const char *s)
Definition: qcstring.h:589
DocStyleChange::Preformatted
@ Preformatted
Definition: docparser.h:353
Config_getString
#define Config_getString(name)
Definition: config.h:32
DocInclude::blockId
QCString blockId() const
Definition: docparser.h:587
DocHtmlRow::numCells
size_t numCells() const
Definition: docparser.h:1378
DocStyleChange::enable
bool enable() const
Definition: docparser.h:370
DBG_RTF
#define DBG_RTF(x)
Definition: rtfdocvisitor.cpp:42
DocSection::anchor
QCString anchor() const
Definition: docparser.h:1009
RTFDocVisitor::RTFListItemInfo::number
int number
Definition: rtfdocvisitor.h:180
config.h
DocSimpleSect::Post
@ Post
Definition: docparser.h:1117
DocSimpleSect::Pre
@ Pre
Definition: docparser.h:1117
DocSimpleList
Node representing a simple list
Definition: docparser.h:1082
DocSimpleSect::Remark
@ Remark
Definition: docparser.h:1117
ASSERT
#define ASSERT(x)
Definition: qcstring.h:44
DocFormula::isInline
bool isInline()
Definition: docparser.h:668
getFileNameExtension
QCString getFileNameExtension(const QCString &fn)
Definition: util.cpp:5621
DocLinkedWord::file
QCString file() const
Definition: docparser.h:239
visitCaption
static void visitCaption(RTFDocVisitor *parent, const DocNodeList &children)
Definition: rtfdocvisitor.cpp:289
QCString::data
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:153
DocStyleChange::Underline
@ Underline
Definition: docparser.h:357
DocSimpleListItem
Node representing a simple list item
Definition: docparser.h:1266
emoji.h
DocIncOperator::includeFileName
QCString includeFileName() const
Definition: docparser.h:640
FileDef
A model of a file symbol.
Definition: filedef.h:73
DocInclude::type
Type type() const
Definition: docparser.h:584
DocWhiteSpace
Node representing some amount of white space
Definition: docparser.h:484
DocVerbatim::XmlOnly
@ XmlOnly
Definition: docparser.h:513
DocParamSect::RetVal
@ RetVal
Definition: docparser.h:1156
plantuml.h
DocInclude::DontIncWithLines
@ DontIncWithLines
Definition: docparser.h:568
rtfdocvisitor.h
RTFDocVisitor::RTFListItemInfo::isEnum
bool isEnum
Definition: rtfdocvisitor.h:179
DocIncOperator::context
QCString context() const
Definition: docparser.h:632
DocStyleChange::Div
@ Div
Definition: docparser.h:355
EmojiEntityMapper::instance
static EmojiEntityMapper * instance()
Returns the one and only instance of the Emoji entity mapper
Definition: emoji.cpp:1536
RTFDocVisitor
Concrete visitor implementation for RTF output.
Definition: rtfdocvisitor.h:31
FileInfo::fileName
std::string fileName() const
Definition: fileinfo.cpp:118
DocNode::parent
DocNode * parent() const
Definition: docparser.h:166
DocHtmlCell
Node representing a HTML table cell
Definition: docparser.h:1316
DocInclude::extension
QCString extension() const
Definition: docparser.h:578
DocCite::text
QCString text() const
Definition: docparser.h:330
PlantumlManager::generatePlantUMLOutput
void generatePlantUMLOutput(const QCString &baseName, const QCString &outDir, OutputFormat format)
Convert a PlantUML file to an image.
Definition: plantuml.cpp:91
Translator::trDate
virtual QCString trDate()=0
htmlentity.h
rtf_pageWidth
const int rtf_pageWidth
Definition: rtfstyle.h:25
DocParamSect::hasInOutSpecifier
bool hasInOutSpecifier() const
Definition: docparser.h:1168
DocInternalRef
Node representing an internal reference to some item
Definition: docparser.h:919
DocParamList::parameters
DocNodeList & parameters()
Definition: docparser.h:1238
DocStyleChange::S
@ S
Definition: docparser.h:360
StyleData::reference
const char * reference() const
Definition: rtfstyle.h:59
DocVerbatim::Verbatim
@ Verbatim
Definition: docparser.h:513
util.h
A bunch of utility functions.
DocImage::type
Type type() const
Definition: docparser.h:778
DocVerbatim::srcLine
int srcLine() const
Definition: docparser.h:535
DocHtmlRow
Node representing a HTML table row
Definition: docparser.h:1371
DocInclude::ManInclude
@ ManInclude
Definition: docparser.h:568
QCString::right
QCString right(size_t len) const
Definition: qcstring.h:217
RTFDocVisitor::getStyle
QCString getStyle(const QCString &name)
Definition: rtfdocvisitor.cpp:64
DocSimpleSect::Invar
@ Invar
Definition: docparser.h:1117
QCString::sprintf
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:24
RTFDocVisitor::visitPost
void visitPost(DocAutoList *)
Definition: rtfdocvisitor.cpp:676
DocIncOperator::isLast
bool isLast() const
Definition: docparser.h:635
RTFDocVisitor::RTFDocVisitor
RTFDocVisitor(TextStream &t, CodeOutputInterface &ci, const QCString &langExt)
Definition: rtfdocvisitor.cpp:58
DocSimpleSect::Version
@ Version
Definition: docparser.h:1116
Translator::trTemplateParameters
virtual QCString trTemplateParameters()=0
DocHtmlHeader::level
int level() const
Definition: docparser.h:962
DocInclude::exampleFile
QCString exampleFile() const
Definition: docparser.h:589
DocIncOperator::text
QCString text() const
Definition: docparser.h:630
FALSE
#define FALSE
Definition: qcstring.h:33
DocSimpleSect::Since
@ Since
Definition: docparser.h:1116
Translator::trReturnValues
virtual QCString trReturnValues()=0
Translator::trAuthor
virtual QCString trAuthor(bool first_capital, bool singular)=0
Translator::trWarning
virtual QCString trWarning()=0
DocSimpleSect::Attention
@ Attention
Definition: docparser.h:1117
DocPara::isLast
bool isLast() const
Definition: docparser.h:1189
DocInclude::context
QCString context() const
Definition: docparser.h:586
DocHtmlListItem::attribs
const HtmlAttribList & attribs() const
Definition: docparser.h:1293
DocVerbatim::Dot
@ Dot
Definition: docparser.h:513
QCString
This is an alternative implementation of QCString.
Definition: qcstring.h:108