Root/
Source at commit 1322 created 12 years 8 months ago. By meklort, Add doxygen to utils folder | |
---|---|
1 | /******************************************************************************␊ |
2 | *␊ |
3 | * $Id: htmlgen.h,v 1.51 2001/03/19 19:27:40 root Exp $␊ |
4 | *␊ |
5 | * Copyright (C) 1997-2011 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 HTMLGEN_H␊ |
19 | #define HTMLGEN_H␊ |
20 | ␊ |
21 | #include "qtbc.h"␊ |
22 | #include "outputgen.h"␊ |
23 | ␊ |
24 | #define PREFRAG_START "<div class=\"fragment\"><pre class=\"fragment\">"␊ |
25 | #define PREFRAG_END "</pre></div>"␊ |
26 | ␊ |
27 | class QFile;␊ |
28 | class FTextStream;␊ |
29 | ␊ |
30 | class HtmlGenerator : public OutputGenerator␊ |
31 | {␊ |
32 | public:␊ |
33 | HtmlGenerator();␊ |
34 | virtual ~HtmlGenerator();␊ |
35 | static void init();␊ |
36 | static void writeStyleSheetFile(QFile &f);␊ |
37 | static void writeHeaderFile(QFile &f, const char *cssname);␊ |
38 | static void writeFooterFile(QFile &f);␊ |
39 | static void writeTabData();␊ |
40 | static void writeSearchFooter(FTextStream &t,const QCString &relPath);␊ |
41 | static void writeSearchData(const char *dir);␊ |
42 | static void writeSearchPage();␊ |
43 | static QCString writeLogoAsString(const char *path);␊ |
44 | static QCString writeSplitBarAsString(const char *name,const char *relpath);␊ |
45 | ␊ |
46 | void enable() ␊ |
47 | { if (genStack->top()) active=*genStack->top(); else active=TRUE; }␊ |
48 | void disable() { active=FALSE; }␊ |
49 | void enableIf(OutputType o) { if (o==Html) active=TRUE; }␊ |
50 | void disableIf(OutputType o) { if (o==Html) active=FALSE; }␊ |
51 | void disableIfNot(OutputType o) { if (o!=Html) active=FALSE; }␊ |
52 | bool isEnabled(OutputType o) { return (o==Html && active); } ␊ |
53 | OutputGenerator *get(OutputType o) { return (o==Html) ? this : 0; }␊ |
54 | ␊ |
55 | void printDoc(DocNode *,const char *);␊ |
56 | ␊ |
57 | void startFile(const char *name,const char *manName,const char *title);␊ |
58 | void writeFooter();␊ |
59 | void endFile();␊ |
60 | void clearBuffer();␊ |
61 | ␊ |
62 | void startIndexSection(IndexSections) {}␊ |
63 | void endIndexSection(IndexSections) {}␊ |
64 | void writePageLink(const char *,bool) {}␊ |
65 | void startProjectNumber();␊ |
66 | void endProjectNumber();␊ |
67 | void writeStyleInfo(int part);␊ |
68 | void startTitleHead(const char *);␊ |
69 | void endTitleHead(const char *,const char *);␊ |
70 | void startTitle() { t << "<div class=\"title\">"; }␊ |
71 | void endTitle() { t << "</div>"; }␊ |
72 | ␊ |
73 | void startParagraph();␊ |
74 | void endParagraph();␊ |
75 | void writeString(const char *text);␊ |
76 | void startIndexListItem();␊ |
77 | void endIndexListItem();␊ |
78 | void startIndexList();␊ |
79 | void endIndexList();␊ |
80 | void startIndexKey();␊ |
81 | void endIndexKey();␊ |
82 | void startIndexValue(bool);␊ |
83 | void endIndexValue(const char *,bool);␊ |
84 | void startItemList() { t << "<ul>" << endl; }␊ |
85 | void endItemList() { t << "</ul>" << endl; }␊ |
86 | void startIndexItem(const char *ref,const char *file);␊ |
87 | void endIndexItem(const char *ref,const char *file);␊ |
88 | void docify(const char *text);␊ |
89 | void codify(const char *text);␊ |
90 | void writeObjectLink(const char *ref,const char *file,␊ |
91 | const char *anchor,const char *name);␊ |
92 | void writeCodeLink(const char *ref,const char *file,␊ |
93 | const char *anchor,const char *name,␊ |
94 | const char *tooltip);␊ |
95 | void startTextLink(const char *file,const char *anchor);␊ |
96 | void endTextLink();␊ |
97 | void startHtmlLink(const char *url);␊ |
98 | void endHtmlLink();␊ |
99 | void startTypewriter() { t << "<code>"; }␊ |
100 | void endTypewriter() { t << "</code>"; }␊ |
101 | void startGroupHeader(int);␊ |
102 | void endGroupHeader(int);␊ |
103 | void startItemListItem() { t << "<li>"; }␊ |
104 | void endItemListItem() { t << "</li>\n"; }␊ |
105 | ␊ |
106 | void startMemberSections();␊ |
107 | void endMemberSections();␊ |
108 | void startHeaderSection();␊ |
109 | void endHeaderSection();␊ |
110 | void startMemberHeader(const char *);␊ |
111 | void endMemberHeader();␊ |
112 | void startMemberSubtitle();␊ |
113 | void endMemberSubtitle();␊ |
114 | void startMemberDocList();␊ |
115 | void endMemberDocList();␊ |
116 | void startMemberList();␊ |
117 | void endMemberList();␊ |
118 | void startInlineDescription();␊ |
119 | void endInlineDescription();␊ |
120 | void startInlineHeader();␊ |
121 | void endInlineHeader();␊ |
122 | void startAnonTypeScope(int) {}␊ |
123 | void endAnonTypeScope(int) {}␊ |
124 | void startMemberItem(int);␊ |
125 | void endMemberItem();␊ |
126 | void startMemberTemplateParams();␊ |
127 | void endMemberTemplateParams();␊ |
128 | ␊ |
129 | void startMemberGroupHeader(bool);␊ |
130 | void endMemberGroupHeader();␊ |
131 | void startMemberGroupDocs();␊ |
132 | void endMemberGroupDocs();␊ |
133 | void startMemberGroup();␊ |
134 | void endMemberGroup(bool);␊ |
135 | ␊ |
136 | void insertMemberAlign(bool);␊ |
137 | void startMemberDescription();␊ |
138 | void endMemberDescription();␊ |
139 | ␊ |
140 | void writeRuler() { t << "<hr/>"; }␊ |
141 | void writeAnchor(const char *,const char *name) ␊ |
142 | { t << "<a name=\"" << name <<"\" id=\"" << name << "\"></a>"; }␊ |
143 | void startCodeFragment() { t << PREFRAG_START; }␊ |
144 | void endCodeFragment() { t << PREFRAG_END; } ␊ |
145 | void writeLineNumber(const char *,const char *,const char *,int);␊ |
146 | void startCodeLine() { col=0; }␊ |
147 | void endCodeLine() { codify("\n"); }␊ |
148 | void startEmphasis() { t << "<em>"; }␊ |
149 | void endEmphasis() { t << "</em>"; }␊ |
150 | void startBold() { t << "<b>"; }␊ |
151 | void endBold() { t << "</b>"; }␊ |
152 | void startDescription() { t << endl << "<dl>" << endl; }␊ |
153 | void endDescription() { t << endl << "</dl>\n" << endl; }␊ |
154 | void startDescItem() { t << "<dt>"; }␊ |
155 | void endDescItem() { t << "</dt>"; }␊ |
156 | void startDescForItem() { t << "<dd>"; }␊ |
157 | void endDescForItem() { t << "</dd>\n"; }␊ |
158 | void lineBreak(const char *style);␊ |
159 | void writeChar(char c);␊ |
160 | void startMemberDoc(const char *,const char *,const char *,const char *,bool);␊ |
161 | void endMemberDoc(bool); ␊ |
162 | void startDoxyAnchor(const char *fName,const char *manName,␊ |
163 | const char *anchor,const char *name,␊ |
164 | const char *args);␊ |
165 | void endDoxyAnchor(const char *fName,const char *anchor);␊ |
166 | void startCodeAnchor(const char *label) { t << "<a name=\"" << label << "\"></a>"; }␊ |
167 | void endCodeAnchor() { }␊ |
168 | void writeLatexSpacing() {}␊ |
169 | void writeStartAnnoItem(const char *type,const char *file,␊ |
170 | const char *path,const char *name);␊ |
171 | void writeEndAnnoItem(const char *) { t << endl; }␊ |
172 | void startSubsection() { t << "<h2>"; }␊ |
173 | void endSubsection() { t << "</h2>" << endl; }␊ |
174 | void startSubsubsection() { t << "<h3>"; }␊ |
175 | void endSubsubsection() { t << "</h3>" << endl; }␊ |
176 | void startCenter() { t << "<center>" << endl; }␊ |
177 | void endCenter() { t << "</center>" << endl; }␊ |
178 | void startSmall() { t << "<small>" << endl; }␊ |
179 | void endSmall() { t << "</small>" << endl; }␊ |
180 | //void startDescList(SectionTypes) { t << "<dl compact><dt><b>" << endl; }␊ |
181 | //void endDescList() { t << "</dl>"; }␊ |
182 | void startSimpleSect(SectionTypes,const char *,const char *,const char *);␊ |
183 | void endSimpleSect();␊ |
184 | void startParamList(ParamListTypes,const char *);␊ |
185 | void endParamList();␊ |
186 | //void writeDescItem() { t << "<dd>" << endl; }␊ |
187 | void startSection(const char *,const char *,SectionInfo::SectionType);␊ |
188 | void endSection(const char *,SectionInfo::SectionType);␊ |
189 | void addIndexItem(const char *,const char *);␊ |
190 | void startIndent();␊ |
191 | void endIndent();␊ |
192 | void writeSynopsis() {}␊ |
193 | void startClassDiagram();␊ |
194 | void endClassDiagram(const ClassDiagram &,const char *,const char *);␊ |
195 | void startPageRef() {}␊ |
196 | void endPageRef(const char *,const char *) {}␊ |
197 | void startQuickIndices();␊ |
198 | void endQuickIndices();␊ |
199 | void writeSplitBar(const char *name);␊ |
200 | void writeLogo();␊ |
201 | void writeQuickLinks(bool compact,HighlightedItem hli);␊ |
202 | void startContents();␊ |
203 | void endContents();␊ |
204 | void writeNonBreakableSpace(int);␊ |
205 | ␊ |
206 | void startDescTable()␊ |
207 | { t << "<table border=\"0\" cellspacing=\"2\" cellpadding=\"0\">" << endl; }␊ |
208 | void endDescTable()␊ |
209 | { t << "</table>" << endl; }␊ |
210 | void startDescTableTitle()␊ |
211 | { t << "<tr><td valign=\"top\"><em>"; }␊ |
212 | void endDescTableTitle()␊ |
213 | { t << "</em> </td>"; }␊ |
214 | void startDescTableData()␊ |
215 | { t << "<td>" << endl; }␊ |
216 | void endDescTableData()␊ |
217 | { t << "</td></tr>" << endl; }␊ |
218 | ␊ |
219 | void startDotGraph();␊ |
220 | void endDotGraph(const DotClassGraph &g);␊ |
221 | void startInclDepGraph();␊ |
222 | void endInclDepGraph(const DotInclDepGraph &g);␊ |
223 | void startGroupCollaboration();␊ |
224 | void endGroupCollaboration(const DotGroupCollaboration &g);␊ |
225 | void startCallGraph();␊ |
226 | void endCallGraph(const DotCallGraph &g);␊ |
227 | void startDirDepGraph();␊ |
228 | void endDirDepGraph(const DotDirDeps &g);␊ |
229 | void writeGraphicalHierarchy(const DotGfxHierarchyTable &g);␊ |
230 | ␊ |
231 | void startTextBlock(bool) ␊ |
232 | { t << "<div class=\"textblock\">"; }␊ |
233 | void endTextBlock(bool) ␊ |
234 | { t << "</div>"; }␊ |
235 | void lastIndexPage() {}␊ |
236 | ␊ |
237 | void startMemberDocPrefixItem();␊ |
238 | void endMemberDocPrefixItem();␊ |
239 | void startMemberDocName(bool);␊ |
240 | void endMemberDocName();␊ |
241 | void startParameterType(bool first,const char *key);␊ |
242 | void endParameterType();␊ |
243 | void startParameterName(bool);␊ |
244 | void endParameterName(bool last,bool emptyList,bool closeBracket);␊ |
245 | void startParameterList(bool);␊ |
246 | void endParameterList();␊ |
247 | ␊ |
248 | void startConstraintList(const char *);␊ |
249 | void startConstraintParam();␊ |
250 | void endConstraintParam();␊ |
251 | void startConstraintType();␊ |
252 | void endConstraintType();␊ |
253 | void startConstraintDocs();␊ |
254 | void endConstraintDocs();␊ |
255 | void endConstraintList();␊ |
256 | ␊ |
257 | void startFontClass(const char *s) { t << "<span class=\"" << s << "\">"; }␊ |
258 | void endFontClass() { t << "</span>"; }␊ |
259 | ␊ |
260 | ␊ |
261 | void writeCodeAnchor(const char *anchor) ␊ |
262 | { t << "<a name=\"" << anchor << "\"></a>"; }␊ |
263 | void linkableSymbol(int,const char *,Definition *,Definition *) {}␊ |
264 | ␊ |
265 | //static void generateSectionImages();␊ |
266 | ␊ |
267 | private:␊ |
268 | static void writePageFooter(FTextStream &t,const QCString &,const QCString &);␊ |
269 | QCString lastTitle;␊ |
270 | QCString lastFile;␊ |
271 | QCString relPath;␊ |
272 | void docify(const char *text,bool inHtmlComment);␊ |
273 | ␊ |
274 | HtmlGenerator &operator=(const HtmlGenerator &g);␊ |
275 | HtmlGenerator(const HtmlGenerator &g);␊ |
276 | ␊ |
277 | int col;␊ |
278 | int m_sectionCount;␊ |
279 | };␊ |
280 | ␊ |
281 | #endif␊ |
282 |