latexdocvisitor.cpp
Go to the documentation of this file.
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 #include "htmlattrib.h"
19 #include <qfileinfo.h>
20 #include "latexdocvisitor.h"
21 #include "docparser.h"
22 #include "language.h"
23 #include "doxygen.h"
24 #include "outputgen.h"
25 #include "dot.h"
26 #include "util.h"
27 #include "message.h"
28 #include "parserintf.h"
29 #include "msc.h"
30 #include "dia.h"
31 #include "cite.h"
32 #include "filedef.h"
33 #include "config.h"
34 #include "htmlentity.h"
35 #include "plantuml.h"
36 
37 static QCString escapeLabelName(const char *s)
38 {
40  const char *p=s;
41  char c;
42  if (p)
43  {
44  while ((c=*p++))
45  {
46  switch (c)
47  {
48  case '%': result+="\\%"; break;
49  case '|': result+="\\texttt{\"|}"; break;
50  case '!': result+="\"!"; break;
51  case '{': result+="\\lcurly{}"; break;
52  case '}': result+="\\rcurly{}"; break;
53  case '~': result+="````~"; break; // to get it a bit better in index together with other special characters
54  default: result+=c;
55  }
56  }
57  }
58  return result;
59 }
60 
61 const int maxLevels=5;
62 static const char *secLabels[maxLevels] =
63  { "section","subsection","subsubsection","paragraph","subparagraph" };
64 
65 static const char *getSectionName(int level)
66 {
67  static bool compactLatex = Config_getBool("COMPACT_LATEX");
68  int l = level;
69  if (compactLatex) l++;
70  if (Doxygen::insideMainPage) l--;
71  return secLabels[QMIN(maxLevels-1,l)];
72 }
73 
74 static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
75 {
76  if (hasCaption)
77  {
78  t << "\n\\begin{DoxyImage}\n";
79  }
80  else
81  {
82  t << "\n\\begin{DoxyImageNoCaption}\n"
83  " \\mbox{";
84  }
85 
86  t << "\\includegraphics";
87  if (!width.isEmpty() || !height.isEmpty())
88  {
89  t << "[";
90  }
91  if (!width.isEmpty())
92  {
93  t << "width=" << width;
94  }
95  if (!width.isEmpty() && !height.isEmpty())
96  {
97  t << ",";
98  }
99  if (!height.isEmpty())
100  {
101  t << "height=" << height;
102  }
103  if (width.isEmpty() && height.isEmpty())
104  {
105  /* default setting */
106  t << "[width=\\textwidth,height=\\textheight/2,keepaspectratio=true]";
107  }
108  else
109  {
110  t << "]";
111  }
112 
113  t << "{" << name << "}";
114 
115  if (hasCaption)
116  {
117  t << "\n\\caption{";
118  }
119 }
120 
121 
122 
123 static void visitPostEnd(FTextStream &t, const bool hasCaption)
124 {
125  t << "}\n"; // end mbox or caption
126  if (hasCaption)
127  {
128  t << "\\end{DoxyImage}\n";
129  }
130  else{
131  t << "\\end{DoxyImageNoCaption}\n";
132  }
133 }
134 
135 
137 {
138  QListIterator<DocNode> cli(children);
139  DocNode *n;
140  for (cli.toFirst();(n=cli.current());++cli) n->accept(parent);
141 }
142 
144 {
146  const char *p=s;
147  char str[2]; str[1]=0;
148  char c;
149  if (p)
150  {
151  while ((c=*p++))
152  {
153  switch (c)
154  {
155  case '!': m_t << "\"!"; break;
156  case '"': m_t << "\"\""; break;
157  case '@': m_t << "\"@"; break;
158  case '|': m_t << "\\texttt{\"|}"; break;
159  case '[': m_t << "["; break;
160  case ']': m_t << "]"; break;
161  case '{': m_t << "\\lcurly{}"; break;
162  case '}': m_t << "\\rcurly{}"; break;
163  default: str[0]=c; filter(str); break;
164  }
165  }
166  }
167  return result;
168 }
169 
170 
172  const char *langExt,bool insideTabbing)
175  m_langExt(langExt)
176 {
177  m_tableStateStack.setAutoDelete(TRUE);
178 }
179 
180  //--------------------------------------
181  // visitor functions for leaf nodes
182  //--------------------------------------
183 
185 {
186  if (m_hide) return;
187  filter(w->word());
188 }
189 
191 {
192  if (m_hide) return;
193  startLink(w->ref(),w->file(),w->anchor());
194  filter(w->word());
195  endLink(w->ref(),w->file(),w->anchor());
196 }
197 
199 {
200  if (m_hide) return;
201  if (m_insidePre)
202  {
203  m_t << w->chars();
204  }
205  else
206  {
207  m_t << " ";
208  }
209 }
210 
212 {
213  if (m_hide) return;
214  const char *res = HtmlEntityMapper::instance()->latex(s->symbol());
215  if (res)
216  {
217  if (((s->symbol() == DocSymbol::Sym_lt) || (s->symbol() == DocSymbol::Sym_Less))&& (!m_insidePre))
218  {
219  m_t << "$<$";
220  }
221  else if (((s->symbol() == DocSymbol::Sym_gt) || (s->symbol() == DocSymbol::Sym_Greater)) && (!m_insidePre))
222  {
223  m_t << "$>$";
224  }
225  else
226  {
227  m_t << res;
228  }
229  }
230  else
231  {
232  err("LaTeX: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
233  }
234 }
235 
237 {
238  if (m_hide) return;
239  if (Config_getBool("PDF_HYPERLINKS"))
240  {
241  m_t << "\\href{";
242  if (u->isEmail()) m_t << "mailto:";
243  m_t << u->url() << "}";
244  }
245  m_t << "{\\tt ";
246  filter(u->url());
247  m_t << "}";
248 }
249 
251 {
252  if (m_hide) return;
253  m_t << "~\\newline\n";
254 }
255 
257 {
258  if (m_hide) return;
259  m_t << "\n\n";
260 }
261 
263 {
264  if (m_hide) return;
265  switch (s->style())
266  {
268  if (s->enable()) m_t << "{\\bfseries "; else m_t << "}";
269  break;
271  if (s->enable()) m_t << "{\\itshape "; else m_t << "}";
272  break;
274  if (s->enable()) m_t << "{\\ttfamily "; else m_t << "}";
275  break;
277  if (s->enable()) m_t << "\\textsubscript{"; else m_t << "}";
278  break;
280  if (s->enable()) m_t << "\\textsuperscript{"; else m_t << "}";
281  break;
283  if (s->enable()) m_t << "\\begin{center}"; else m_t << "\\end{center} ";
284  break;
286  if (s->enable()) m_t << "\n\\footnotesize "; else m_t << "\n\\normalsize ";
287  break;
289  if (s->enable())
290  {
291  m_t << "\n\\begin{DoxyPre}";
293  }
294  else
295  {
297  m_t << "\\end{DoxyPre}\n";
298  }
299  break;
300  case DocStyleChange::Div: /* HTML only */ break;
301  case DocStyleChange::Span: /* HTML only */ break;
302  }
303 }
304 
306 {
307  if (m_hide) return;
308  QCString lang = m_langExt;
309  if (!s->language().isEmpty()) // explicit language setting
310  {
311  lang = s->language();
312  }
313  SrcLangExt langExt = getLanguageFromFileName(lang);
314  switch(s->type())
315  {
316  case DocVerbatim::Code:
317  {
318  m_t << "\n\\begin{DoxyCode}\n";
320  ->parseCode(m_ci,s->context(),s->text(),langExt,
321  s->isExample(),s->exampleFile());
322  m_t << "\\end{DoxyCode}\n";
323  }
324  break;
325  case DocVerbatim::Verbatim:
326  m_t << "\\begin{DoxyVerb}";
327  m_t << s->text();
328  m_t << "\\end{DoxyVerb}\n";
329  break;
330  case DocVerbatim::HtmlOnly:
331  case DocVerbatim::XmlOnly:
332  case DocVerbatim::ManOnly:
335  /* nothing */
336  break;
338  m_t << s->text();
339  break;
340  case DocVerbatim::Dot:
341  {
342  static int dotindex = 1;
343  QCString fileName(4096);
344 
345  fileName.sprintf("%s%d%s",
346  (Config_getString("LATEX_OUTPUT")+"/inline_dotgraph_").data(),
347  dotindex++,
348  ".dot"
349  );
350  QFile file(fileName);
351  if (!file.open(IO_WriteOnly))
352  {
353  err("Could not open file %s for writing\n",fileName.data());
354  }
355  else
356  {
357  file.writeBlock( s->text(), s->text().length() );
358  file.close();
359 
360  startDotFile(fileName,s->width(),s->height(),s->hasCaption());
361  visitCaption(this, s->children());
362  endDotFile(s->hasCaption());
363 
364  if (Config_getBool("DOT_CLEANUP")) file.remove();
365  }
366  }
367  break;
368  case DocVerbatim::Msc:
369  {
370  static int mscindex = 1;
371  QCString baseName(4096);
372 
373  baseName.sprintf("%s%d",
374  (Config_getString("LATEX_OUTPUT")+"/inline_mscgraph_").data(),
375  mscindex++
376  );
377  QFile file(baseName+".msc");
378  if (!file.open(IO_WriteOnly))
379  {
380  err("Could not open file %s.msc for writing\n",baseName.data());
381  }
382  else
383  {
384  QCString text = "msc {";
385  text+=s->text();
386  text+="}";
387  file.writeBlock( text, text.length() );
388  file.close();
389 
390  writeMscFile(baseName, s);
391 
392  if (Config_getBool("DOT_CLEANUP")) file.remove();
393  }
394  }
395  break;
396  case DocVerbatim::PlantUML:
397  {
398  QCString latexOutput = Config_getString("LATEX_OUTPUT");
399  QCString baseName = writePlantUMLSource(latexOutput,s->exampleFile(),s->text());
400 
401  writePlantUMLFile(baseName, s);
402  }
403  break;
404  }
405 }
406 
408 {
409  if (m_hide) return;
410  m_t << "\\label{" << stripPath(anc->file()) << "_" << anc->anchor() << "}%" << endl;
411  if (!anc->file().isEmpty() && Config_getBool("PDF_HYPERLINKS"))
412  {
413  m_t << "\\hypertarget{" << stripPath(anc->file()) << "_" << anc->anchor()
414  << "}{}%" << endl;
415  }
416 }
417 
419 {
420  if (m_hide) return;
421  SrcLangExt langExt = getLanguageFromFileName(inc->extension());
422  switch(inc->type())
423  {
425  {
426  m_t << "\n\\begin{DoxyCodeInclude}\n";
427  QFileInfo cfi( inc->file() );
428  FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
430  ->parseCode(m_ci,inc->context(),
431  inc->text(),
432  langExt,
433  inc->isExample(),
434  inc->exampleFile(), &fd);
435  m_t << "\\end{DoxyCodeInclude}" << endl;
436  }
437  break;
438  case DocInclude::Include:
439  m_t << "\n\\begin{DoxyCodeInclude}\n";
441  ->parseCode(m_ci,inc->context(),
442  inc->text(),langExt,inc->isExample(),
443  inc->exampleFile());
444  m_t << "\\end{DoxyCodeInclude}\n";
445  break;
447  break;
449  break;
451  m_t << inc->text();
452  break;
454  m_t << "\n\\begin{DoxyVerbInclude}\n";
455  m_t << inc->text();
456  m_t << "\\end{DoxyVerbInclude}\n";
457  break;
458  case DocInclude::Snippet:
459  {
460  m_t << "\n\\begin{DoxyCodeInclude}\n";
462  ->parseCode(m_ci,
463  inc->context(),
464  extractBlock(inc->text(),inc->blockId()),
465  langExt,
466  inc->isExample(),
467  inc->exampleFile()
468  );
469  m_t << "\\end{DoxyCodeInclude}" << endl;
470  }
471  break;
472  }
473 }
474 
476 {
477  //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
478  // op->type(),op->isFirst(),op->isLast(),op->text().data());
479  if (op->isFirst())
480  {
481  if (!m_hide) m_t << "\n\\begin{DoxyCodeInclude}\n";
482  pushEnabled();
483  m_hide = TRUE;
484  }
486  if (op->type()!=DocIncOperator::Skip)
487  {
488  popEnabled();
489  if (!m_hide)
490  {
492  ->parseCode(m_ci,op->context(),op->text(),langExt,
493  op->isExample(),op->exampleFile());
494  }
495  pushEnabled();
496  m_hide=TRUE;
497  }
498  if (op->isLast())
499  {
500  popEnabled();
501  if (!m_hide) m_t << "\n\\end{DoxyCodeInclude}\n";
502  }
503  else
504  {
505  if (!m_hide) m_t << endl;
506  }
507 }
508 
510 {
511  if (m_hide) return;
512  m_t << f->text();
513 }
514 
516 {
517  if (m_hide) return;
518  m_t << "\\index{" << escapeLabelName(i->entry()) << "@{";
520  m_t << "}}";
521 }
522 
524 {
525 }
526 
528 {
529  if (m_hide) return;
530  if (!cite->file().isEmpty())
531  {
532  //startLink(cite->ref(),cite->file(),cite->anchor());
533  QCString anchor = cite->anchor();
534  anchor = anchor.mid(CiteConsts::anchorPrefix.length()); // strip prefix
535  m_t << "\\cite{" << anchor << "}";
536  }
537  else
538  {
539  m_t << "{\\bfseries [";
540  filter(cite->text());
541  m_t << "]}";
542  }
543 }
544 
545 //--------------------------------------
546 // visitor functions for compound nodes
547 //--------------------------------------
548 
550 {
551  if (m_hide) return;
552  if (l->isEnumList())
553  {
554  m_t << "\n\\begin{DoxyEnumerate}";
555  }
556  else
557  {
558  m_t << "\n\\begin{DoxyItemize}";
559  }
560 }
561 
563 {
564  if (m_hide) return;
565  if (l->isEnumList())
566  {
567  m_t << "\n\\end{DoxyEnumerate}";
568  }
569  else
570  {
571  m_t << "\n\\end{DoxyItemize}";
572  }
573 }
574 
576 {
577  if (m_hide) return;
578  m_t << "\n\\item ";
579 }
580 
582 {
583 }
584 
586 {
587 }
588 
590 {
591  if (m_hide) return;
592  if (!p->isLast() && // omit <p> for last paragraph
593  !(p->parent() && // and for parameter sections
595  )
596  ) m_t << endl << endl;
597 }
598 
600 {
601 }
602 
604 {
605 }
606 
608 {
609  if (m_hide) return;
610  switch(s->type())
611  {
612  case DocSimpleSect::See:
613  m_t << "\\begin{DoxySeeAlso}{";
615  break;
617  m_t << "\\begin{DoxyReturn}{";
619  break;
621  m_t << "\\begin{DoxyAuthor}{";
623  break;
625  m_t << "\\begin{DoxyAuthor}{";
627  break;
629  m_t << "\\begin{DoxyVersion}{";
631  break;
633  m_t << "\\begin{DoxySince}{";
635  break;
636  case DocSimpleSect::Date:
637  m_t << "\\begin{DoxyDate}{";
639  break;
640  case DocSimpleSect::Note:
641  m_t << "\\begin{DoxyNote}{";
643  break;
645  m_t << "\\begin{DoxyWarning}{";
647  break;
648  case DocSimpleSect::Pre:
649  m_t << "\\begin{DoxyPrecond}{";
651  break;
652  case DocSimpleSect::Post:
653  m_t << "\\begin{DoxyPostcond}{";
655  break;
657  m_t << "\\begin{DoxyCopyright}{";
659  break;
661  m_t << "\\begin{DoxyInvariant}{";
663  break;
665  m_t << "\\begin{DoxyRemark}{";
667  break;
669  m_t << "\\begin{DoxyAttention}{";
671  break;
672  case DocSimpleSect::User:
673  m_t << "\\begin{DoxyParagraph}{";
674  break;
675  case DocSimpleSect::Rcs:
676  m_t << "\\begin{DoxyParagraph}{";
677  break;
678  case DocSimpleSect::Unknown: break;
679  }
680 
681  // special case 1: user defined title
682  if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs)
683  {
684  m_t << "}\n";
685  }
686  else
687  {
689  }
690 }
691 
693 {
694  if (m_hide) return;
695  switch(s->type())
696  {
697  case DocSimpleSect::See:
698  m_t << "\n\\end{DoxySeeAlso}\n";
699  break;
701  m_t << "\n\\end{DoxyReturn}\n";
702  break;
704  m_t << "\n\\end{DoxyAuthor}\n";
705  break;
707  m_t << "\n\\end{DoxyAuthor}\n";
708  break;
710  m_t << "\n\\end{DoxyVersion}\n";
711  break;
713  m_t << "\n\\end{DoxySince}\n";
714  break;
715  case DocSimpleSect::Date:
716  m_t << "\n\\end{DoxyDate}\n";
717  break;
718  case DocSimpleSect::Note:
719  m_t << "\n\\end{DoxyNote}\n";
720  break;
722  m_t << "\n\\end{DoxyWarning}\n";
723  break;
724  case DocSimpleSect::Pre:
725  m_t << "\n\\end{DoxyPrecond}\n";
726  break;
727  case DocSimpleSect::Post:
728  m_t << "\n\\end{DoxyPostcond}\n";
729  break;
731  m_t << "\n\\end{DoxyCopyright}\n";
732  break;
734  m_t << "\n\\end{DoxyInvariant}\n";
735  break;
737  m_t << "\n\\end{DoxyRemark}\n";
738  break;
740  m_t << "\n\\end{DoxyAttention}\n";
741  break;
742  case DocSimpleSect::User:
743  m_t << "\n\\end{DoxyParagraph}\n";
744  break;
745  case DocSimpleSect::Rcs:
746  m_t << "\n\\end{DoxyParagraph}\n";
747  break;
748  default:
749  break;
750  }
751 }
752 
754 {
755 }
756 
758 {
759  if (m_hide) return;
761  m_t << "}\n";
762 }
763 
765 {
766  if (m_hide) return;
767  m_t << "\\begin{DoxyItemize}" << endl;
768 }
769 
771 {
772  if (m_hide) return;
773  m_t << "\\end{DoxyItemize}" << endl;
774 }
775 
777 {
778  if (m_hide) return;
779  m_t << "\\item ";
780 }
781 
783 {
784 }
785 
787 {
788  if (m_hide) return;
789  if (Config_getBool("PDF_HYPERLINKS"))
790  {
791  m_t << "\\hypertarget{" << stripPath(s->file()) << "_" << s->anchor() << "}{}";
792  }
793  m_t << "\\" << getSectionName(s->level()) << "{";
795  m_t << "}\\label{" << stripPath(s->file()) << "_" << s->anchor() << "}" << endl;
796 }
797 
799 {
800 }
801 
803 {
804  if (m_hide) return;
805  if (s->type()==DocHtmlList::Ordered)
806  m_t << "\n\\begin{DoxyEnumerate}";
807  else
808  m_t << "\n\\begin{DoxyItemize}";
809 }
810 
812 {
813  if (m_hide) return;
814  if (s->type()==DocHtmlList::Ordered)
815  m_t << "\n\\end{DoxyEnumerate}";
816  else
817  m_t << "\n\\end{DoxyItemize}";
818 }
819 
821 {
822  if (m_hide) return;
823  m_t << "\n\\item ";
824 }
825 
827 {
828 }
829 
830 //void LatexDocVisitor::visitPre(DocHtmlPre *)
831 //{
832 // m_t << "\\small\\begin{alltt}";
833 // m_insidePre=TRUE;
834 //}
835 
836 //void LatexDocVisitor::visitPost(DocHtmlPre *)
837 //{
838 // m_insidePre=FALSE;
839 // m_t << "\\end{alltt}\\normalsize " << endl;
840 //}
841 
843 {
844  if (m_hide) return;
845  QCString val = dl->attribs().find("class");
846  if (val=="reflist")
847  {
848  m_t << "\n\\begin{DoxyRefList}";
849  }
850  else
851  {
852  m_t << "\n\\begin{DoxyDescription}";
853  }
854 }
855 
857 {
858  if (m_hide) return;
859  QCString val = dl->attribs().find("class");
860  if (val=="reflist")
861  {
862  m_t << "\n\\end{DoxyRefList}";
863  }
864  else
865  {
866  m_t << "\n\\end{DoxyDescription}";
867  }
868 }
869 
871 {
872  if (m_hide) return;
873  m_t << "\n\\item[";
875 }
876 
878 {
879  if (m_hide) return;
881  m_t << "]";
882 }
883 
885 {
886 }
887 
889 {
890 }
891 
892 static bool tableIsNested(const DocNode *n)
893 {
894  bool isNested=FALSE;
895  while (n && !isNested)
896  {
897  isNested = n->kind()==DocNode::Kind_HtmlTable || n->kind()==DocNode::Kind_ParamSect;
898  n = n->parent();
899  }
900  return isNested;
901 }
902 
903 static void writeStartTableCommand(FTextStream &t,const DocNode *n,int cols)
904 {
905  if (tableIsNested(n))
906  {
907  t << "\\begin{tabularx}{\\linewidth}{|*{" << cols << "}{>{\\raggedright\\arraybackslash}X|}}";
908  }
909  else
910  {
911  t << "\\tabulinesep=1mm\n\\begin{longtabu} spread 0pt [c]{*" << cols << "{|X[-1]}|}\n";
912  }
913  //return isNested ? "TabularNC" : "TabularC";
914 }
915 
917 {
918  if (tableIsNested(n))
919  {
920  t << "\\end{tabularx}\n";
921  }
922  else
923  {
924  t << "\\end{longtabu}\n";
925  }
926  //return isNested ? "TabularNC" : "TabularC";
927 }
928 
930 {
931  if (m_hide) return;
932  pushTableState();
933  if (t->hasCaption())
934  {
935  DocHtmlCaption *c = t->caption();
936  static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS");
937  if (!c->file().isEmpty() && pdfHyperLinks)
938  {
939  m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
940  << "}{}";
941  }
942  m_t << endl;
943  }
944 
946 
947  if (t->hasCaption())
948  {
949  DocHtmlCaption *c = t->caption();
950  m_t << "\\caption{";
951  visitCaption(this, c->children());
952  m_t << "}";
953  m_t << "\\label{" << stripPath(c->file()) << "_" << c->anchor() << "}";
954  m_t << "\\\\\n";
955  }
956 
957  setNumCols(t->numColumns());
958  m_t << "\\hline\n";
959 
960  // check if first row is a heading and then render the row already here
961  // and end it with \endfirsthead (triggered via m_firstRow==TRUE)
962  // then repeat the row as normal and end it with \endhead (m_firstRow==FALSE)
963  DocHtmlRow *firstRow = t->firstRow();
964  if (firstRow && firstRow->isHeading())
965  {
966  setFirstRow(TRUE);
967  firstRow->accept(this);
969  }
970 }
971 
973 {
974  if (m_hide) return;
976  popTableState();
977 }
978 
980 {
982  m_hide = TRUE;
983 }
984 
986 {
988 }
989 
991 {
992  setCurrentColumn(0);
993  if (r->isHeading()) m_t << "\\rowcolor{\\tableheadbgcolor}";
994 }
995 
997 {
998  if (m_hide) return;
999 
1000  int c=currentColumn();
1001  while (c<=numCols()) // end of row while inside a row span?
1002  {
1003  uint i;
1004  for (i=0;i<rowSpans().count();i++)
1005  {
1006  ActiveRowSpan *span = rowSpans().at(i);
1007  //printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
1008  // span->column, span->rowSpan,span->colSpan,row->rowIndex(),span->cell->rowIndex(),i,c);
1009  if (span->rowSpan>0 && span->column==c && // we are at a cell in a row span
1010  row->rowIndex()>span->cell->rowIndex() // but not the row that started the span
1011  )
1012  {
1013  m_t << "&";
1014  if (span->colSpan>1) // row span is also part of a column span
1015  {
1016  m_t << "\\multicolumn{" << span->colSpan << "}{";
1017  m_t << "p{(\\linewidth-\\tabcolsep*"
1018  << numCols() << "-\\arrayrulewidth*"
1019  << row->visibleCells() << ")*"
1020  << span->colSpan <<"/"<< numCols() << "}|}{}";
1021  }
1022  else // solitary row span
1023  {
1024  m_t << "\\multicolumn{1}{c|}{}";
1025  }
1026  }
1027  }
1028  c++;
1029  }
1030 
1031  m_t << "\\\\";
1032 
1033  int col = 1;
1034  uint i;
1035  for (i=0;i<rowSpans().count();i++)
1036  {
1037  ActiveRowSpan *span = rowSpans().at(i);
1038  if (span->rowSpan>0) span->rowSpan--;
1039  if (span->rowSpan<=0)
1040  {
1041  // inactive span
1042  }
1043  else if (span->column>col)
1044  {
1045  m_t << "\\cline{" << col << "-" << (span->column-1) << "}";
1046  col = span->column+span->colSpan;
1047  }
1048  else
1049  {
1050  col = span->column+span->colSpan;
1051  }
1052  }
1053 
1054  if (col <= numCols())
1055  {
1056  m_t << "\\cline{" << col << "-" << numCols() << "}";
1057  }
1058 
1059  m_t << "\n";
1060 
1061  if (row->isHeading() && row->rowIndex()==1)
1062  {
1063  if (firstRow())
1064  {
1065  m_t << "\\endfirsthead" << endl;
1066  m_t << "\\hline" << endl;
1067  m_t << "\\endfoot" << endl;
1068  m_t << "\\hline" << endl;
1069  }
1070  else
1071  {
1072  m_t << "\\endhead" << endl;
1073  }
1074  }
1075 }
1076 
1078 {
1079  if (m_hide) return;
1080 
1081  DocHtmlRow *row = 0;
1082  if (c->parent() && c->parent()->kind()==DocNode::Kind_HtmlRow)
1083  {
1084  row = (DocHtmlRow*)c->parent();
1085  }
1086 
1088 
1089  //Skip columns that span from above.
1090  uint i;
1091  for (i=0;i<rowSpans().count();i++)
1092  {
1093  ActiveRowSpan *span = rowSpans().at(i);
1094  if (span->rowSpan>0 && span->column==currentColumn())
1095  {
1096  if (row && span->colSpan>1)
1097  {
1098  m_t << "\\multicolumn{" << span->colSpan << "}{";
1099  if (currentColumn() /*c->columnIndex()*/==1) // add extra | for first column
1100  {
1101  m_t << "|";
1102  }
1103  m_t << "p{(\\linewidth-\\tabcolsep*"
1104  << numCols() << "-\\arrayrulewidth*"
1105  << row->visibleCells() << ")*"
1106  << span->colSpan <<"/"<< numCols() << "}|}{}";
1108  }
1109  else
1110  {
1112  }
1113  m_t << "&";
1114  }
1115  }
1116 
1117  int cs = c->colSpan();
1118  if (cs>1 && row)
1119  {
1120  setInColSpan(TRUE);
1121  m_t << "\\multicolumn{" << cs << "}{";
1122  if (c->columnIndex()==1) // add extra | for first column
1123  {
1124  m_t << "|";
1125  }
1126  m_t << "p{(\\linewidth-\\tabcolsep*"
1127  << numCols() << "-\\arrayrulewidth*"
1128  << row->visibleCells() << ")*"
1129  << cs <<"/"<< numCols() << "}|}{";
1130  if (c->isHeading()) m_t << "\\cellcolor{\\tableheadbgcolor}";
1131  }
1132  int rs = c->rowSpan();
1133  if (rs>0)
1134  {
1135  setInRowSpan(TRUE);
1136  //printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
1137  // c->rowIndex(),c->columnIndex(),c->rowSpan(),c->colSpan(),
1138  // currentColumn());
1139  addRowSpan(new ActiveRowSpan(c,rs,cs,currentColumn()));
1140  m_t << "\\multirow{" << rs << "}{\\linewidth}{";
1141  }
1142  int a = c->alignment();
1143  if (a==DocHtmlCell::Center)
1144  {
1145  m_t << "\\PBS\\centering ";
1146  }
1147  else if (a==DocHtmlCell::Right)
1148  {
1149  m_t << "\\PBS\\raggedleft ";
1150  }
1151  if (c->isHeading())
1152  {
1153  m_t << "{\\bf ";
1154  }
1155  if (cs>1)
1156  {
1158  }
1159 }
1160 
1162 {
1163  if (m_hide) return;
1164  if (c->isHeading())
1165  {
1166  m_t << "}";
1167  }
1168  if (inRowSpan())
1169  {
1171  m_t << "}";
1172  }
1173  if (inColSpan())
1174  {
1176  m_t << "}";
1177  }
1178  if (!c->isLast()) m_t << "&";
1179 }
1180 
1182 {
1183  if (m_hide) return;
1184  //m_t << "\\begin{DoxyInternal}{";
1185  //filter(theTranslator->trForInternalUseOnly());
1186  //m_t << "}\n";
1187 }
1188 
1190 {
1191  if (m_hide) return;
1192  //m_t << "\\end{DoxyInternal}" << endl;
1193 }
1194 
1196 {
1197  if (m_hide) return;
1198  if (Config_getBool("PDF_HYPERLINKS"))
1199  {
1200  m_t << "\\href{";
1201  m_t << href->url();
1202  m_t << "}";
1203  }
1204  m_t << "{\\tt ";
1205 }
1206 
1208 {
1209  if (m_hide) return;
1210  m_t << "}";
1211 }
1212 
1214 {
1215  if (m_hide) return;
1216  m_t << "\\" << getSectionName(header->level()) << "*{";
1217 }
1218 
1220 {
1221  if (m_hide) return;
1222  m_t << "}";
1223 }
1225 {
1226  if (img->type()==DocImage::Latex)
1227  {
1228  if (m_hide) return;
1229  QCString gfxName = img->name();
1230  if (gfxName.right(4)==".eps" || gfxName.right(4)==".pdf")
1231  {
1232  gfxName=gfxName.left(gfxName.length()-4);
1233  }
1234 
1235  visitPreStart(m_t,img->hasCaption(), gfxName, img->width(), img->height());
1236  }
1237  else // other format -> skip
1238  {
1239  pushEnabled();
1240  m_hide=TRUE;
1241  }
1242 }
1243 
1245 {
1246  if (img->type()==DocImage::Latex)
1247  {
1248  if (m_hide) return;
1249  visitPostEnd(m_t,img->hasCaption());
1250  }
1251  else // other format
1252  {
1253  popEnabled();
1254  }
1255 }
1256 
1258 {
1259  if (m_hide) return;
1260  startDotFile(df->file(),df->width(),df->height(),df->hasCaption());
1261 }
1262 
1264 {
1265  if (m_hide) return;
1266  endDotFile(df->hasCaption());
1267 }
1269 {
1270  if (m_hide) return;
1271  startMscFile(df->file(),df->width(),df->height(),df->hasCaption());
1272 }
1273 
1275 {
1276  if (m_hide) return;
1277  endMscFile(df->hasCaption());
1278 }
1279 
1281 {
1282  if (m_hide) return;
1283  startDiaFile(df->file(),df->width(),df->height(),df->hasCaption());
1284 }
1285 
1287 {
1288  if (m_hide) return;
1289  endDiaFile(df->hasCaption());
1290 }
1292 {
1293  if (m_hide) return;
1294  startLink(lnk->ref(),lnk->file(),lnk->anchor());
1295 }
1296 
1298 {
1299  if (m_hide) return;
1300  endLink(lnk->ref(),lnk->file(),lnk->anchor());
1301 }
1302 
1304 {
1305  if (m_hide) return;
1306  // when ref->isSubPage()==TRUE we use ref->file() for HTML and
1307  // ref->anchor() for LaTeX/RTF
1308  if (ref->isSubPage())
1309  {
1310  startLink(ref->ref(),0,ref->anchor());
1311  }
1312  else
1313  {
1314  if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor(),ref->refToTable());
1315  }
1316  if (!ref->hasLinkText()) filter(ref->targetTitle());
1317 }
1318 
1320 {
1321  if (m_hide) return;
1322  if (ref->isSubPage())
1323  {
1324  endLink(ref->ref(),0,ref->anchor());
1325  }
1326  else
1327  {
1328  if (!ref->file().isEmpty()) endLink(ref->ref(),ref->file(),ref->anchor());
1329  }
1330 }
1331 
1333 {
1334  if (m_hide) return;
1335  m_t << "\\item \\contentsline{section}{";
1336  static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1337  if (pdfHyperlinks)
1338  {
1339  m_t << "\\hyperlink{" << ref->file() << "_" << ref->anchor() << "}{" ;
1340  }
1341 }
1342 
1344 {
1345  if (m_hide) return;
1346  static bool pdfHyperlinks = Config_getBool("PDF_HYPERLINKS");
1347  if (pdfHyperlinks)
1348  {
1349  m_t << "}";
1350  }
1351  m_t << "}{\\ref{" << ref->file() << "_" << ref->anchor() << "}}{}" << endl;
1352 }
1353 
1355 {
1356  if (m_hide) return;
1357  m_t << "\\footnotesize" << endl;
1358  m_t << "\\begin{multicols}{2}" << endl;
1359  m_t << "\\begin{DoxyCompactList}" << endl;
1360 }
1361 
1363 {
1364  if (m_hide) return;
1365  m_t << "\\end{DoxyCompactList}" << endl;
1366  m_t << "\\end{multicols}" << endl;
1367  m_t << "\\normalsize" << endl;
1368 }
1369 
1371 {
1372  if (m_hide) return;
1373  bool hasInOutSpecs = s->hasInOutSpecifier();
1374  bool hasTypeSpecs = s->hasTypeSpecifier();
1375  switch(s->type())
1376  {
1377  case DocParamSect::Param:
1378  m_t << "\n\\begin{DoxyParams}";
1379  if (hasInOutSpecs && hasTypeSpecs) m_t << "[2]"; // 2 extra cols
1380  else if (hasInOutSpecs || hasTypeSpecs) m_t << "[1]"; // 1 extra col
1381  m_t << "{";
1383  break;
1384  case DocParamSect::RetVal:
1385  m_t << "\n\\begin{DoxyRetVals}{";
1387  break;
1389  m_t << "\n\\begin{DoxyExceptions}{";
1391  break;
1393  /* TODO: add this
1394  filter(theTranslator->trTemplateParam()); break;
1395  */
1396  m_t << "\n\\begin{DoxyTemplParams}{";
1397  filter("Template Parameters");
1398  break;
1399  default:
1400  ASSERT(0);
1401  }
1402  m_t << "}\n";
1403 }
1404 
1406 {
1407  if (m_hide) return;
1408  switch(s->type())
1409  {
1410  case DocParamSect::Param:
1411  m_t << "\\end{DoxyParams}\n";
1412  break;
1413  case DocParamSect::RetVal:
1414  m_t << "\\end{DoxyRetVals}\n";
1415  break;
1417  m_t << "\\end{DoxyExceptions}\n";
1418  break;
1420  m_t << "\\end{DoxyTemplParams}\n";
1421  break;
1422  default:
1423  ASSERT(0);
1424  }
1425 }
1426 
1428 {
1429  if (m_hide) return;
1431  DocParamSect *sect = 0;
1432  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1433  {
1434  parentType = ((DocParamSect*)pl->parent())->type();
1435  sect=(DocParamSect*)pl->parent();
1436  }
1437  bool useTable = parentType==DocParamSect::Param ||
1438  parentType==DocParamSect::RetVal ||
1439  parentType==DocParamSect::Exception ||
1440  parentType==DocParamSect::TemplateParam;
1441  if (!useTable)
1442  {
1443  m_t << "\\item[";
1444  }
1445  if (sect && sect->hasInOutSpecifier())
1446  {
1448  {
1449  m_t << "\\mbox{\\tt ";
1450  if (pl->direction()==DocParamSect::In)
1451  {
1452  m_t << "in";
1453  }
1454  else if (pl->direction()==DocParamSect::Out)
1455  {
1456  m_t << "out";
1457  }
1458  else if (pl->direction()==DocParamSect::InOut)
1459  {
1460  m_t << "in,out";
1461  }
1462  m_t << "} ";
1463  }
1464  if (useTable) m_t << " & ";
1465  }
1466  if (sect && sect->hasTypeSpecifier())
1467  {
1469  DocNode *type;
1470  bool first=TRUE;
1471  for (li.toFirst();(type=li.current());++li)
1472  {
1473  if (!first) m_t << " | "; else first=FALSE;
1474  if (type->kind()==DocNode::Kind_Word)
1475  {
1476  visit((DocWord*)type);
1477  }
1478  else if (type->kind()==DocNode::Kind_LinkedWord)
1479  {
1480  visit((DocLinkedWord*)type);
1481  }
1482  }
1483  if (useTable) m_t << " & ";
1484  }
1485  m_t << "{\\em ";
1486  //QStrListIterator li(pl->parameters());
1487  //const char *s;
1489  DocNode *param;
1490  bool first=TRUE;
1491  for (li.toFirst();(param=li.current());++li)
1492  {
1493  if (!first) m_t << ","; else first=FALSE;
1495  if (param->kind()==DocNode::Kind_Word)
1496  {
1497  visit((DocWord*)param);
1498  }
1499  else if (param->kind()==DocNode::Kind_LinkedWord)
1500  {
1501  visit((DocLinkedWord*)param);
1502  }
1504  }
1505  m_t << "}";
1506  if (useTable)
1507  {
1508  m_t << " & ";
1509  }
1510  else
1511  {
1512  m_t << "]";
1513  }
1514 }
1515 
1517 {
1518  if (m_hide) return;
1520  if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
1521  {
1522  parentType = ((DocParamSect*)pl->parent())->type();
1523  }
1524  bool useTable = parentType==DocParamSect::Param ||
1525  parentType==DocParamSect::RetVal ||
1526  parentType==DocParamSect::Exception ||
1527  parentType==DocParamSect::TemplateParam;
1528  if (useTable)
1529  {
1530  m_t << "\\\\" << endl
1531  << "\\hline" << endl;
1532  }
1533 }
1534 
1536 {
1537  if (m_hide) return;
1538  if (x->title().isEmpty()) return;
1539  m_t << "\\begin{DoxyRefDesc}{";
1540  filter(x->title());
1541  m_t << "}" << endl;
1542  bool anonymousEnum = x->file()=="@";
1543  m_t << "\\item[";
1544  if (Config_getBool("PDF_HYPERLINKS") && !anonymousEnum)
1545  {
1546  m_t << "\\hyperlink{" << stripPath(x->file()) << "_" << x->anchor() << "}{";
1547  }
1548  else
1549  {
1550  m_t << "{\\bf ";
1551  }
1553  filter(x->title());
1555  m_t << "}]";
1556 }
1557 
1559 {
1560  if (m_hide) return;
1561  if (x->title().isEmpty()) return;
1562  m_t << "\\end{DoxyRefDesc}" << endl;
1563 }
1564 
1566 {
1567  if (m_hide) return;
1568  startLink(0,ref->file(),ref->anchor());
1569 }
1570 
1572 {
1573  if (m_hide) return;
1574  endLink(0,ref->file(),ref->anchor());
1575 }
1576 
1578 {
1579 }
1580 
1582 {
1583 }
1584 
1586 {
1587 }
1588 
1590 {
1591 }
1592 
1594 {
1595  if (m_hide) return;
1596  m_t << "\\begin{quote}" << endl;
1597 }
1598 
1600 {
1601  if (m_hide) return;
1602  m_t << "\\end{quote}" << endl;
1603 }
1604 
1606 {
1607  if (m_hide) return;
1608 }
1609 
1611 {
1612  if (m_hide) return;
1613 }
1614 
1616 {
1617  if (m_hide) return;
1618 }
1619 
1621 {
1622  if (m_hide) return;
1623 }
1624 
1625 void LatexDocVisitor::filter(const char *str)
1626 {
1628 }
1629 
1630 void LatexDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor,bool refToTable)
1631 {
1632  static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS");
1633  if (ref.isEmpty() && pdfHyperLinks) // internal PDF link
1634  {
1635  if (refToTable)
1636  {
1637  m_t << "\\doxytablelink{";
1638  }
1639  else
1640  {
1641  m_t << "\\hyperlink{";
1642  }
1643  if (!file.isEmpty()) m_t << stripPath(file);
1644  if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1645  if (!anchor.isEmpty()) m_t << anchor;
1646  m_t << "}{";
1647  }
1648  else if (ref.isEmpty() && refToTable)
1649  {
1650  m_t << "\\doxytableref{";
1651  }
1652  else if (ref.isEmpty()) // internal non-PDF link
1653  {
1654  m_t << "\\doxyref{";
1655  }
1656  else // external link
1657  {
1658  m_t << "{\\bf ";
1659  }
1660 }
1661 
1662 void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCString &anchor)
1663 {
1664  m_t << "}";
1665  static bool pdfHyperLinks = Config_getBool("PDF_HYPERLINKS");
1666  if (ref.isEmpty() && !pdfHyperLinks)
1667  {
1668  m_t << "{";
1670  m_t << "}{" << file;
1671  if (!file.isEmpty() && !anchor.isEmpty()) m_t << "_";
1672  m_t << anchor << "}";
1673  }
1674 }
1675 
1677 {
1678  m_enabled.push(new bool(m_hide));
1679 }
1680 
1682 {
1683  bool *v=m_enabled.pop();
1684  ASSERT(v!=0);
1685  m_hide = *v;
1686  delete v;
1687 }
1688 
1690  const QCString &width,
1691  const QCString &height,
1692  bool hasCaption
1693  )
1694 {
1696  int i;
1697  if ((i=baseName.findRev('/'))!=-1)
1698  {
1699  baseName=baseName.right(baseName.length()-i-1);
1700  }
1701  if ((i=baseName.find('.'))!=-1)
1702  {
1703  baseName=baseName.left(i);
1704  }
1705  baseName.prepend("dot_");
1706  QCString outDir = Config_getString("LATEX_OUTPUT");
1708  writeDotGraphFromFile(name,outDir,baseName,GOF_EPS);
1709  visitPreStart(m_t,hasCaption, baseName, width, height);
1710 }
1711 
1712 void LatexDocVisitor::endDotFile(bool hasCaption)
1713 {
1714  if (m_hide) return;
1715  visitPostEnd(m_t,hasCaption);
1716 }
1717 
1719  const QCString &width,
1720  const QCString &height,
1721  bool hasCaption
1722  )
1723 {
1725  int i;
1726  if ((i=baseName.findRev('/'))!=-1)
1727  {
1728  baseName=baseName.right(baseName.length()-i-1);
1729  }
1730  if ((i=baseName.find('.'))!=-1)
1731  {
1732  baseName=baseName.left(i);
1733  }
1734  baseName.prepend("msc_");
1735 
1736  QCString outDir = Config_getString("LATEX_OUTPUT");
1737  writeMscGraphFromFile(fileName,outDir,baseName,MSC_EPS);
1738  visitPreStart(m_t,hasCaption, baseName, width, height);
1739 }
1740 
1741 void LatexDocVisitor::endMscFile(bool hasCaption)
1742 {
1743  if (m_hide) return;
1744  visitPostEnd(m_t,hasCaption);
1745 }
1746 
1747 
1749 {
1750  QCString shortName = baseName;
1751  int i;
1752  if ((i=shortName.findRev('/'))!=-1)
1753  {
1754  shortName=shortName.right(shortName.length()-i-1);
1755  }
1756  QCString outDir = Config_getString("LATEX_OUTPUT");
1757  writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS);
1758  visitPreStart(m_t, s->hasCaption(), shortName, s->width(),s->height());
1759  visitCaption(this, s->children());
1760  visitPostEnd(m_t, s->hasCaption());
1761 }
1762 
1763 
1765  const QCString &width,
1766  const QCString &height,
1767  bool hasCaption
1768  )
1769 {
1771  int i;
1772  if ((i=baseName.findRev('/'))!=-1)
1773  {
1774  baseName=baseName.right(baseName.length()-i-1);
1775  }
1776  if ((i=baseName.find('.'))!=-1)
1777  {
1778  baseName=baseName.left(i);
1779  }
1780  baseName.prepend("dia_");
1781 
1782  QCString outDir = Config_getString("LATEX_OUTPUT");
1783  writeDiaGraphFromFile(fileName,outDir,baseName,DIA_EPS);
1784  visitPreStart(m_t,hasCaption, baseName, width, height);
1785 }
1786 
1787 void LatexDocVisitor::endDiaFile(bool hasCaption)
1788 {
1789  if (m_hide) return;
1790  visitPostEnd(m_t,hasCaption);
1791 }
1792 
1793 
1795 {
1796  QCString shortName = baseName;
1797  int i;
1798  if ((i=shortName.findRev('/'))!=-1)
1799  {
1800  shortName=shortName.right(shortName.length()-i-1);
1801  }
1802  QCString outDir = Config_getString("LATEX_OUTPUT");
1803  writeDiaGraphFromFile(baseName+".dia",outDir,shortName,DIA_EPS);
1804  visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
1805  visitCaption(this, s->children());
1806  visitPostEnd(m_t, s->hasCaption());
1807 }
1808 
1810 {
1811  QCString shortName = baseName;
1812  int i;
1813  if ((i=shortName.findRev('/'))!=-1)
1814  {
1815  shortName=shortName.right(shortName.length()-i-1);
1816  }
1817  QCString outDir = Config_getString("LATEX_OUTPUT");
1818  generatePlantUMLOutput(baseName,outDir,PUML_EPS);
1819  visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
1820  visitCaption(this, s->children());
1821  visitPostEnd(m_t, s->hasCaption());
1822 }
1823 
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s)
static QCString name
Definition: declinfo.cpp:673
DocNode * parent() const
Definition: docparser.h:147
QCString exampleFile() const
Definition: docparser.h:454
QCString file() const
Definition: docparser.h:946
Type type() const
Definition: docparser.h:532
Type type() const
Definition: docparser.h:1034
virtual QCString trPrecondition()=0
span(IterB &&b, IterE &&e, Adaptor &&adaptor) -> span< decltype(adaptor(std::forward< IterB >(b))), decltype(adaptor(std::forward< IterE >(e))) >
virtual QCString trSince()=0
QCString file() const
Definition: docparser.h:1297
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
QCString name() const
Definition: docparser.h:695
QCString file() const
Definition: docparser.h:723
QCString anchor() const
Definition: docparser.h:830
QCString ref() const
Definition: docparser.h:219
void setInColSpan(bool b)
void endMscFile(bool hasCaption)
QCString anchor() const
Definition: docparser.h:277
void writeMscGraphFromFile(const char *inFile, const char *outDir, const char *outFile, MscOutputFormat format)
Definition: msc.cpp:92
QCString url() const
Definition: docparser.h:239
QCString width() const
Definition: docparser.h:697
const HtmlAttribList & attribs() const
Definition: docparser.h:927
QCString text() const
Definition: docparser.h:296
virtual QCString trAttention()=0
bool isFirst() const
Definition: docparser.h:537
static QCString result
bool isEmpty() const
Definition: qcstring.h:189
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
DocHtmlCaption * caption() const
Definition: docparser.h:1359
QCString file() const
Definition: docparser.h:747
QCString file() const
Definition: docparser.h:966
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
uint length() const
Definition: qcstring.h:195
QCString convertCharEntitiesToUTF8(const QCString &s)
Definition: util.cpp:5822
bool isEmail() const
Definition: docparser.h:242
int level() const
Definition: docparser.h:942
QCString anchor() const
Definition: docparser.h:944
#define IO_WriteOnly
Definition: qiodevice.h:62
bool hasCaption() const
Definition: docparser.h:773
int rowSpan() const
Definition: docparser.cpp:3433
virtual QCString trInvariant()=0
QCString blockId() const
Definition: docparser.h:505
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
virtual QCString trPageAbbreviation()=0
LatexDocVisitor(FTextStream &t, CodeOutputInterface &ci, const char *langExt, bool insideTabbing)
virtual QCString trPostcondition()=0
QCString text() const
Definition: docparser.h:503
QCString file() const
Definition: docparser.h:278
int rowIndex() const
Definition: docparser.h:1335
Type type() const
Definition: docparser.h:1101
void visit(DocWord *)
const bool FALSE
Definition: qglobal.h:370
bool isHeading() const
Definition: docparser.h:1320
virtual QCString trWarning()=0
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content)
Definition: plantuml.cpp:25
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
type * at(uint i) const
Definition: qlist.h:94
QCString left(uint len) const
Definition: qcstring.cpp:213
virtual QCString trCopyright()=0
const QList< DocNode > & paramTypes()
Definition: docparser.h:1170
static HtmlEntityMapper * instance()
Definition: htmlentity.cpp:341
Simplified and optimized version of QTextStream.
Definition: ftextstream.h:11
QCString file() const
Definition: docparser.h:827
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
Type type() const
Definition: docparser.h:502
virtual Kind kind() const =0
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity.
Definition: htmlentity.cpp:426
QCString anchor() const
Definition: docparser.h:859
int rowIndex() const
Definition: docparser.h:1270
void accept(DocVisitor *v)
Definition: docparser.h:1316
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
SrcLangExt
Definition: types.h:41
static QStrList * l
Definition: config.cpp:1044
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString anchor() const
Definition: docparser.h:967
QCString width() const
Definition: docparser.h:459
virtual QCString trReturns()=0
virtual QCString trDate()=0
Concrete visitor implementation for LaTeX output.
static void writeEndTableCommand(FTextStream &t, const DocNode *n)
QCString height() const
Definition: docparser.h:698
virtual QCString trNote()=0
void push(const type *d)
Definition: qstack.h:58
QCString exampleFile() const
Definition: docparser.h:542
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
QCString extractBlock(const QCString text, const QCString marker)
Definition: util.cpp:7998
int level() const
Definition: docparser.h:894
static bool insideMainPage
Definition: doxygen.h:104
Abstract visitor that participates in the visitor pattern.
Definition: docvisitor.h:90
bool isExample() const
Definition: docparser.h:453
virtual QCString trExceptions()=0
QCString height() const
Definition: docparser.h:460
#define QMIN(a, b)
Definition: qglobal.h:391
bool isSubPage() const
Definition: docparser.h:836
const int DocVisitor_Latex
Definition: docvisitor.h:24
static ParserManager * parserManager
Definition: doxygen.h:141
QCString targetTitle() const
Definition: docparser.h:831
def cli(ctx)
Definition: main.py:7
uint count() const
Definition: qlist.h:66
QCString height() const
Definition: docparser.h:775
void visitPre(DocAutoList *)
int writeBlock(const char *data, uint len)
Definition: qfile_unix.cpp:537
CodeOutputInterface & m_ci
QCString file() const
Definition: docparser.h:292
QCString file() const
Definition: docparser.h:771
void setNumCols(int num)
bool firstRow() const
QCString ref() const
Definition: docparser.h:829
int colSpan() const
Definition: docparser.cpp:3449
QCString file() const
Definition: docparser.h:857
virtual QCString trParameters()=0
void visitPost(DocAutoList *)
QCString text() const
Definition: docparser.h:450
fileName
Definition: dumpTree.py:9
QCString text() const
Definition: docparser.h:563
QCString width() const
Definition: docparser.h:726
QCString anchor() const
Definition: docparser.h:670
int currentColumn() const
void writeDiaFile(const QCString &fileName, DocVerbatim *s)
QCString word() const
Definition: docparser.h:199
bool hasCaption() const
Definition: docparser.h:749
int visibleCells() const
Definition: docparser.h:1334
void setInRowSpan(bool b)
QCString right(uint len) const
Definition: qcstring.cpp:231
bool hasCaption() const
Definition: docparser.h:696
std::void_t< T > n
void endDotFile(bool hasCaption)
virtual QCString trAuthor(bool first_capital, bool singular)=0
const double a
bool open(int)
Definition: qfile_unix.cpp:134
static const char * secLabels[maxLevels]
bool isExample() const
Definition: docparser.h:541
QCString context() const
Definition: docparser.h:535
QCString height() const
Definition: docparser.h:751
virtual QCString trReturnValues()=0
const int maxLevels
void endDiaFile(bool hasCaption)
void endLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
const QList< DocNode > & children() const
Definition: docparser.h:461
void writeDotGraphFromFile(const char *inFile, const char *outDir, const char *outFile, GraphOutputFormat format)
Definition: dot.cpp:4203
p
Definition: test.py:223
static void visitPostEnd(FTextStream &t, const bool hasCaption)
bool isLast() const
Definition: docparser.h:1262
QCString text() const
Definition: docparser.h:533
A bunch of utility functions.
bool isLast() const
Definition: docparser.h:538
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
type * current() const
Definition: qlist.h:146
QCString url() const
Definition: docparser.h:876
QCString width() const
Definition: docparser.h:750
virtual QCString trVersion()=0
QCString escapeMakeIndexChars(const char *s)
#define Config_getBool(val)
Definition: config.cpp:664
Type type() const
Definition: docparser.h:1057
Style style() const
Definition: docparser.h:329
bool isHeading() const
Definition: docparser.h:1260
void generatePlantUMLOutput(const char *baseName, const char *outDir, PlantUMLOutputFormat format)
Definition: plantuml.cpp:54
Definition: dot.h:42
static QCString escapeLabelName(const char *s)
void err(const char *fmt,...)
Definition: message.cpp:226
QCString entry() const
Definition: docparser.h:586
static const char * getSectionName(int level)
bool isExample() const
Definition: docparser.h:506
void filterLatexString(FTextStream &t, const char *str, bool insideTabbing, bool insidePre, bool insideItem, bool keepSpaces)
Definition: util.cpp:6533
type * pop()
Definition: qstack.h:59
QCString word() const
Definition: docparser.h:215
QCString language() const
Definition: docparser.h:456
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
static const QCString anchorPrefix
Definition: cite.h:30
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
DocParamSect::Direction direction() const
Definition: docparser.h:1172
QCString title() const
Definition: docparser.h:943
const RowSpanList & rowSpans()
Alignment alignment() const
Definition: docparser.cpp:3465
QCString file() const
Definition: docparser.h:495
FTextStream & m_t
bool hasInOutSpecifier() const
Definition: docparser.h:1103
const QList< DocNode > & parameters()
Definition: docparser.h:1169
void writeDiaGraphFromFile(const char *inFile, const char *outDir, const char *outFile, DiaOutputFormat format)
Definition: dia.cpp:28
QCString context() const
Definition: docparser.h:451
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
QCString height() const
Definition: docparser.h:727
int columnIndex() const
Definition: docparser.h:1271
bool isEnumList() const
Definition: docparser.h:621
void filter(const char *str)
bool hasTypeSpecifier() const
Definition: docparser.h:1104
SymType symbol() const
Definition: docparser.h:418
QCString file() const
Definition: docparser.h:669
bool hasLinkText() const
Definition: docparser.h:832
static QCString type
Definition: declinfo.cpp:672
void setCurrentColumn(int col)
int numCols() const
bool remove()
Definition: qfile.cpp:205
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
void setFirstRow(bool b)
QCString find(const QCString name) const
Definition: htmlattrib.h:41
static bool tableIsNested(const DocNode *n)
Translator * theTranslator
Definition: language.cpp:157
QCString anchor() const
Definition: docparser.h:1298
QCString exampleFile() const
Definition: docparser.h:507
QCString context() const
Definition: docparser.h:504
QCString anchor() const
Definition: docparser.h:295
bool refToTable() const
Definition: docparser.h:835
list x
Definition: train.py:276
virtual QCString trRemarks()=0
QCString file() const
Definition: docparser.h:217
bool enable() const
Definition: docparser.h:331
void writeMscFile(const QCString &fileName, DocVerbatim *s)
bool hasCaption() const
Definition: docparser.h:458
QCString chars() const
Definition: docparser.h:434
virtual QCString trSeeAlso()=0
QStack< bool > m_enabled
QCString width() const
Definition: docparser.h:774
DocHtmlRow * firstRow() const
Definition: docparser.h:1360
QCString title() const
Definition: docparser.h:671
static QCString baseName
Definition: scanner.cpp:10890
QCString extension() const
Definition: docparser.h:496
const char * cs
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
bool hasCaption() const
Definition: docparser.h:725
Type type() const
Definition: docparser.h:449
void close()
Definition: qfile_unix.cpp:614
unsigned uint
Definition: qglobal.h:351
Type type() const
Definition: docparser.h:694
QCString anchor() const
Definition: docparser.h:220
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
bool isLast() const
Definition: docparser.h:1125
bool inRowSpan() const
virtual void accept(DocVisitor *v)=0
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
static QCString * s
Definition: config.cpp:1042
def parent(G, child, parent_type)
Definition: graph.py:67
Definition: dia.h:24
const bool TRUE
Definition: qglobal.h:371
static QCString str
bool hasCaption()
Definition: docparser.h:1353
Definition: msc.h:24
QTextStream & endl(QTextStream &s)
uint numColumns() const
Definition: docparser.h:1357
void addRowSpan(ActiveRowSpan *span)
QStack< TableState > m_tableStateStack
bool inColSpan() const
#define ASSERT(x)
Definition: qglobal.h:590
static void writeStartTableCommand(FTextStream &t, const DocNode *n, int cols)
const QList< DocNode > & children() const
Definition: docparser.h:185
type * toFirst()
Definition: qlist.h:135