1 /******************************************************************************
3 * $Id: latexgen.h,v 1.50 2001/03/19 19:27:41 root Exp $
5 * Copyright (C) 1997-2012 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
21 #include "outputgen.h"
25 /** Generator for LaTeX output. */
26 class LatexGenerator : public OutputGenerator
32 static void writeStyleSheetFile(QFile &f);
33 static void writeHeaderFile(QFile &f);
34 static void writeFooterFile(QFile &f);
36 //OutputGenerator *copy();
37 //OutputGenerator *clone() { return new LatexGenerator(*this); }
38 //void append(const OutputGenerator *o);
40 { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
41 void disable() { active=FALSE; }
42 void enableIf(OutputType o) { if (o==Latex) enable(); }
43 void disableIf(OutputType o) { if (o==Latex) disable(); }
44 void disableIfNot(OutputType o) { if (o!=Latex) disable(); }
45 bool isEnabled(OutputType o) { return (o==Latex && active); }
46 OutputGenerator *get(OutputType o) { return (o==Latex) ? this : 0; }
48 void writeDoc(DocNode *,Definition *ctx,MemberDef *);
50 void startFile(const char *name,const char *manName,const char *title);
51 void writeSearchInfo() {}
52 void writeFooter(const char *) {}
56 void startIndexSection(IndexSections);
57 void endIndexSection(IndexSections);
58 void writePageLink(const char *,bool);
59 void startProjectNumber();
60 void endProjectNumber() {}
61 void writeStyleInfo(int part);
62 void startTitleHead(const char *);
64 void endTitleHead(const char *,const char *name);
65 void endTitle() { t << "}"; }
68 void startParagraph();
70 void writeString(const char *text);
71 void startIndexListItem() {}
72 void endIndexListItem() {}
73 void startIndexList() { t << "\\begin{DoxyCompactList}" << endl; }
74 void endIndexList() { t << "\\end{DoxyCompactList}" << endl; }
77 void startIndexValue(bool);
78 void endIndexValue(const char *,bool);
79 void startItemList() { t << "\\begin{DoxyCompactItemize}" << endl; }
80 void endItemList() { t << "\\end{DoxyCompactItemize}" << endl; }
81 void startIndexItem(const char *ref,const char *file);
82 void endIndexItem(const char *ref,const char *file);
83 void docify(const char *text);
84 void codify(const char *text);
85 void writeObjectLink(const char *ref,const char *file,
86 const char *anchor,const char *name);
87 void writeCodeLink(const char *ref, const char *file,
88 const char *anchor,const char *name,
90 void startTextLink(const char *,const char *);
92 void startHtmlLink(const char *url);
94 void startTypewriter() { t << "{\\ttfamily "; }
95 void endTypewriter() { t << "}"; }
96 void startGroupHeader(int);
97 void endGroupHeader(int);
98 void startItemListItem() { t << "\\item " << endl; }
99 void endItemListItem() {}
101 void startMemberSections() {}
102 void endMemberSections() {}
103 void startHeaderSection() {}
104 void endHeaderSection() {}
105 void startMemberHeader(const char *);
106 void endMemberHeader();
107 void startMemberSubtitle() {}
108 void endMemberSubtitle() {}
109 void startMemberDocList() {}
110 void endMemberDocList() {}
111 void startMemberList();
112 void endMemberList();
113 void startInlineHeader();
114 void endInlineHeader();
115 void startAnonTypeScope(int);
116 void endAnonTypeScope(int);
117 void startMemberItem(const char *,int,const char *);
118 void endMemberItem();
119 void startMemberTemplateParams();
120 void endMemberTemplateParams(const char *,const char *);
122 void startMemberGroupHeader(bool);
123 void endMemberGroupHeader();
124 void startMemberGroupDocs();
125 void endMemberGroupDocs();
126 void startMemberGroup();
127 void endMemberGroup(bool);
129 void insertMemberAlign(bool) {}
131 void writeRuler() { t << endl << endl; }
132 void writeAnchor(const char *fileName,const char *name);
133 void startCodeFragment();
134 void endCodeFragment();
135 void writeLineNumber(const char *,const char *,const char *,int l);
136 void startCodeLine(bool hasLineNumbers);
138 void startEmphasis() { t << "{\\em "; }
139 void endEmphasis() { t << "}"; }
140 void startBold() { t << "{\\bfseries "; }
141 void endBold() { t << "}"; }
142 void startDescription();
143 void endDescription();
144 void startDescItem();
146 void lineBreak(const char *style=0);
147 void startMemberDoc(const char *,const char *,const char *,const char *,bool);
148 void endMemberDoc(bool);
149 void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
150 void endDoxyAnchor(const char *,const char *);
151 void startCodeAnchor(const char *);
152 void endCodeAnchor();
153 void writeChar(char c);
154 void writeLatexSpacing() { t << "\\hspace{0.3cm}"; }
155 void writeStartAnnoItem(const char *type,const char *file,
156 const char *path,const char *name);
157 void writeEndAnnoItem(const char *name);
158 void startSubsection() { t << "\\subsection*{"; }
159 void endSubsection() { t << "}" << endl; }
160 void startSubsubsection() { t << "\\subsubsection*{"; }
161 void endSubsubsection() { t << "}" << endl; }
162 void startCenter() { t << "\\begin{center}" << endl; }
163 void endCenter() { t << "\\end{center}" << endl; }
164 void startSmall() { t << "\\footnotesize "; }
165 void endSmall() { t << "\\normalsize "; }
166 void startMemberDescription(const char *,const char *);
167 void endMemberDescription();
168 void startMemberDeclaration() {}
169 void endMemberDeclaration(const char *,const char *) {}
170 void writeInheritedSectionTitle(const char *,const char *,const char *,
171 const char *,const char *,const char *) {}
172 void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; }
173 void endDescList() { t << "\\end{Desc}" << endl; }
174 void startSimpleSect(SectionTypes,const char *,const char *,const char *);
175 void endSimpleSect();
176 void startParamList(ParamListTypes,const char *title);
178 void startDescForItem() { t << "\\par" << endl; }
179 void endDescForItem() {}
180 void startSection(const char *,const char *,SectionInfo::SectionType);
181 void endSection(const char *,SectionInfo::SectionType);
182 void addIndexItem(const char *,const char *);
183 void startIndent() {}
185 void writeSynopsis() {}
186 void startClassDiagram();
187 void endClassDiagram(const ClassDiagram &,const char *,const char *);
189 void endPageRef(const char *,const char *);
190 void startQuickIndices() {}
191 void endQuickIndices() {}
192 void writeSplitBar(const char *) {}
193 void writeNavigationPath(const char *) {}
195 void writeQuickLinks(bool,HighlightedItem,const char*) {}
196 void writeSummaryLink(const char *,const char *,const char *,bool) {}
197 void startContents() {}
198 void endContents() {}
199 void writeNonBreakableSpace(int);
201 void startDescTable()
202 { t << "\\begin{description}" << endl; }
204 { t << "\\end{description}" << endl; }
205 void startDescTableTitle()
206 { t << "\\item[{\\em " << endl; }
207 void endDescTableTitle()
209 void startDescTableData() {}
210 void endDescTableData() {}
211 void lastIndexPage() {}
213 void startDotGraph();
214 void endDotGraph(const DotClassGraph &);
215 void startInclDepGraph();
216 void endInclDepGraph(const DotInclDepGraph &);
217 void startCallGraph();
218 void startGroupCollaboration();
219 void endGroupCollaboration(const DotGroupCollaboration &g);
220 void endCallGraph(const DotCallGraph &);
221 void startDirDepGraph();
222 void endDirDepGraph(const DotDirDeps &g);
223 void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {}
225 void startTextBlock(bool) {}
226 void endTextBlock(bool) {}
228 void startMemberDocPrefixItem() {}
229 void endMemberDocPrefixItem() {}
230 void startMemberDocName(bool) {}
231 void endMemberDocName() {}
232 void startParameterType(bool,const char *);
233 void endParameterType();
234 void startParameterName(bool);
235 void endParameterName(bool,bool,bool);
236 void startParameterList(bool);
237 void endParameterList();
239 void startConstraintList(const char *);
240 void startConstraintParam();
241 void endConstraintParam();
242 void startConstraintType();
243 void endConstraintType();
244 void startConstraintDocs();
245 void endConstraintDocs();
246 void endConstraintList();
248 void startMemberDocSimple();
249 void endMemberDocSimple();
250 void startInlineMemberType();
251 void endInlineMemberType();
252 void startInlineMemberName();
253 void endInlineMemberName();
254 void startInlineMemberDoc();
255 void endInlineMemberDoc();
258 void writeLabel(const char *l,bool isLast);
261 void startFontClass(const char *); // {}
262 void endFontClass(); // {}
264 void writeCodeAnchor(const char *) {}
265 void linkableSymbol(int,const char *,Definition *,Definition *) {}
268 LatexGenerator(const LatexGenerator &);
269 LatexGenerator &operator=(const LatexGenerator &);
270 void escapeLabelName(const char *s);
271 void escapeMakeIndexChars(const char *s);
277 QCString sourceFileName;
279 bool templateMemberItem;