Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LatexDocVisitor Class Reference

Concrete visitor implementation for LaTeX output. More...

#include <latexdocvisitor.h>

Inheritance diagram for LatexDocVisitor:
DocVisitor

Classes

struct  ActiveRowSpan
 
struct  TableState
 

Public Member Functions

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

Private Types

typedef QList< ActiveRowSpanRowSpanList
 

Private Member Functions

void filter (const char *str)
 
void startLink (const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
 
void endLink (const QCString &ref, const QCString &file, const QCString &anchor)
 
QCString escapeMakeIndexChars (const char *s)
 
void startDotFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
 
void endDotFile (bool hasCaption)
 
void startMscFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
 
void endMscFile (bool hasCaption)
 
void writeMscFile (const QCString &fileName, DocVerbatim *s)
 
void startDiaFile (const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
 
void endDiaFile (bool hasCaption)
 
void writeDiaFile (const QCString &fileName, DocVerbatim *s)
 
void writePlantUMLFile (const QCString &fileName, DocVerbatim *s)
 
void pushEnabled ()
 
void popEnabled ()
 
void pushTableState ()
 
void popTableState ()
 
int currentColumn () const
 
void setCurrentColumn (int col)
 
int numCols () const
 
void setNumCols (int num)
 
bool inRowSpan () const
 
void setInRowSpan (bool b)
 
bool inColSpan () const
 
void setInColSpan (bool b)
 
bool firstRow () const
 
void setFirstRow (bool b)
 
const RowSpanListrowSpans ()
 
void addRowSpan (ActiveRowSpan *span)
 
bool insideTable () const
 

Private Attributes

FTextStreamm_t
 
CodeOutputInterfacem_ci
 
bool m_insidePre
 
bool m_insideItem
 
bool m_hide
 
bool m_hideCaption
 
bool m_insideTabbing
 
QStack< boolm_enabled
 
QCString m_langExt
 
QStack< TableStatem_tableStateStack
 
RowSpanList m_emptyRowSpanList
 

Detailed Description

Concrete visitor implementation for LaTeX output.

Definition at line 32 of file latexdocvisitor.h.

Member Typedef Documentation

Definition at line 154 of file latexdocvisitor.h.

Constructor & Destructor Documentation

LatexDocVisitor::LatexDocVisitor ( FTextStream t,
CodeOutputInterface ci,
const char *  langExt,
bool  insideTabbing 
)

Definition at line 171 of file latexdocvisitor.cpp.

175  m_langExt(langExt)
176 {
177  m_tableStateStack.setAutoDelete(TRUE);
178 }
const bool FALSE
Definition: qglobal.h:370
const int DocVisitor_Latex
Definition: docvisitor.h:24
CodeOutputInterface & m_ci
FTextStream & m_t
DocVisitor(int id)
Definition: docvisitor.h:94
const bool TRUE
Definition: qglobal.h:371
QStack< TableState > m_tableStateStack

Member Function Documentation

void LatexDocVisitor::addRowSpan ( ActiveRowSpan span)
inlineprivate

Definition at line 265 of file latexdocvisitor.h.

266  {
267  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->rowSpans.append(span);
268  }
QStack< TableState > m_tableStateStack
int LatexDocVisitor::currentColumn ( ) const
inlineprivate

Definition at line 221 of file latexdocvisitor.h.

222  {
223  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->currentColumn : 0;
224  }
QStack< TableState > m_tableStateStack
void LatexDocVisitor::endDiaFile ( bool  hasCaption)
private

Definition at line 1787 of file latexdocvisitor.cpp.

1788 {
1789  if (m_hide) return;
1790  visitPostEnd(m_t,hasCaption);
1791 }
static void visitPostEnd(FTextStream &t, const bool hasCaption)
FTextStream & m_t
void LatexDocVisitor::endDotFile ( bool  hasCaption)
private

Definition at line 1712 of file latexdocvisitor.cpp.

1713 {
1714  if (m_hide) return;
1715  visitPostEnd(m_t,hasCaption);
1716 }
static void visitPostEnd(FTextStream &t, const bool hasCaption)
FTextStream & m_t
void LatexDocVisitor::endLink ( const QCString ref,
const QCString file,
const QCString anchor 
)
private

Definition at line 1662 of file latexdocvisitor.cpp.

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 }
bool isEmpty() const
Definition: qcstring.h:189
virtual QCString trPageAbbreviation()=0
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void filter(const char *str)
Translator * theTranslator
Definition: language.cpp:157
void LatexDocVisitor::endMscFile ( bool  hasCaption)
private

Definition at line 1741 of file latexdocvisitor.cpp.

1742 {
1743  if (m_hide) return;
1744  visitPostEnd(m_t,hasCaption);
1745 }
static void visitPostEnd(FTextStream &t, const bool hasCaption)
FTextStream & m_t
QCString LatexDocVisitor::escapeMakeIndexChars ( const char *  s)
private

Definition at line 143 of file latexdocvisitor.cpp.

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 }
static QCString result
p
Definition: test.py:223
FTextStream & m_t
void filter(const char *str)
static QCString * s
Definition: config.cpp:1042
static QCString str
void LatexDocVisitor::filter ( const char *  str)
private

Definition at line 1625 of file latexdocvisitor.cpp.

1626 {
1628 }
void filterLatexString(FTextStream &t, const char *str, bool insideTabbing, bool insidePre, bool insideItem, bool keepSpaces)
Definition: util.cpp:6533
FTextStream & m_t
static QCString str
bool LatexDocVisitor::firstRow ( ) const
inlineprivate

Definition at line 253 of file latexdocvisitor.h.

254  {
255  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->firstRow : FALSE;
256  }
const bool FALSE
Definition: qglobal.h:370
QStack< TableState > m_tableStateStack
bool LatexDocVisitor::inColSpan ( ) const
inlineprivate

Definition at line 245 of file latexdocvisitor.h.

246  {
247  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inColSpan : FALSE;
248  }
const bool FALSE
Definition: qglobal.h:370
QStack< TableState > m_tableStateStack
bool LatexDocVisitor::inRowSpan ( ) const
inlineprivate

Definition at line 237 of file latexdocvisitor.h.

238  {
239  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inRowSpan : FALSE;
240  }
const bool FALSE
Definition: qglobal.h:370
QStack< TableState > m_tableStateStack
bool LatexDocVisitor::insideTable ( ) const
inlineprivate

Definition at line 269 of file latexdocvisitor.h.

270  {
271  return !m_tableStateStack.isEmpty();
272  }
QStack< TableState > m_tableStateStack
int LatexDocVisitor::numCols ( ) const
inlineprivate

Definition at line 229 of file latexdocvisitor.h.

230  {
231  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->numCols : 0;
232  }
QStack< TableState > m_tableStateStack
void LatexDocVisitor::popEnabled ( )
private

Definition at line 1681 of file latexdocvisitor.cpp.

1682 {
1683  bool *v=m_enabled.pop();
1684  ASSERT(v!=0);
1685  m_hide = *v;
1686  delete v;
1687 }
type * pop()
Definition: qstack.h:59
QStack< bool > m_enabled
#define ASSERT(x)
Definition: qglobal.h:590
void LatexDocVisitor::popTableState ( )
inlineprivate

Definition at line 217 of file latexdocvisitor.h.

218  {
219  delete m_tableStateStack.pop();
220  }
QStack< TableState > m_tableStateStack
void LatexDocVisitor::pushEnabled ( )
private

Definition at line 1676 of file latexdocvisitor.cpp.

1677 {
1678  m_enabled.push(new bool(m_hide));
1679 }
void push(const type *d)
Definition: qstack.h:58
QStack< bool > m_enabled
void LatexDocVisitor::pushTableState ( )
inlineprivate

Definition at line 213 of file latexdocvisitor.h.

214  {
215  m_tableStateStack.push(new TableState);
216  }
QStack< TableState > m_tableStateStack
const RowSpanList& LatexDocVisitor::rowSpans ( )
inlineprivate

Definition at line 261 of file latexdocvisitor.h.

262  {
263  return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->rowSpans : m_emptyRowSpanList;
264  }
RowSpanList m_emptyRowSpanList
QStack< TableState > m_tableStateStack
void LatexDocVisitor::setCurrentColumn ( int  col)
inlineprivate

Definition at line 225 of file latexdocvisitor.h.

226  {
227  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->currentColumn = col;
228  }
QStack< TableState > m_tableStateStack
void LatexDocVisitor::setFirstRow ( bool  b)
inlineprivate

Definition at line 257 of file latexdocvisitor.h.

258  {
259  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->firstRow = b;
260  }
static bool * b
Definition: config.cpp:1043
QStack< TableState > m_tableStateStack
void LatexDocVisitor::setInColSpan ( bool  b)
inlineprivate

Definition at line 249 of file latexdocvisitor.h.

250  {
251  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inColSpan = b;
252  }
static bool * b
Definition: config.cpp:1043
QStack< TableState > m_tableStateStack
void LatexDocVisitor::setInRowSpan ( bool  b)
inlineprivate

Definition at line 241 of file latexdocvisitor.h.

242  {
243  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inRowSpan = b;
244  }
static bool * b
Definition: config.cpp:1043
QStack< TableState > m_tableStateStack
void LatexDocVisitor::setNumCols ( int  num)
inlineprivate

Definition at line 233 of file latexdocvisitor.h.

234  {
235  if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->numCols = num;
236  }
QStack< TableState > m_tableStateStack
void LatexDocVisitor::startDiaFile ( const QCString fileName,
const QCString width,
const QCString height,
bool  hasCaption 
)
private

Definition at line 1764 of file latexdocvisitor.cpp.

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 }
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
#define Config_getString(val)
Definition: config.cpp:660
FTextStream & m_t
void writeDiaGraphFromFile(const char *inFile, const char *outDir, const char *outFile, DiaOutputFormat format)
Definition: dia.cpp:28
static QCString baseName
Definition: scanner.cpp:10890
Definition: dia.h:24
void LatexDocVisitor::startDotFile ( const QCString fileName,
const QCString width,
const QCString height,
bool  hasCaption 
)
private

Definition at line 1689 of file latexdocvisitor.cpp.

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 }
static QCString name
Definition: declinfo.cpp:673
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
void writeDotGraphFromFile(const char *inFile, const char *outDir, const char *outFile, GraphOutputFormat format)
Definition: dot.cpp:4203
#define Config_getString(val)
Definition: config.cpp:660
Definition: dot.h:42
FTextStream & m_t
static QCString baseName
Definition: scanner.cpp:10890
void LatexDocVisitor::startLink ( const QCString ref,
const QCString file,
const QCString anchor,
bool  refToTable = FALSE 
)
private

Definition at line 1630 of file latexdocvisitor.cpp.

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 }
bool isEmpty() const
Definition: qcstring.h:189
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void LatexDocVisitor::startMscFile ( const QCString fileName,
const QCString width,
const QCString height,
bool  hasCaption 
)
private

Definition at line 1718 of file latexdocvisitor.cpp.

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 }
void writeMscGraphFromFile(const char *inFile, const char *outDir, const char *outFile, MscOutputFormat format)
Definition: msc.cpp:92
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
int find(char c, int index=0, bool cs=TRUE) const
Definition: qcstring.cpp:41
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
#define Config_getString(val)
Definition: config.cpp:660
FTextStream & m_t
static QCString baseName
Definition: scanner.cpp:10890
Definition: msc.h:24
void LatexDocVisitor::visit ( DocWord w)
virtual

Implements DocVisitor.

Definition at line 184 of file latexdocvisitor.cpp.

185 {
186  if (m_hide) return;
187  filter(w->word());
188 }
QCString word() const
Definition: docparser.h:199
void filter(const char *str)
void LatexDocVisitor::visit ( DocLinkedWord w)
virtual

Implements DocVisitor.

Definition at line 190 of file latexdocvisitor.cpp.

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 }
QCString ref() const
Definition: docparser.h:219
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
void endLink(const QCString &ref, const QCString &file, const QCString &anchor)
QCString word() const
Definition: docparser.h:215
void filter(const char *str)
QCString file() const
Definition: docparser.h:217
QCString anchor() const
Definition: docparser.h:220
void LatexDocVisitor::visit ( DocWhiteSpace w)
virtual

Implements DocVisitor.

Definition at line 198 of file latexdocvisitor.cpp.

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 }
FTextStream & m_t
QCString chars() const
Definition: docparser.h:434
void LatexDocVisitor::visit ( DocSymbol s)
virtual

Implements DocVisitor.

Definition at line 211 of file latexdocvisitor.cpp.

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 }
static HtmlEntityMapper * instance()
Definition: htmlentity.cpp:341
const char * latex(DocSymbol::SymType symb) const
Access routine to the LaTeX code of the HTML entity.
Definition: htmlentity.cpp:426
void err(const char *fmt,...)
Definition: message.cpp:226
FTextStream & m_t
SymType symbol() const
Definition: docparser.h:418
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visit ( DocURL u)
virtual

Implements DocVisitor.

Definition at line 236 of file latexdocvisitor.cpp.

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 }
QCString url() const
Definition: docparser.h:239
bool isEmail() const
Definition: docparser.h:242
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void filter(const char *str)
void LatexDocVisitor::visit ( DocLineBreak )
virtual

Implements DocVisitor.

Definition at line 250 of file latexdocvisitor.cpp.

251 {
252  if (m_hide) return;
253  m_t << "~\\newline\n";
254 }
FTextStream & m_t
void LatexDocVisitor::visit ( DocHorRuler )
virtual

Implements DocVisitor.

Definition at line 256 of file latexdocvisitor.cpp.

257 {
258  if (m_hide) return;
259  m_t << "\n\n";
260 }
FTextStream & m_t
void LatexDocVisitor::visit ( DocStyleChange s)
virtual

Implements DocVisitor.

Definition at line 262 of file latexdocvisitor.cpp.

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 }
const bool FALSE
Definition: qglobal.h:370
Style style() const
Definition: docparser.h:329
FTextStream & m_t
bool enable() const
Definition: docparser.h:331
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visit ( DocVerbatim s)
virtual

Implements DocVisitor.

Definition at line 305 of file latexdocvisitor.cpp.

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  );
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 
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 }
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s)
QCString exampleFile() const
Definition: docparser.h:454
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
#define IO_WriteOnly
Definition: qiodevice.h:62
QCString writePlantUMLSource(const QCString &outDir, const QCString &fileName, const QCString &content)
Definition: plantuml.cpp:25
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
SrcLangExt
Definition: types.h:41
QCString width() const
Definition: docparser.h:459
bool isExample() const
Definition: docparser.h:453
QCString height() const
Definition: docparser.h:460
static ParserManager * parserManager
Definition: doxygen.h:141
CodeOutputInterface & m_ci
QCString text() const
Definition: docparser.h:450
fileName
Definition: dumpTree.py:9
void endDotFile(bool hasCaption)
const QList< DocNode > & children() const
Definition: docparser.h:461
const char * data() const
Definition: qcstring.h:207
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
void err(const char *fmt,...)
Definition: message.cpp:226
QCString language() const
Definition: docparser.h:456
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
QCString & sprintf(const char *format,...)
Definition: qcstring.cpp:27
FTextStream & m_t
QCString context() const
Definition: docparser.h:451
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
void writeMscFile(const QCString &fileName, DocVerbatim *s)
bool hasCaption() const
Definition: docparser.h:458
static QCString baseName
Definition: scanner.cpp:10890
Type type() const
Definition: docparser.h:449
virtual void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)=0
void LatexDocVisitor::visit ( DocAnchor anc)
virtual

Implements DocVisitor.

Definition at line 407 of file latexdocvisitor.cpp.

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 }
QCString anchor() const
Definition: docparser.h:277
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:278
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visit ( DocInclude inc)
virtual

Implements DocVisitor.

Definition at line 418 of file latexdocvisitor.cpp.

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 }
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
static TemplateVariant parseCode(MemberDef *md, const QCString &scopeName, const QCString &relPath, const QCString &code, int startLine=-1, int endLine=-1, bool showLineNumbers=FALSE)
Definition: context.cpp:1266
QCString blockId() const
Definition: docparser.h:505
QCString text() const
Definition: docparser.h:503
Type type() const
Definition: docparser.h:502
SrcLangExt
Definition: types.h:41
QCString extractBlock(const QCString text, const QCString marker)
Definition: util.cpp:7998
static ParserManager * parserManager
Definition: doxygen.h:141
CodeOutputInterface & m_ci
bool isExample() const
Definition: docparser.h:506
QCString file() const
Definition: docparser.h:495
FTextStream & m_t
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
QCString exampleFile() const
Definition: docparser.h:507
QCString context() const
Definition: docparser.h:504
QCString extension() const
Definition: docparser.h:496
The QFileInfo class provides system-independent file information.
Definition: qfileinfo.h:51
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visit ( DocIncOperator op)
virtual

Implements DocVisitor.

Definition at line 475 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:532
ParserInterface * getParser(const char *extension)
Definition: parserintf.h:191
bool isFirst() const
Definition: docparser.h:537
SrcLangExt
Definition: types.h:41
QCString exampleFile() const
Definition: docparser.h:542
static ParserManager * parserManager
Definition: doxygen.h:141
CodeOutputInterface & m_ci
bool isExample() const
Definition: docparser.h:541
QCString context() const
Definition: docparser.h:535
QCString text() const
Definition: docparser.h:533
bool isLast() const
Definition: docparser.h:538
FTextStream & m_t
SrcLangExt getLanguageFromFileName(const QCString fileName)
Definition: util.cpp:7061
virtual void parseCode(CodeOutputInterface &codeOutIntf, const char *scopeName, const QCString &input, SrcLangExt lang, bool isExampleBlock, const char *exampleName=0, FileDef *fileDef=0, int startLine=-1, int endLine=-1, bool inlineFragment=FALSE, MemberDef *memberDef=0, bool showLineNumbers=TRUE, Definition *searchCtx=0, bool collectXRefs=TRUE)=0
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visit ( DocFormula f)
virtual

Implements DocVisitor.

Definition at line 509 of file latexdocvisitor.cpp.

510 {
511  if (m_hide) return;
512  m_t << f->text();
513 }
QCString text() const
Definition: docparser.h:563
FTextStream & m_t
void LatexDocVisitor::visit ( DocIndexEntry i)
virtual

Implements DocVisitor.

Definition at line 515 of file latexdocvisitor.cpp.

516 {
517  if (m_hide) return;
518  m_t << "\\index{" << escapeLabelName(i->entry()) << "@{";
520  m_t << "}}";
521 }
QCString escapeMakeIndexChars(const char *s)
static QCString escapeLabelName(const char *s)
QCString entry() const
Definition: docparser.h:586
FTextStream & m_t
void LatexDocVisitor::visit ( DocSimpleSectSep )
virtual

Implements DocVisitor.

Definition at line 523 of file latexdocvisitor.cpp.

524 {
525 }
void LatexDocVisitor::visit ( DocCite cite)
virtual

Implements DocVisitor.

Definition at line 527 of file latexdocvisitor.cpp.

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 }
QCString text() const
Definition: docparser.h:296
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:292
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static const QCString anchorPrefix
Definition: cite.h:30
FTextStream & m_t
void filter(const char *str)
QCString anchor() const
Definition: docparser.h:295
void LatexDocVisitor::visitPost ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 562 of file latexdocvisitor.cpp.

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 }
FTextStream & m_t
bool isEnumList() const
Definition: docparser.h:621
void LatexDocVisitor::visitPost ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 581 of file latexdocvisitor.cpp.

582 {
583 }
void LatexDocVisitor::visitPost ( DocPara p)
virtual

Implements DocVisitor.

Definition at line 589 of file latexdocvisitor.cpp.

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 }
DocNode * parent() const
Definition: docparser.h:147
virtual Kind kind() const =0
FTextStream & m_t
bool isLast() const
Definition: docparser.h:1125
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 603 of file latexdocvisitor.cpp.

604 {
605 }
void LatexDocVisitor::visitPost ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 692 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:1057
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 757 of file latexdocvisitor.cpp.

758 {
759  if (m_hide) return;
761  m_t << "}\n";
762 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 770 of file latexdocvisitor.cpp.

771 {
772  if (m_hide) return;
773  m_t << "\\end{DoxyItemize}" << endl;
774 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 782 of file latexdocvisitor.cpp.

783 {
784 }
void LatexDocVisitor::visitPost ( DocSection )
virtual

Implements DocVisitor.

Definition at line 798 of file latexdocvisitor.cpp.

799 {
800 }
void LatexDocVisitor::visitPost ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 811 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:1034
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 826 of file latexdocvisitor.cpp.

827 {
828 }
void LatexDocVisitor::visitPost ( DocHtmlDescList dl)
virtual

Implements DocVisitor.

Definition at line 856 of file latexdocvisitor.cpp.

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 }
const HtmlAttribList & attribs() const
Definition: docparser.h:927
FTextStream & m_t
QCString find(const QCString name) const
Definition: htmlattrib.h:41
void LatexDocVisitor::visitPost ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 877 of file latexdocvisitor.cpp.

878 {
879  if (m_hide) return;
881  m_t << "]";
882 }
const bool FALSE
Definition: qglobal.h:370
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 888 of file latexdocvisitor.cpp.

889 {
890 }
void LatexDocVisitor::visitPost ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 972 of file latexdocvisitor.cpp.

973 {
974  if (m_hide) return;
976  popTableState();
977 }
DocNode * parent() const
Definition: docparser.h:147
static void writeEndTableCommand(FTextStream &t, const DocNode *n)
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocHtmlCaption c)
virtual

Implements DocVisitor.

Definition at line 985 of file latexdocvisitor.cpp.

986 {
988 }
void LatexDocVisitor::visitPost ( DocHtmlRow row)
virtual

Implements DocVisitor.

Definition at line 996 of file latexdocvisitor.cpp.

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 }
span(IterB &&b, IterE &&e, Adaptor &&adaptor) -> span< decltype(adaptor(std::forward< IterB >(b))), decltype(adaptor(std::forward< IterE >(e))) >
int rowIndex() const
Definition: docparser.h:1335
bool isHeading() const
Definition: docparser.h:1320
type * at(uint i) const
Definition: qlist.h:94
uint count() const
Definition: qlist.h:66
bool firstRow() const
int currentColumn() const
int visibleCells() const
Definition: docparser.h:1334
const RowSpanList & rowSpans()
FTextStream & m_t
int numCols() const
unsigned uint
Definition: qglobal.h:351
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 1161 of file latexdocvisitor.cpp.

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 }
void setInColSpan(bool b)
const bool FALSE
Definition: qglobal.h:370
void setInRowSpan(bool b)
bool isLast() const
Definition: docparser.h:1262
bool isHeading() const
Definition: docparser.h:1260
FTextStream & m_t
bool inRowSpan() const
bool inColSpan() const
void LatexDocVisitor::visitPost ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 1189 of file latexdocvisitor.cpp.

1190 {
1191  if (m_hide) return;
1192  //m_t << "\\end{DoxyInternal}" << endl;
1193 }
void LatexDocVisitor::visitPost ( DocHRef )
virtual

Implements DocVisitor.

Definition at line 1207 of file latexdocvisitor.cpp.

1208 {
1209  if (m_hide) return;
1210  m_t << "}";
1211 }
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocHtmlHeader )
virtual

Implements DocVisitor.

Definition at line 1219 of file latexdocvisitor.cpp.

1220 {
1221  if (m_hide) return;
1222  m_t << "}";
1223 }
FTextStream & m_t
void LatexDocVisitor::visitPost ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 1244 of file latexdocvisitor.cpp.

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 }
bool hasCaption() const
Definition: docparser.h:696
static void visitPostEnd(FTextStream &t, const bool hasCaption)
FTextStream & m_t
Type type() const
Definition: docparser.h:694
void LatexDocVisitor::visitPost ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 1263 of file latexdocvisitor.cpp.

1264 {
1265  if (m_hide) return;
1266  endDotFile(df->hasCaption());
1267 }
void endDotFile(bool hasCaption)
bool hasCaption() const
Definition: docparser.h:725
void LatexDocVisitor::visitPost ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 1274 of file latexdocvisitor.cpp.

1275 {
1276  if (m_hide) return;
1277  endMscFile(df->hasCaption());
1278 }
void endMscFile(bool hasCaption)
bool hasCaption() const
Definition: docparser.h:749
void LatexDocVisitor::visitPost ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 1286 of file latexdocvisitor.cpp.

1287 {
1288  if (m_hide) return;
1289  endDiaFile(df->hasCaption());
1290 }
bool hasCaption() const
Definition: docparser.h:773
void endDiaFile(bool hasCaption)
void LatexDocVisitor::visitPost ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 1297 of file latexdocvisitor.cpp.

1298 {
1299  if (m_hide) return;
1300  endLink(lnk->ref(),lnk->file(),lnk->anchor());
1301 }
void endLink(const QCString &ref, const QCString &file, const QCString &anchor)
void LatexDocVisitor::visitPost ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1319 of file latexdocvisitor.cpp.

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 }
QCString anchor() const
Definition: docparser.h:830
bool isEmpty() const
Definition: qcstring.h:189
QCString file() const
Definition: docparser.h:827
bool isSubPage() const
Definition: docparser.h:836
QCString ref() const
Definition: docparser.h:829
void endLink(const QCString &ref, const QCString &file, const QCString &anchor)
void LatexDocVisitor::visitPost ( DocSecRefItem ref)
virtual

Implements DocVisitor.

Definition at line 1343 of file latexdocvisitor.cpp.

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 }
QCString file() const
Definition: docparser.h:966
QCString anchor() const
Definition: docparser.h:967
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 1362 of file latexdocvisitor.cpp.

1363 {
1364  if (m_hide) return;
1365  m_t << "\\end{DoxyCompactList}" << endl;
1366  m_t << "\\end{multicols}" << endl;
1367  m_t << "\\normalsize" << endl;
1368 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1405 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:1101
FTextStream & m_t
#define ASSERT(x)
Definition: qglobal.h:590
void LatexDocVisitor::visitPost ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 1516 of file latexdocvisitor.cpp.

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 }
DocNode * parent() const
Definition: docparser.h:147
virtual Kind kind() const =0
FTextStream & m_t
static QCString type
Definition: declinfo.cpp:672
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1558 of file latexdocvisitor.cpp.

1559 {
1560  if (m_hide) return;
1561  if (x->title().isEmpty()) return;
1562  m_t << "\\end{DoxyRefDesc}" << endl;
1563 }
bool isEmpty() const
Definition: qcstring.h:189
FTextStream & m_t
QCString title() const
Definition: docparser.h:671
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocInternalRef ref)
virtual

Implements DocVisitor.

Definition at line 1571 of file latexdocvisitor.cpp.

1572 {
1573  if (m_hide) return;
1574  endLink(0,ref->file(),ref->anchor());
1575 }
QCString anchor() const
Definition: docparser.h:859
QCString file() const
Definition: docparser.h:857
void endLink(const QCString &ref, const QCString &file, const QCString &anchor)
void LatexDocVisitor::visitPost ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1581 of file latexdocvisitor.cpp.

1582 {
1583 }
void LatexDocVisitor::visitPost ( DocText )
virtual

Implements DocVisitor.

Definition at line 1589 of file latexdocvisitor.cpp.

1590 {
1591 }
void LatexDocVisitor::visitPost ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1599 of file latexdocvisitor.cpp.

1600 {
1601  if (m_hide) return;
1602  m_t << "\\end{quote}" << endl;
1603 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPost ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1610 of file latexdocvisitor.cpp.

1611 {
1612  if (m_hide) return;
1613 }
void LatexDocVisitor::visitPost ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1620 of file latexdocvisitor.cpp.

1621 {
1622  if (m_hide) return;
1623 }
void LatexDocVisitor::visitPre ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 549 of file latexdocvisitor.cpp.

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 }
FTextStream & m_t
bool isEnumList() const
Definition: docparser.h:621
void LatexDocVisitor::visitPre ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 575 of file latexdocvisitor.cpp.

576 {
577  if (m_hide) return;
578  m_t << "\n\\item ";
579 }
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocPara )
virtual

Implements DocVisitor.

Definition at line 585 of file latexdocvisitor.cpp.

586 {
587 }
void LatexDocVisitor::visitPre ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 599 of file latexdocvisitor.cpp.

600 {
601 }
void LatexDocVisitor::visitPre ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 607 of file latexdocvisitor.cpp.

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 }
virtual QCString trPrecondition()=0
virtual QCString trSince()=0
virtual QCString trAttention()=0
virtual QCString trInvariant()=0
virtual QCString trPostcondition()=0
const bool FALSE
Definition: qglobal.h:370
virtual QCString trWarning()=0
virtual QCString trCopyright()=0
virtual QCString trReturns()=0
virtual QCString trDate()=0
virtual QCString trNote()=0
virtual QCString trAuthor(bool first_capital, bool singular)=0
virtual QCString trVersion()=0
Type type() const
Definition: docparser.h:1057
FTextStream & m_t
void filter(const char *str)
Translator * theTranslator
Definition: language.cpp:157
virtual QCString trRemarks()=0
virtual QCString trSeeAlso()=0
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visitPre ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 753 of file latexdocvisitor.cpp.

754 {
755 }
void LatexDocVisitor::visitPre ( DocSimpleList )
virtual

Implements DocVisitor.

Definition at line 764 of file latexdocvisitor.cpp.

765 {
766  if (m_hide) return;
767  m_t << "\\begin{DoxyItemize}" << endl;
768 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPre ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 776 of file latexdocvisitor.cpp.

777 {
778  if (m_hide) return;
779  m_t << "\\item ";
780 }
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 786 of file latexdocvisitor.cpp.

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 }
QCString file() const
Definition: docparser.h:946
QCString convertCharEntitiesToUTF8(const QCString &s)
Definition: util.cpp:5822
int level() const
Definition: docparser.h:942
QCString anchor() const
Definition: docparser.h:944
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
const char * data() const
Definition: qcstring.h:207
#define Config_getBool(val)
Definition: config.cpp:664
static const char * getSectionName(int level)
QCString title() const
Definition: docparser.h:943
FTextStream & m_t
void filter(const char *str)
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPre ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 802 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:1034
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 820 of file latexdocvisitor.cpp.

821 {
822  if (m_hide) return;
823  m_t << "\n\\item ";
824 }
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocHtmlDescList dl)
virtual

Implements DocVisitor.

Definition at line 842 of file latexdocvisitor.cpp.

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 }
const HtmlAttribList & attribs() const
Definition: docparser.h:927
FTextStream & m_t
QCString find(const QCString name) const
Definition: htmlattrib.h:41
void LatexDocVisitor::visitPre ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 870 of file latexdocvisitor.cpp.

871 {
872  if (m_hide) return;
873  m_t << "\n\\item[";
875 }
FTextStream & m_t
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visitPre ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 884 of file latexdocvisitor.cpp.

885 {
886 }
void LatexDocVisitor::visitPre ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 929 of file latexdocvisitor.cpp.

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 }
DocNode * parent() const
Definition: docparser.h:147
QCString file() const
Definition: docparser.h:1297
bool isEmpty() const
Definition: qcstring.h:189
DocHtmlCaption * caption() const
Definition: docparser.h:1359
const bool FALSE
Definition: qglobal.h:370
bool isHeading() const
Definition: docparser.h:1320
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
void accept(DocVisitor *v)
Definition: docparser.h:1316
void setNumCols(int num)
bool firstRow() const
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
void setFirstRow(bool b)
QCString anchor() const
Definition: docparser.h:1298
DocHtmlRow * firstRow() const
Definition: docparser.h:1360
const bool TRUE
Definition: qglobal.h:371
bool hasCaption()
Definition: docparser.h:1353
QTextStream & endl(QTextStream &s)
uint numColumns() const
Definition: docparser.h:1357
static void writeStartTableCommand(FTextStream &t, const DocNode *n, int cols)
const QList< DocNode > & children() const
Definition: docparser.h:185
void LatexDocVisitor::visitPre ( DocHtmlCaption c)
virtual

Implements DocVisitor.

Definition at line 979 of file latexdocvisitor.cpp.

980 {
982  m_hide = TRUE;
983 }
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visitPre ( DocHtmlRow r)
virtual

Implements DocVisitor.

Definition at line 990 of file latexdocvisitor.cpp.

991 {
992  setCurrentColumn(0);
993  if (r->isHeading()) m_t << "\\rowcolor{\\tableheadbgcolor}";
994 }
bool isHeading() const
Definition: docparser.h:1320
FTextStream & m_t
void setCurrentColumn(int col)
void LatexDocVisitor::visitPre ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 1077 of file latexdocvisitor.cpp.

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() << "}|}{}";
1107  setCurrentColumn(currentColumn()+span->colSpan);
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 }
DocNode * parent() const
Definition: docparser.h:147
span(IterB &&b, IterE &&e, Adaptor &&adaptor) -> span< decltype(adaptor(std::forward< IterB >(b))), decltype(adaptor(std::forward< IterE >(e))) >
void setInColSpan(bool b)
int rowSpan() const
Definition: docparser.cpp:3433
type * at(uint i) const
Definition: qlist.h:94
virtual Kind kind() const =0
uint count() const
Definition: qlist.h:66
int colSpan() const
Definition: docparser.cpp:3449
int currentColumn() const
int visibleCells() const
Definition: docparser.h:1334
void setInRowSpan(bool b)
const double a
bool isHeading() const
Definition: docparser.h:1260
const RowSpanList & rowSpans()
Alignment alignment() const
Definition: docparser.cpp:3465
FTextStream & m_t
int columnIndex() const
Definition: docparser.h:1271
void setCurrentColumn(int col)
int numCols() const
const char * cs
unsigned uint
Definition: qglobal.h:351
const bool TRUE
Definition: qglobal.h:371
void addRowSpan(ActiveRowSpan *span)
void LatexDocVisitor::visitPre ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 1181 of file latexdocvisitor.cpp.

1182 {
1183  if (m_hide) return;
1184  //m_t << "\\begin{DoxyInternal}{";
1185  //filter(theTranslator->trForInternalUseOnly());
1186  //m_t << "}\n";
1187 }
void LatexDocVisitor::visitPre ( DocHRef href)
virtual

Implements DocVisitor.

Definition at line 1195 of file latexdocvisitor.cpp.

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 }
QCString url() const
Definition: docparser.h:876
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocHtmlHeader header)
virtual

Implements DocVisitor.

Definition at line 1213 of file latexdocvisitor.cpp.

1214 {
1215  if (m_hide) return;
1216  m_t << "\\" << getSectionName(header->level()) << "*{";
1217 }
int level() const
Definition: docparser.h:894
static const char * getSectionName(int level)
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 1224 of file latexdocvisitor.cpp.

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 }
QCString name() const
Definition: docparser.h:695
QCString width() const
Definition: docparser.h:697
uint length() const
Definition: qcstring.h:195
QCString left(uint len) const
Definition: qcstring.cpp:213
QCString height() const
Definition: docparser.h:698
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
QCString right(uint len) const
Definition: qcstring.cpp:231
bool hasCaption() const
Definition: docparser.h:696
FTextStream & m_t
Type type() const
Definition: docparser.h:694
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visitPre ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 1257 of file latexdocvisitor.cpp.

1258 {
1259  if (m_hide) return;
1260  startDotFile(df->file(),df->width(),df->height(),df->hasCaption());
1261 }
QCString file() const
Definition: docparser.h:723
void startDotFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
QCString width() const
Definition: docparser.h:726
QCString height() const
Definition: docparser.h:727
bool hasCaption() const
Definition: docparser.h:725
void LatexDocVisitor::visitPre ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 1268 of file latexdocvisitor.cpp.

1269 {
1270  if (m_hide) return;
1271  startMscFile(df->file(),df->width(),df->height(),df->hasCaption());
1272 }
void startMscFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
QCString file() const
Definition: docparser.h:747
bool hasCaption() const
Definition: docparser.h:749
QCString height() const
Definition: docparser.h:751
QCString width() const
Definition: docparser.h:750
void LatexDocVisitor::visitPre ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 1280 of file latexdocvisitor.cpp.

1281 {
1282  if (m_hide) return;
1283  startDiaFile(df->file(),df->width(),df->height(),df->hasCaption());
1284 }
bool hasCaption() const
Definition: docparser.h:773
QCString height() const
Definition: docparser.h:775
QCString file() const
Definition: docparser.h:771
QCString width() const
Definition: docparser.h:774
void startDiaFile(const QCString &fileName, const QCString &width, const QCString &height, bool hasCaption)
void LatexDocVisitor::visitPre ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 1291 of file latexdocvisitor.cpp.

1292 {
1293  if (m_hide) return;
1294  startLink(lnk->ref(),lnk->file(),lnk->anchor());
1295 }
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
void LatexDocVisitor::visitPre ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1303 of file latexdocvisitor.cpp.

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 }
QCString anchor() const
Definition: docparser.h:830
bool isEmpty() const
Definition: qcstring.h:189
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
QCString file() const
Definition: docparser.h:827
bool isSubPage() const
Definition: docparser.h:836
QCString targetTitle() const
Definition: docparser.h:831
QCString ref() const
Definition: docparser.h:829
void filter(const char *str)
bool hasLinkText() const
Definition: docparser.h:832
bool refToTable() const
Definition: docparser.h:835
void LatexDocVisitor::visitPre ( DocSecRefItem ref)
virtual

Implements DocVisitor.

Definition at line 1332 of file latexdocvisitor.cpp.

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 }
QCString file() const
Definition: docparser.h:966
QCString anchor() const
Definition: docparser.h:967
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void LatexDocVisitor::visitPre ( DocSecRefList )
virtual

Implements DocVisitor.

Definition at line 1354 of file latexdocvisitor.cpp.

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 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPre ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1370 of file latexdocvisitor.cpp.

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 }
Type type() const
Definition: docparser.h:1101
virtual QCString trExceptions()=0
virtual QCString trParameters()=0
virtual QCString trReturnValues()=0
FTextStream & m_t
bool hasInOutSpecifier() const
Definition: docparser.h:1103
void filter(const char *str)
bool hasTypeSpecifier() const
Definition: docparser.h:1104
Translator * theTranslator
Definition: language.cpp:157
#define ASSERT(x)
Definition: qglobal.h:590
void LatexDocVisitor::visitPre ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 1427 of file latexdocvisitor.cpp.

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 }
DocNode * parent() const
Definition: docparser.h:147
void visit(DocWord *)
const bool FALSE
Definition: qglobal.h:370
const QList< DocNode > & paramTypes()
Definition: docparser.h:1170
virtual Kind kind() const =0
type * current() const
Definition: qlist.h:146
DocParamSect::Direction direction() const
Definition: docparser.h:1172
FTextStream & m_t
bool hasInOutSpecifier() const
Definition: docparser.h:1103
const QList< DocNode > & parameters()
Definition: docparser.h:1169
bool hasTypeSpecifier() const
Definition: docparser.h:1104
static QCString type
Definition: declinfo.cpp:672
const bool TRUE
Definition: qglobal.h:371
void LatexDocVisitor::visitPre ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1535 of file latexdocvisitor.cpp.

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 }
bool isEmpty() const
Definition: qcstring.h:189
const bool FALSE
Definition: qglobal.h:370
static QCString stripPath(const QCString &s)
Definition: tagreader.cpp:1287
QCString anchor() const
Definition: docparser.h:670
#define Config_getBool(val)
Definition: config.cpp:664
FTextStream & m_t
void filter(const char *str)
QCString file() const
Definition: docparser.h:669
QCString title() const
Definition: docparser.h:671
const bool TRUE
Definition: qglobal.h:371
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPre ( DocInternalRef ref)
virtual

Implements DocVisitor.

Definition at line 1565 of file latexdocvisitor.cpp.

1566 {
1567  if (m_hide) return;
1568  startLink(0,ref->file(),ref->anchor());
1569 }
void startLink(const QCString &ref, const QCString &file, const QCString &anchor, bool refToTable=FALSE)
QCString anchor() const
Definition: docparser.h:859
QCString file() const
Definition: docparser.h:857
void LatexDocVisitor::visitPre ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1577 of file latexdocvisitor.cpp.

1578 {
1579 }
void LatexDocVisitor::visitPre ( DocText )
virtual

Implements DocVisitor.

Definition at line 1585 of file latexdocvisitor.cpp.

1586 {
1587 }
void LatexDocVisitor::visitPre ( DocHtmlBlockQuote )
virtual

Implements DocVisitor.

Definition at line 1593 of file latexdocvisitor.cpp.

1594 {
1595  if (m_hide) return;
1596  m_t << "\\begin{quote}" << endl;
1597 }
FTextStream & m_t
QTextStream & endl(QTextStream &s)
void LatexDocVisitor::visitPre ( DocVhdlFlow )
virtual

Implements DocVisitor.

Definition at line 1605 of file latexdocvisitor.cpp.

1606 {
1607  if (m_hide) return;
1608 }
void LatexDocVisitor::visitPre ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1615 of file latexdocvisitor.cpp.

1616 {
1617  if (m_hide) return;
1618 }
void LatexDocVisitor::writeDiaFile ( const QCString fileName,
DocVerbatim s 
)
private

Definition at line 1794 of file latexdocvisitor.cpp.

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 }
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString width() const
Definition: docparser.h:459
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
QCString height() const
Definition: docparser.h:460
QCString right(uint len) const
Definition: qcstring.cpp:231
const QList< DocNode > & children() const
Definition: docparser.h:461
static void visitPostEnd(FTextStream &t, const bool hasCaption)
#define Config_getString(val)
Definition: config.cpp:660
FTextStream & m_t
void writeDiaGraphFromFile(const char *inFile, const char *outDir, const char *outFile, DiaOutputFormat format)
Definition: dia.cpp:28
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
bool hasCaption() const
Definition: docparser.h:458
static QCString baseName
Definition: scanner.cpp:10890
Definition: dia.h:24
void LatexDocVisitor::writeMscFile ( const QCString fileName,
DocVerbatim s 
)
private

Definition at line 1748 of file latexdocvisitor.cpp.

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 }
void writeMscGraphFromFile(const char *inFile, const char *outDir, const char *outFile, MscOutputFormat format)
Definition: msc.cpp:92
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString width() const
Definition: docparser.h:459
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
QCString height() const
Definition: docparser.h:460
QCString right(uint len) const
Definition: qcstring.cpp:231
const QList< DocNode > & children() const
Definition: docparser.h:461
static void visitPostEnd(FTextStream &t, const bool hasCaption)
#define Config_getString(val)
Definition: config.cpp:660
FTextStream & m_t
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
bool hasCaption() const
Definition: docparser.h:458
static QCString baseName
Definition: scanner.cpp:10890
Definition: msc.h:24
void LatexDocVisitor::writePlantUMLFile ( const QCString fileName,
DocVerbatim s 
)
private

Definition at line 1809 of file latexdocvisitor.cpp.

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");
1819  visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
1820  visitCaption(this, s->children());
1821  visitPostEnd(m_t, s->hasCaption());
1822 }
uint length() const
Definition: qcstring.h:195
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition: qcstring.cpp:95
QCString width() const
Definition: docparser.h:459
static void visitPreStart(FTextStream &t, const bool hasCaption, QCString name, QCString width, QCString height)
QCString height() const
Definition: docparser.h:460
QCString right(uint len) const
Definition: qcstring.cpp:231
const QList< DocNode > & children() const
Definition: docparser.h:461
static void visitPostEnd(FTextStream &t, const bool hasCaption)
#define Config_getString(val)
Definition: config.cpp:660
void generatePlantUMLOutput(const char *baseName, const char *outDir, PlantUMLOutputFormat format)
Definition: plantuml.cpp:54
FTextStream & m_t
static void visitCaption(LatexDocVisitor *parent, QList< DocNode > children)
bool hasCaption() const
Definition: docparser.h:458
static QCString baseName
Definition: scanner.cpp:10890

Member Data Documentation

CodeOutputInterface& LatexDocVisitor::m_ci
private

Definition at line 189 of file latexdocvisitor.h.

RowSpanList LatexDocVisitor::m_emptyRowSpanList
private

Definition at line 211 of file latexdocvisitor.h.

QStack<bool> LatexDocVisitor::m_enabled
private

Definition at line 195 of file latexdocvisitor.h.

bool LatexDocVisitor::m_hide
private

Definition at line 192 of file latexdocvisitor.h.

bool LatexDocVisitor::m_hideCaption
private

Definition at line 193 of file latexdocvisitor.h.

bool LatexDocVisitor::m_insideItem
private

Definition at line 191 of file latexdocvisitor.h.

bool LatexDocVisitor::m_insidePre
private

Definition at line 190 of file latexdocvisitor.h.

bool LatexDocVisitor::m_insideTabbing
private

Definition at line 194 of file latexdocvisitor.h.

QCString LatexDocVisitor::m_langExt
private

Definition at line 196 of file latexdocvisitor.h.

FTextStream& LatexDocVisitor::m_t
private

Definition at line 188 of file latexdocvisitor.h.

QStack<TableState> LatexDocVisitor::m_tableStateStack
private

Definition at line 210 of file latexdocvisitor.h.


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