summaryrefslogtreecommitdiffstats
path: root/src/latexgen.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/latexgen.h')
-rw-r--r--src/latexgen.h235
1 files changed, 118 insertions, 117 deletions
diff --git a/src/latexgen.h b/src/latexgen.h
index 6be5de7..f457d79 100644
--- a/src/latexgen.h
+++ b/src/latexgen.h
@@ -21,39 +21,38 @@
#include "config.h"
#include "outputgen.h"
-class QFile;
-
#define LATEX_STYLE_EXTENSION ".sty"
+class TextStream;
+
class LatexCodeGenerator : public CodeOutputInterface
{
public:
- LatexCodeGenerator(FTextStream &t,const QCString &relPath,const QCString &sourceFile);
- LatexCodeGenerator();
- void setTextStream(FTextStream &t);
+ LatexCodeGenerator(TextStream &t,const QCString &relPath,const QCString &sourceFile);
+ LatexCodeGenerator(TextStream &t);
void setRelativePath(const QCString &path);
void setSourceFileName(const QCString &sourceFileName);
- void codify(const char *text);
- void writeCodeLink(const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void writeTooltip(const char *,
+ void codify(const QCString &text) override;
+ void writeCodeLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip) override;
+ void writeTooltip(const QCString &,
const DocLinkInfo &,
- const char *,
- const char *,
+ const QCString &,
+ const QCString &,
const SourceLinkInfo &,
const SourceLinkInfo &
- ) {}
- void writeLineNumber(const char *,const char *,const char *,int);
- void startCodeLine(bool);
- void endCodeLine();
- void startFontClass(const char *);
- void endFontClass();
- void writeCodeAnchor(const char *) {}
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
- void startCodeFragment(const char *style);
- void endCodeFragment(const char *style);
+ ) override{}
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int) override;
+ void startCodeLine(bool) override;
+ void endCodeLine() override;
+ void startFontClass(const QCString &) override;
+ void endFontClass() override;
+ void writeCodeAnchor(const QCString &) override {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) override {}
+ void addWord(const QCString &,bool) override {}
+ void startCodeFragment(const QCString &style) override;
+ void endCodeFragment(const QCString &style) override;
// extra methods not part of CodeOutputInterface
void incUsedTableLevel() { m_usedTableLevel++; }
@@ -61,13 +60,13 @@ class LatexCodeGenerator : public CodeOutputInterface
int usedTableLevel() const { return m_usedTableLevel; }
private:
- void _writeCodeLink(const char *className,
- const char *ref,const char *file,
- const char *anchor,const char *name,
- const char *tooltip);
- void docify(const char *str);
+ void _writeCodeLink(const QCString &className,
+ const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip);
+ void docify(const QCString &str);
bool m_streamSet = false;
- FTextStream m_t;
+ TextStream &m_t;
QCString m_relPath;
QCString m_sourceFileName;
int m_col = 0;
@@ -87,97 +86,97 @@ class LatexGenerator : public OutputGenerator
virtual std::unique_ptr<OutputGenerator> clone() const;
static void init();
- static void writeStyleSheetFile(QFile &f);
- static void writeHeaderFile(QFile &f);
- static void writeFooterFile(QFile &f);
+ static void writeStyleSheetFile(TextStream &t);
+ static void writeHeaderFile(TextStream &t);
+ static void writeFooterFile(TextStream &t);
virtual OutputType type() const { return Latex; }
// --- CodeOutputInterface
- void codify(const char *text)
+ void codify(const QCString &text)
{ m_codeGen.codify(text); }
- void writeCodeLink(const char *ref, const char *file,
- const char *anchor,const char *name,
- const char *tooltip)
+ void writeCodeLink(const QCString &ref, const QCString &file,
+ const QCString &anchor,const QCString &name,
+ const QCString &tooltip)
{ m_codeGen.writeCodeLink(ref,file,anchor,name,tooltip); }
- void writeLineNumber(const char *ref,const char *file,const char *anchor,int lineNumber)
+ void writeLineNumber(const QCString &ref,const QCString &file,const QCString &anchor,int lineNumber)
{ m_codeGen.writeLineNumber(ref,file,anchor,lineNumber); }
- void writeTooltip(const char *id, const DocLinkInfo &docInfo, const char *decl,
- const char *desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
+ void writeTooltip(const QCString &id, const DocLinkInfo &docInfo, const QCString &decl,
+ const QCString &desc, const SourceLinkInfo &defInfo, const SourceLinkInfo &declInfo
)
{ m_codeGen.writeTooltip(id,docInfo,decl,desc,defInfo,declInfo); }
void startCodeLine(bool hasLineNumbers)
{ m_codeGen.startCodeLine(hasLineNumbers); }
void endCodeLine()
{ m_codeGen.endCodeLine(); }
- void startFontClass(const char *s)
+ void startFontClass(const QCString &s)
{ m_codeGen.startFontClass(s); }
void endFontClass()
{ m_codeGen.endFontClass(); }
- void writeCodeAnchor(const char *anchor)
+ void writeCodeAnchor(const QCString &anchor)
{ m_codeGen.writeCodeAnchor(anchor); }
- void startCodeFragment(const char *style)
+ void startCodeFragment(const QCString &style)
{ m_codeGen.startCodeFragment(style); }
- void endCodeFragment(const char *style)
+ void endCodeFragment(const QCString &style)
{ m_codeGen.endCodeFragment(style); }
// ---------------------------
void writeDoc(DocNode *,const Definition *ctx,const MemberDef *,int id);
- void startFile(const char *name,const char *manName,const char *title,int id);
+ void startFile(const QCString &name,const QCString &manName,const QCString &title,int id);
void writeSearchInfo() {}
- void writeFooter(const char *) {}
+ void writeFooter(const QCString &) {}
void endFile();
void clearBuffer();
void startIndexSection(IndexSections);
void endIndexSection(IndexSections);
- void writePageLink(const char *,bool);
+ void writePageLink(const QCString &,bool);
void startProjectNumber();
void endProjectNumber() {}
void writeStyleInfo(int part);
- void startTitleHead(const char *);
+ void startTitleHead(const QCString &);
void startTitle();
- void endTitleHead(const char *,const char *name);
- void endTitle() { t << "}"; }
+ void endTitleHead(const QCString &,const QCString &name);
+ void endTitle() { m_t << "}"; }
void newParagraph();
- void startParagraph(const char *classDef);
+ void startParagraph(const QCString &classDef);
void endParagraph();
- void writeString(const char *text);
+ void writeString(const QCString &text);
void startIndexListItem() {}
void endIndexListItem() {}
- void startIndexList() { t << "\\begin{DoxyCompactList}" << endl; }
- void endIndexList() { t << "\\end{DoxyCompactList}" << endl; }
+ void startIndexList() { m_t << "\\begin{DoxyCompactList}\n"; }
+ void endIndexList() { m_t << "\\end{DoxyCompactList}\n"; }
void startIndexKey();
void endIndexKey();
void startIndexValue(bool);
- void endIndexValue(const char *,bool);
- void startItemList() { t << "\\begin{DoxyCompactItemize}" << endl; }
- void endItemList() { t << "\\end{DoxyCompactItemize}" << endl; }
- void startIndexItem(const char *ref,const char *file);
- void endIndexItem(const char *ref,const char *file);
- void docify(const char *text);
- void writeObjectLink(const char *ref,const char *file,
- const char *anchor,const char *name);
-
- void startTextLink(const char *,const char *);
+ void endIndexValue(const QCString &,bool);
+ void startItemList() { m_t << "\\begin{DoxyCompactItemize}\n"; }
+ void endItemList() { m_t << "\\end{DoxyCompactItemize}\n"; }
+ void startIndexItem(const QCString &ref,const QCString &file);
+ void endIndexItem(const QCString &ref,const QCString &file);
+ void docify(const QCString &text);
+ void writeObjectLink(const QCString &ref,const QCString &file,
+ const QCString &anchor,const QCString &name);
+
+ void startTextLink(const QCString &,const QCString &);
void endTextLink();
- void startHtmlLink(const char *url);
+ void startHtmlLink(const QCString &url);
void endHtmlLink();
- void startTypewriter() { t << "{\\ttfamily "; }
- void endTypewriter() { t << "}"; }
+ void startTypewriter() { m_t << "{\\ttfamily "; }
+ void endTypewriter() { m_t << "}"; }
void startGroupHeader(int);
void endGroupHeader(int);
- void startItemListItem() { t << "\\item " << endl; }
+ void startItemListItem() { m_t << "\\item \n"; }
void endItemListItem() {}
void startMemberSections() {}
void endMemberSections() {}
void startHeaderSection() {}
void endHeaderSection() {}
- void startMemberHeader(const char *,int);
+ void startMemberHeader(const QCString &,int);
void endMemberHeader();
void startMemberSubtitle() {}
void endMemberSubtitle() {}
@@ -189,10 +188,12 @@ class LatexGenerator : public OutputGenerator
void endInlineHeader();
void startAnonTypeScope(int);
void endAnonTypeScope(int);
- void startMemberItem(const char *,int,const char *);
+ void startMemberItem(const QCString &,int,const QCString &);
void endMemberItem();
void startMemberTemplateParams();
- void endMemberTemplateParams(const char *,const char *);
+ void endMemberTemplateParams(const QCString &,const QCString &);
+ void startCompoundTemplateParams() { startSubsubsection(); }
+ void endCompoundTemplateParams() { endSubsubsection(); }
void startMemberGroupHeader(bool);
void endMemberGroupHeader();
@@ -204,70 +205,70 @@ class LatexGenerator : public OutputGenerator
void insertMemberAlign(bool) {}
void insertMemberAlignLeft(int,bool){}
- void writeRuler() { t << endl << endl; }
- void writeAnchor(const char *fileName,const char *name);
- void startEmphasis() { t << "{\\em "; }
- void endEmphasis() { t << "}"; }
- void startBold() { t << "{\\bfseries "; }
- void endBold() { t << "}"; }
+ void writeRuler() { m_t << "\n\n"; }
+ void writeAnchor(const QCString &fileName,const QCString &name);
+ void startEmphasis() { m_t << "{\\em "; }
+ void endEmphasis() { m_t << "}"; }
+ void startBold() { m_t << "{\\bfseries "; }
+ void endBold() { m_t << "}"; }
void startDescription();
void endDescription();
void startDescItem();
void endDescItem();
- void lineBreak(const char *style=0);
- void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
+ void lineBreak(const QCString &style=QCString());
+ void startMemberDoc(const QCString &,const QCString &,const QCString &,const QCString &,int,int,bool);
void endMemberDoc(bool);
- void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
- void endDoxyAnchor(const char *,const char *);
+ void startDoxyAnchor(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &);
+ void endDoxyAnchor(const QCString &,const QCString &);
void writeChar(char c);
- void writeLatexSpacing() { t << "\\hspace{0.3cm}"; }
- void writeStartAnnoItem(const char *type,const char *file,
- const char *path,const char *name);
- void writeEndAnnoItem(const char *name);
- void startSubsection() { t << "\\subsection*{"; }
- void endSubsection() { t << "}" << endl; }
- void startSubsubsection() { t << "\\subsubsection*{"; }
- void endSubsubsection() { t << "}" << endl; }
- void startCenter() { t << "\\begin{center}" << endl; }
- void endCenter() { t << "\\end{center}" << endl; }
- void startSmall() { t << "\\footnotesize "; }
- void endSmall() { t << "\\normalsize "; }
- void startMemberDescription(const char *,const char *,bool);
+ void writeLatexSpacing() { m_t << "\\hspace{0.3cm}"; }
+ void writeStartAnnoItem(const QCString &type,const QCString &file,
+ const QCString &path,const QCString &name);
+ void writeEndAnnoItem(const QCString &name);
+ void startSubsection() { m_t << "\\subsection*{"; }
+ void endSubsection() { m_t << "}\n"; }
+ void startSubsubsection() { m_t << "\\subsubsection*{"; }
+ void endSubsubsection() { m_t << "}\n"; }
+ void startCenter() { m_t << "\\begin{center}\n"; }
+ void endCenter() { m_t << "\\end{center}\n"; }
+ void startSmall() { m_t << "\\footnotesize "; }
+ void endSmall() { m_t << "\\normalsize "; }
+ void startMemberDescription(const QCString &,const QCString &,bool);
void endMemberDescription();
void startMemberDeclaration() {}
- void endMemberDeclaration(const char *,const char *) {}
- void writeInheritedSectionTitle(const char *,const char *,const char *,
- const char *,const char *,const char *) {}
- void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; }
- void endDescList() { t << "\\end{Desc}" << endl; }
+ void endMemberDeclaration(const QCString &,const QCString &) {}
+ void writeInheritedSectionTitle(const QCString &,const QCString &,const QCString &,
+ const QCString &,const QCString &,const QCString &) {}
+ void startDescList(SectionTypes) { m_t << "\\begin{Desc}\n\\item["; }
+ void endDescList() { m_t << "\\end{Desc}\n"; }
void startExamples();
void endExamples();
- void startParamList(ParamListTypes,const char *title);
+ void startParamList(ParamListTypes,const QCString &title);
void endParamList();
- void startDescForItem() { t << "\\par" << endl; }
+ void startDescForItem() { m_t << "\\par\n"; }
void endDescForItem() {}
- void startSection(const char *,const char *,SectionType);
- void endSection(const char *,SectionType);
- void addIndexItem(const char *,const char *);
+ void startSection(const QCString &,const QCString &,SectionType);
+ void endSection(const QCString &,SectionType);
+ void addIndexItem(const QCString &,const QCString &);
void startIndent() {}
void endIndent() {}
void writeSynopsis() {}
void startClassDiagram();
- void endClassDiagram(const ClassDiagram &,const char *,const char *);
+ void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &);
void startPageRef();
- void endPageRef(const char *,const char *);
+ void endPageRef(const QCString &,const QCString &);
void startQuickIndices() {}
void endQuickIndices() {}
- void writeSplitBar(const char *) {}
- void writeNavigationPath(const char *) {}
+ void writeSplitBar(const QCString &) {}
+ void writeNavigationPath(const QCString &) {}
void writeLogo() {}
- void writeQuickLinks(bool,HighlightedItem,const char*) {}
- void writeSummaryLink(const char *,const char *,const char *,bool) {}
+ void writeQuickLinks(bool,HighlightedItem,const QCString &) {}
+ void writeSummaryLink(const QCString &,const QCString &,const QCString &,bool) {}
void startContents() {}
void endContents() {}
void writeNonBreakableSpace(int);
- void startDescTable(const char *title);
+ void startDescTable(const QCString &title);
void endDescTable();
void startDescTableRow();
void endDescTableRow();
@@ -293,18 +294,18 @@ class LatexGenerator : public OutputGenerator
void endTextBlock(bool) {}
void startMemberDocPrefixItem() {}
- void endMemberDocPrefixItem() { t << "\\\\" << endl; }
+ void endMemberDocPrefixItem() { m_t << "\\\\\n"; }
void startMemberDocName(bool) {}
void endMemberDocName() {}
- void startParameterType(bool,const char *);
+ void startParameterType(bool,const QCString &);
void endParameterType();
void startParameterName(bool);
void endParameterName(bool,bool,bool);
void startParameterList(bool);
void endParameterList();
- void exceptionEntry(const char*,bool);
+ void exceptionEntry(const QCString &,bool);
- void startConstraintList(const char *);
+ void startConstraintList(const QCString &);
void startConstraintParam();
void endConstraintParam();
void startConstraintType();
@@ -323,11 +324,11 @@ class LatexGenerator : public OutputGenerator
void endInlineMemberDoc();
void startLabels();
- void writeLabel(const char *l,bool isLast);
+ void writeLabel(const QCString &l,bool isLast);
void endLabels();
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
+ void setCurrentDoc(const Definition *,const QCString &,bool) {}
+ void addWord(const QCString &,bool) {}
private: