|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * Copyright (C) 1997-2008 by Dimitri van Heesch. |
|
6 * |
|
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. |
|
12 * |
|
13 * Documents produced by Doxygen are derivative works derived from the |
|
14 * input used in their production; they are not affected by this license. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef LATEXGEN_H |
|
19 #define LATEXGEN_H |
|
20 |
|
21 #include "outputgen.h" |
|
22 |
|
23 class QFile; |
|
24 |
|
25 class LatexGenerator : public OutputGenerator |
|
26 { |
|
27 public: |
|
28 LatexGenerator(); |
|
29 ~LatexGenerator(); |
|
30 static void init(); |
|
31 static void writeStyleSheetFile(QFile &f); |
|
32 static void writeHeaderFile(QFile &f); |
|
33 |
|
34 //OutputGenerator *copy(); |
|
35 //OutputGenerator *clone() { return new LatexGenerator(*this); } |
|
36 //void append(const OutputGenerator *o); |
|
37 void enable() |
|
38 { if (genStack->top()) active=*genStack->top(); else active=TRUE; } |
|
39 void disable() { active=FALSE; } |
|
40 void enableIf(OutputType o) { if (o==Latex) active=TRUE; } |
|
41 void disableIf(OutputType o) { if (o==Latex) active=FALSE; } |
|
42 void disableIfNot(OutputType o) { if (o!=Latex) active=FALSE; } |
|
43 bool isEnabled(OutputType o) { return (o==Latex && active); } |
|
44 OutputGenerator *get(OutputType o) { return (o==Latex) ? this : 0; } |
|
45 |
|
46 void printDoc(DocNode *,const char *); |
|
47 |
|
48 void startFile(const char *name,const char *manName,const char *title); |
|
49 void writeFooter() {} |
|
50 void endFile(); |
|
51 void clearBuffer(); |
|
52 |
|
53 void startIndexSection(IndexSections); |
|
54 void endIndexSection(IndexSections); |
|
55 void writePageLink(const char *,bool); |
|
56 void startProjectNumber(); |
|
57 void endProjectNumber() {} |
|
58 void writeStyleInfo(int part); |
|
59 void startTitleHead(const char *); |
|
60 void startTitle(); |
|
61 void endTitleHead(const char *,const char *name); |
|
62 void endTitle() { t << "}"; } |
|
63 |
|
64 void newParagraph(); |
|
65 void startParagraph(); |
|
66 void endParagraph(); |
|
67 void writeString(const char *text); |
|
68 void startIndexListItem() {} |
|
69 void endIndexListItem() {} |
|
70 void startIndexList() { t << "\\begin{DoxyCompactList}" << endl; } |
|
71 void endIndexList() { t << "\\end{DoxyCompactList}" << endl; } |
|
72 void startIndexKey(); |
|
73 void endIndexKey(); |
|
74 void startIndexValue(bool); |
|
75 void endIndexValue(const char *,bool); |
|
76 void startItemList() { t << "\\begin{DoxyCompactItemize}" << endl; } |
|
77 void endItemList() { t << "\\end{DoxyCompactItemize}" << endl; } |
|
78 void startIndexItem(const char *ref,const char *file); |
|
79 void endIndexItem(const char *ref,const char *file); |
|
80 void docify(const char *text); |
|
81 void codify(const char *text); |
|
82 void writeObjectLink(const char *ref,const char *file, |
|
83 const char *anchor,const char *name); |
|
84 void writeCodeLink(const char *ref, const char *file, |
|
85 const char *anchor,const char *name, |
|
86 const char *tooltip); |
|
87 void startTextLink(const char *,const char *); |
|
88 void endTextLink(); |
|
89 void startHtmlLink(const char *url); |
|
90 void endHtmlLink(); |
|
91 void startTypewriter() { t << "{\\ttfamily "; } |
|
92 void endTypewriter() { t << "}"; } |
|
93 void startGroupHeader(); |
|
94 void endGroupHeader(); |
|
95 void startItemListItem() { t << "\\item " << endl; } |
|
96 void endItemListItem() {} |
|
97 |
|
98 void startMemberSections() {} |
|
99 void endMemberSections() {} |
|
100 void startMemberHeader(); |
|
101 void endMemberHeader(); |
|
102 void startMemberSubtitle() {} |
|
103 void endMemberSubtitle() {} |
|
104 void startMemberDocList() {} |
|
105 void endMemberDocList() {} |
|
106 void startMemberList(); |
|
107 void endMemberList(); |
|
108 void startAnonTypeScope(int); |
|
109 void endAnonTypeScope(int); |
|
110 void startMemberItem(int); |
|
111 void endMemberItem(); |
|
112 void startMemberTemplateParams(); |
|
113 void endMemberTemplateParams(); |
|
114 |
|
115 void startMemberGroupHeader(bool); |
|
116 void endMemberGroupHeader(); |
|
117 void startMemberGroupDocs(); |
|
118 void endMemberGroupDocs(); |
|
119 void startMemberGroup(); |
|
120 void endMemberGroup(bool); |
|
121 |
|
122 void insertMemberAlign(bool) {} |
|
123 |
|
124 void writeRuler() { t << endl << endl; } |
|
125 void writeAnchor(const char *fileName,const char *name); |
|
126 void startCodeFragment(); |
|
127 void endCodeFragment(); |
|
128 void writeLineNumber(const char *,const char *,const char *,int l); |
|
129 void startCodeLine(); |
|
130 void endCodeLine(); |
|
131 void startEmphasis() { t << "{\\em "; } |
|
132 void endEmphasis() { t << "}"; } |
|
133 void startBold() { t << "{\\bfseries "; } |
|
134 void endBold() { t << "}"; } |
|
135 void startDescription(); |
|
136 void endDescription(); |
|
137 void startDescItem(); |
|
138 void endDescItem(); |
|
139 void lineBreak(const char *style=0) { (void)style; t << "\\par\n"; } |
|
140 void startMemberDoc(const char *,const char *,const char *,const char *); |
|
141 void endMemberDoc(bool); |
|
142 void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *); |
|
143 void endDoxyAnchor(const char *,const char *); |
|
144 void startCodeAnchor(const char *); |
|
145 void endCodeAnchor(); |
|
146 void writeChar(char c); |
|
147 void writeLatexSpacing() { t << "\\hspace{0.3cm}"; } |
|
148 void writeStartAnnoItem(const char *type,const char *file, |
|
149 const char *path,const char *name); |
|
150 void writeEndAnnoItem(const char *name); |
|
151 void startSubsection() { t << "\\subsection*{"; } |
|
152 void endSubsection() { t << "}" << endl; } |
|
153 void startSubsubsection() { t << "\\subsubsection*{"; } |
|
154 void endSubsubsection() { t << "}" << endl; } |
|
155 void startCenter() { t << "\\begin{center}" << endl; } |
|
156 void endCenter() { t << "\\end{center}" << endl; } |
|
157 void startSmall() { t << "\\footnotesize "; } |
|
158 void endSmall() { t << "\\normalsize "; } |
|
159 void startMemberDescription(); |
|
160 void endMemberDescription(); |
|
161 void startDescList(SectionTypes) { t << "\\begin{Desc}\n\\item["; } |
|
162 void endDescList() { t << "\\end{Desc}" << endl; } |
|
163 void startSimpleSect(SectionTypes,const char *,const char *,const char *); |
|
164 void endSimpleSect(); |
|
165 void startParamList(ParamListTypes,const char *title); |
|
166 void endParamList(); |
|
167 void startDescForItem() { t << "\\par" << endl; } |
|
168 void endDescForItem() {} |
|
169 void startSection(const char *,const char *,SectionInfo::SectionType); |
|
170 void endSection(const char *,SectionInfo::SectionType); |
|
171 void addIndexItem(const char *,const char *); |
|
172 void startIndent() {} |
|
173 void endIndent() {} |
|
174 void writeSynopsis() {} |
|
175 void startClassDiagram(); |
|
176 void endClassDiagram(const ClassDiagram &,const char *,const char *); |
|
177 void startPageRef(); |
|
178 void endPageRef(const char *,const char *); |
|
179 void startQuickIndices() {} |
|
180 void endQuickIndices() {} |
|
181 void writeQuickLinks(bool,HighlightedItem) {} |
|
182 void startContents() {} |
|
183 void endContents() {} |
|
184 void writeNonBreakableSpace(int); |
|
185 |
|
186 void startDescTable() |
|
187 { t << "\\begin{description}" << endl; } |
|
188 void endDescTable() |
|
189 { t << "\\end{description}" << endl; } |
|
190 void startDescTableTitle() |
|
191 { t << "\\item[{\\em " << endl; } |
|
192 void endDescTableTitle() |
|
193 { t << "}]"; } |
|
194 void startDescTableData() {} |
|
195 void endDescTableData() {} |
|
196 void lastIndexPage() {} |
|
197 |
|
198 void startDotGraph(); |
|
199 void endDotGraph(const DotClassGraph &); |
|
200 void startInclDepGraph(); |
|
201 void endInclDepGraph(const DotInclDepGraph &); |
|
202 void startCallGraph(); |
|
203 void startGroupCollaboration(); |
|
204 void endGroupCollaboration(const DotGroupCollaboration &g); |
|
205 void endCallGraph(const DotCallGraph &); |
|
206 void startDirDepGraph(); |
|
207 void endDirDepGraph(const DotDirDeps &g); |
|
208 void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {} |
|
209 |
|
210 void startTextBlock(bool) {} |
|
211 void endTextBlock(bool) {} |
|
212 |
|
213 void startMemberDocPrefixItem() {} |
|
214 void endMemberDocPrefixItem() {} |
|
215 void startMemberDocName(bool) {} |
|
216 void endMemberDocName() {} |
|
217 void startParameterType(bool,const char *); |
|
218 void endParameterType() {} |
|
219 void startParameterName(bool) {} |
|
220 void endParameterName(bool,bool,bool) {} |
|
221 void startParameterList(bool) {} |
|
222 void endParameterList() {} |
|
223 |
|
224 void startConstraintList(const char *); |
|
225 void startConstraintParam(); |
|
226 void endConstraintParam(); |
|
227 void startConstraintType(); |
|
228 void endConstraintType(); |
|
229 void startConstraintDocs(); |
|
230 void endConstraintDocs(); |
|
231 void endConstraintList(); |
|
232 |
|
233 void startFontClass(const char *); // {} |
|
234 void endFontClass(); // {} |
|
235 |
|
236 void writeCodeAnchor(const char *) {} |
|
237 void linkableSymbol(int,const char *,Definition *,Definition *) {} |
|
238 |
|
239 private: |
|
240 LatexGenerator(const LatexGenerator &); |
|
241 LatexGenerator &operator=(const LatexGenerator &); |
|
242 void escapeLabelName(const char *s); |
|
243 void escapeMakeIndexChars(const char *s); |
|
244 int col; |
|
245 bool insideTabbing; |
|
246 bool firstDescItem; |
|
247 bool disableLinks; |
|
248 QCString relPath; |
|
249 QCString sourceFileName; |
|
250 int m_indent; |
|
251 bool templateMemberItem; |
|
252 bool m_prettyCode; |
|
253 }; |
|
254 |
|
255 #endif |