Fix for UBSan build
[platform/upstream/doxygen.git] / src / mangen.h
1 /******************************************************************************
2  *
3  * $Id: htmlgen.h,v 1.15 1998/11/28 11:33:19 root Exp $
4  *
5  * Copyright (C) 1997-2012 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 MANGEN_H
19 #define MANGEN_H
20
21 #include "outputgen.h"
22
23 class QFile;
24
25 /** Generator for Man page output. */
26 class ManGenerator : public OutputGenerator
27 {
28   public:
29     ManGenerator();
30    ~ManGenerator();
31     
32     //OutputGenerator *copy()  { return new ManGenerator; } 
33     //OutputGenerator *clone() { return new ManGenerator(*this); }
34     //void append(const OutputGenerator *o);
35     void enable() 
36     { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
37     void disable() { active=FALSE; }
38     void enableIf(OutputType o)  { if (o==Man) enable(); }
39     void disableIf(OutputType o) { if (o==Man) disable(); }
40     void disableIfNot(OutputType o) { if (o!=Man) disable(); }
41     bool isEnabled(OutputType o) { return (o==Man && active); } 
42     OutputGenerator *get(OutputType o) { return (o==Man) ? this : 0; }
43
44     void writeDoc(DocNode *,Definition *,MemberDef *);
45
46     static void init();
47     void startFile(const char *name,const char *manName,const char *title);
48     void writeSearchInfo() {}
49     void writeFooter(const char *) {}
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) {}
59     void startTitleHead(const char *) {}
60     void endTitleHead(const char *,const char *);
61     void startTitle();
62     void endTitle();
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() {}
71     void endIndexList()   { newParagraph(); } 
72     void startIndexKey() {}
73     void endIndexKey()   {} 
74     void startIndexValue(bool) {}
75     void endIndexValue(const char *,bool)   {} 
76     void startItemList()  {}
77     void endItemList()    { newParagraph(); }
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 << "\\fC"; firstCol=FALSE; }
92     void endTypewriter()   { t << "\\fP"; firstCol=FALSE; }
93     void startGroupHeader(int);
94     void endGroupHeader(int);
95     void startMemberSections() {}
96     void endMemberSections() {}
97     void startHeaderSection() {}
98     void endHeaderSection() {}
99     void startMemberHeader(const char *);
100     void endMemberHeader();
101     void insertMemberAlign(bool) {}
102     void startMemberSubtitle() {}
103     void endMemberSubtitle() {}
104     //void writeListItem();
105     void startItemListItem();
106     void endItemListItem();
107     void startMemberDocList() {}
108     void endMemberDocList() {}
109     void startMemberList();
110     void endMemberList();
111     void startInlineHeader();
112     void endInlineHeader();
113     void startAnonTypeScope(int);
114     void endAnonTypeScope(int);
115     void startMemberItem(const char *,int,const char *);
116     void endMemberItem();
117     void startMemberTemplateParams() {}
118     void endMemberTemplateParams(const char *,const char *) {}
119
120     void startMemberGroupHeader(bool);
121     void endMemberGroupHeader();
122     void startMemberGroupDocs();
123     void endMemberGroupDocs();
124     void startMemberGroup();
125     void endMemberGroup(bool);
126
127     void writeRuler()    {}
128     void writeAnchor(const char *,const char *) {}
129     void startCodeFragment();
130     void endCodeFragment();
131     void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; }
132     void startCodeLine(bool) {}
133     void endCodeLine() { codify("\n"); col=0; }
134     void startEmphasis() { t << "\\fI"; firstCol=FALSE; }
135     void endEmphasis()   { t << "\\fP"; firstCol=FALSE; }
136     void startBold()     { t << "\\fB"; firstCol=FALSE; }
137     void endBold()       { t << "\\fP"; firstCol=FALSE; }
138     void startDescription() {}
139     void endDescription()   {}
140     void startDescItem();
141     void endDescItem();
142     void lineBreak(const char *) { t << "\n.br" << endl; }
143     void writeChar(char c);
144     void startMemberDoc(const char *,const char *,const char *,const char *,bool);
145     void endMemberDoc(bool);
146     void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
147     void endDoxyAnchor(const char *,const char *) {}
148     void startCodeAnchor(const char *) {}
149     void endCodeAnchor() {}
150     void writeLatexSpacing() {}
151     void writeStartAnnoItem(const char *type,const char *file,
152                             const char *path,const char *name);
153     void writeEndAnnoItem(const char *) { t << endl; firstCol=TRUE; }
154     void startSubsection();
155     void endSubsection();
156     void startSubsubsection();
157     void endSubsubsection();
158     void startCenter()        {}
159     void endCenter()          {}
160     void startSmall()         {}
161     void endSmall()           {}
162     void startMemberDescription(const char *,const char *) { t << "\n.RI \"\\fI"; firstCol=FALSE; }
163     void endMemberDescription()   { t << "\\fP\""; firstCol=FALSE; }
164     void startMemberDeclaration() {} 
165     void endMemberDeclaration(const char *,const char *) {}
166     void writeInheritedSectionTitle(const char *,const char *,const char *,
167                       const char *,const char *,const char *) {}
168     void startDescList(SectionTypes);
169     void endDescList()        {}
170     void startSimpleSect(SectionTypes,const char *,const char *,const char *);
171     void endSimpleSect();
172     void startParamList(ParamListTypes,const char *title);
173     void endParamList();
174     //void writeDescItem();
175     void startDescForItem();
176     void endDescForItem();
177     void startSection(const char *,const char *,SectionInfo::SectionType);
178     void endSection(const char *,SectionInfo::SectionType);
179     void addIndexItem(const char *,const char *) {}
180     void startIndent()        {}
181     void endIndent()          {}
182     void writeSynopsis();
183     void startClassDiagram() {}
184     void endClassDiagram(const ClassDiagram &,const char *,const char *) {}
185     void startPageRef() {}
186     void endPageRef(const char *,const char *) {}
187     void startQuickIndices() {}
188     void endQuickIndices() {}
189     void writeSplitBar(const char *) {}
190     void writeNavigationPath(const char *) {}
191     void writeLogo() {}
192     void writeQuickLinks(bool,HighlightedItem,const char *) {}
193     void writeSummaryLink(const char *,const char *,const char *,bool) {}
194     void startContents() {}
195     void endContents() {}
196     void writeNonBreakableSpace(int n) { int i; for (i=0;i<n;i++) t << " "; }
197     
198     void startDescTable() {}
199     void endDescTable() {}
200     void startDescTableTitle() { startItemListItem(); startBold(); startEmphasis(); endItemListItem(); }
201     void endDescTableTitle() { endEmphasis(); endBold(); }
202     void startDescTableData() { t << endl; firstCol=TRUE; }
203     void endDescTableData() {}
204
205     void startDotGraph() {}
206     void endDotGraph(const DotClassGraph &) {}
207     void startInclDepGraph() {}
208     void endInclDepGraph(const DotInclDepGraph &) {}
209     void startGroupCollaboration() {}
210     void endGroupCollaboration(const DotGroupCollaboration &) {}
211     void startCallGraph() {}
212     void endCallGraph(const DotCallGraph &) {}
213     void startDirDepGraph() {} 
214     void endDirDepGraph(const DotDirDeps &) {}
215     void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {}
216
217     void startTextBlock(bool) {}
218     void endTextBlock(bool) {}
219     void lastIndexPage() {}
220
221     void startMemberDocPrefixItem() {}
222     void endMemberDocPrefixItem() {}
223     void startMemberDocName(bool) {}
224     void endMemberDocName() {}
225     void startParameterType(bool,const char *) {}
226     void endParameterType() {}
227     void startParameterName(bool) {}
228     void endParameterName(bool,bool,bool) {}
229     void startParameterList(bool) {}
230     void endParameterList() {}
231
232     void startFontClass(const char *) {}
233     void endFontClass() {}
234
235     void startConstraintList(const char *);
236     void startConstraintParam();
237     void endConstraintParam();
238     void startConstraintType();
239     void endConstraintType();
240     void startConstraintDocs();
241     void endConstraintDocs();
242     void endConstraintList();
243
244     void startMemberDocSimple();
245     void endMemberDocSimple();
246     void startInlineMemberType();
247     void endInlineMemberType();
248     void startInlineMemberName();
249     void endInlineMemberName();
250     void startInlineMemberDoc();
251     void endInlineMemberDoc();
252
253     void startLabels();
254     void writeLabel(const char *l,bool isLast);
255     void endLabels();
256
257     void writeCodeAnchor(const char *) {}
258     void linkableSymbol(int,const char *,Definition *,Definition *) {}
259
260   private:
261     bool firstCol;
262     bool paragraph;
263     int col;
264     bool upperCase;
265     bool insideTabbing;
266     bool inHeader;
267
268     ManGenerator(const ManGenerator &g);
269     ManGenerator &operator=(const ManGenerator &g);
270 };
271
272 #endif