mangen.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 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. */
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 
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 
55  void writePageLink(const char *,bool) {}
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);
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 writeTooltip(const char *, const DocLinkInfo &, const char *,
88  const char *, const SourceLinkInfo &, const SourceLinkInfo &
89  ) {}
90  void startTextLink(const char *,const char *) {}
91  void endTextLink() {}
92  void startHtmlLink(const char *url);
93  void endHtmlLink();
94  void startTypewriter() { t << "\\fC"; firstCol=FALSE; }
95  void endTypewriter() { t << "\\fP"; firstCol=FALSE; }
96  void startGroupHeader(int);
97  void endGroupHeader(int);
101  void endHeaderSection();
102  void startMemberHeader(const char *);
103  void endMemberHeader();
104  void insertMemberAlign(bool) {}
107  //void writeListItem();
108  void startItemListItem();
109  void endItemListItem();
112  void startMemberList();
113  void endMemberList();
114  void startInlineHeader();
115  void endInlineHeader();
116  void startAnonTypeScope(int);
117  void endAnonTypeScope(int);
118  void startMemberItem(const char *,int,const char *);
119  void endMemberItem();
121  void endMemberTemplateParams(const char *,const char *) {}
122 
123  void startMemberGroupHeader(bool);
124  void endMemberGroupHeader();
125  void startMemberGroupDocs();
126  void endMemberGroupDocs();
127  void startMemberGroup();
128  void endMemberGroup(bool);
129 
130  void writeRuler() {}
131  void writeAnchor(const char *,const char *) {}
132  void startCodeFragment();
133  void endCodeFragment();
134  void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; }
135  void startCodeLine(bool) {}
136  void endCodeLine() { codify("\n"); col=0; }
137  void startEmphasis() { t << "\\fI"; firstCol=FALSE; }
138  void endEmphasis() { t << "\\fP"; firstCol=FALSE; }
139  void startBold() { t << "\\fB"; firstCol=FALSE; }
140  void endBold() { t << "\\fP"; firstCol=FALSE; }
142  void endDescription() {}
143  void startDescItem();
144  void endDescItem();
145  void lineBreak(const char *) { t << "\n.br" << endl; }
146  void writeChar(char c);
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 *) {}
152  void writeStartAnnoItem(const char *type,const char *file,
153  const char *path,const char *name);
154  void writeEndAnnoItem(const char *) { t << endl; firstCol=TRUE; }
155  void startSubsection();
156  void endSubsection();
157  void startSubsubsection();
158  void endSubsubsection();
159  void startCenter() {}
160  void endCenter() {}
161  void startSmall() {}
162  void endSmall() {}
163  void startMemberDescription(const char *,const char *) { t << "\n.RI \"\\fI"; firstCol=FALSE; }
164  void endMemberDescription() { t << "\\fP\""; firstCol=FALSE; }
166  void endMemberDeclaration(const char *,const char *) {}
167  void writeInheritedSectionTitle(const char *,const char *,const char *,
168  const char *,const char *,const char *) {}
170  void endDescList() {}
171  void startSimpleSect(SectionTypes,const char *,const char *,const char *);
172  void endSimpleSect();
173  void startParamList(ParamListTypes,const char *title);
174  void endParamList();
175  //void writeDescItem();
176  void startDescForItem();
177  void endDescForItem();
178  void startSection(const char *,const char *,SectionInfo::SectionType);
179  void endSection(const char *,SectionInfo::SectionType);
180  void addIndexItem(const char *,const char *) {}
181  void startIndent() {}
182  void endIndent() {}
183  void writeSynopsis();
185  void endClassDiagram(const ClassDiagram &,const char *,const char *) {}
186  void startPageRef() {}
187  void endPageRef(const char *,const char *) {}
189  void endQuickIndices() {}
190  void writeSplitBar(const char *) {}
191  void writeNavigationPath(const char *) {}
192  void writeLogo() {}
193  void writeQuickLinks(bool,HighlightedItem,const char *) {}
194  void writeSummaryLink(const char *,const char *,const char *,bool) {}
195  void startContents() {}
196  void endContents() {}
197  void writeNonBreakableSpace(int n) { int i; for (i=0;i<n;i++) t << " "; }
198 
199  void startDescTable(const char *t)
206 
207  void startDotGraph() {}
208  void endDotGraph(const DotClassGraph &) {}
213  void startCallGraph() {}
214  void endCallGraph(const DotCallGraph &) {}
215  void startDirDepGraph() {}
216  void endDirDepGraph(const DotDirDeps &) {}
218 
219  void startTextBlock(bool) {}
220  void endTextBlock(bool) {}
221  void lastIndexPage() {}
222 
225  void startMemberDocName(bool) {}
227  void startParameterType(bool,const char *) {}
229  void startParameterName(bool) {}
230  void endParameterName(bool,bool,bool) {}
231  void startParameterList(bool) {}
233  void exceptionEntry(const char*,bool) {}
234 
235  void startFontClass(const char *) {}
236  void endFontClass() {}
237 
238  void startConstraintList(const char *);
239  void startConstraintParam();
240  void endConstraintParam();
241  void startConstraintType();
242  void endConstraintType();
243  void startConstraintDocs();
244  void endConstraintDocs();
245  void endConstraintList();
246 
247  void startMemberDocSimple();
248  void endMemberDocSimple();
249  void startInlineMemberType();
250  void endInlineMemberType();
251  void startInlineMemberName();
252  void endInlineMemberName();
253  void startInlineMemberDoc();
254  void endInlineMemberDoc();
255 
256  void startLabels();
257  void writeLabel(const char *l,bool isLast);
258  void endLabels();
259 
260  void writeCodeAnchor(const char *) {}
261  void setCurrentDoc(Definition *,const char *,bool) {}
262  void addWord(const char *,bool) {}
263 
264  private:
265  bool firstCol;
266  bool paragraph;
267  int col;
268  bool upperCase;
270  bool inHeader;
271 
272  ManGenerator(const ManGenerator &g);
274 };
275 
276 #endif
static QCString name
Definition: declinfo.cpp:673
void endMemberDescription()
Definition: mangen.h:164
bool isEnabled(OutputType o)
Definition: mangen.h:41
void endParagraph()
Definition: mangen.cpp:222
void endSection(const char *, SectionInfo::SectionType)
Definition: mangen.cpp:630
void endMemberItem()
Definition: mangen.cpp:562
void startPageRef()
Definition: mangen.h:186
void endMemberGroup(bool)
Definition: mangen.cpp:608
void startIndexList()
Definition: mangen.h:70
void addIndexItem(const char *, const char *)
Definition: mangen.h:180
void startDirDepGraph()
Definition: mangen.h:215
void endCallGraph(const DotCallGraph &)
Definition: mangen.h:214
void writeString(const char *text)
Definition: mangen.cpp:226
void writeStyleInfo(int)
Definition: mangen.h:58
static void init()
Definition: mangen.cpp:108
void writeCodeAnchor(const char *)
Definition: mangen.h:260
void writeNonBreakableSpace(int n)
Definition: mangen.h:197
void writeGraphicalHierarchy(const DotGfxHierarchyTable &)
Definition: mangen.h:217
void writeSplitBar(const char *)
Definition: mangen.h:190
void startAnonTypeScope(int)
Definition: mangen.cpp:538
void endMemberSubtitle()
Definition: mangen.h:106
void endConstraintDocs()
Definition: mangen.cpp:740
void endItemList()
Definition: mangen.h:77
void endMemberGroupDocs()
Definition: mangen.cpp:598
void startCallGraph()
Definition: mangen.h:213
void startMemberDocName(bool)
Definition: mangen.h:225
void endBold()
Definition: mangen.h:140
static constexpr double g
Definition: Units.h:144
void startDescTable(const char *t)
Definition: mangen.h:199
void enableIf(OutputType o)
Definition: mangen.h:38
void startMemberDocList()
Definition: mangen.h:110
void addWord(const char *, bool)
Definition: mangen.h:262
~ManGenerator()
Definition: mangen.cpp:88
void writeLatexSpacing()
Definition: mangen.h:151
void startDescForItem()
Definition: mangen.cpp:518
void endDescription()
Definition: mangen.h:142
void disableIfNot(OutputType o)
Definition: mangen.h:40
void endHtmlLink()
Definition: mangen.cpp:261
void startParamList(ParamListTypes, const char *title)
Definition: mangen.cpp:672
void endMemberDocSimple()
Definition: mangen.cpp:777
void startConstraintDocs()
Definition: mangen.cpp:736
void endMemberSections()
Definition: mangen.h:99
void endDescItem()
Definition: mangen.cpp:532
void startDescItem()
Definition: mangen.cpp:505
void startTitleHead(const char *)
Definition: mangen.h:59
void startMemberDocPrefixItem()
Definition: mangen.h:223
void endQuickIndices()
Definition: mangen.h:189
void startIndexValue(bool)
Definition: mangen.h:74
void startEmphasis()
Definition: mangen.h:137
void newParagraph()
Definition: mangen.cpp:200
void disableIf(OutputType o)
Definition: mangen.h:39
void endAnonTypeScope(int)
Definition: mangen.cpp:546
IndexSections
Definition: index.h:157
const bool FALSE
Definition: qglobal.h:370
void startMemberList()
Definition: mangen.cpp:567
void startConstraintType()
Definition: mangen.cpp:726
void endIndexItem(const char *ref, const char *file)
Definition: mangen.cpp:235
void clearBuffer()
void startMemberGroup()
Definition: mangen.cpp:603
void startSubsection()
Definition: mangen.cpp:470
void startTypewriter()
Definition: mangen.h:94
void endParamList()
Definition: mangen.cpp:686
void startDescription()
Definition: mangen.h:141
void endMemberDocName()
Definition: mangen.h:226
void writeSummaryLink(const char *, const char *, const char *, bool)
Definition: mangen.h:194
void writeLabel(const char *l, bool isLast)
Definition: mangen.cpp:820
void startMemberTemplateParams()
Definition: mangen.h:120
void writePageLink(const char *, bool)
Definition: mangen.h:55
void endIndexSection(IndexSections)
Definition: mangen.h:54
void startInlineMemberName()
Definition: mangen.cpp:794
void startInlineMemberType()
Definition: mangen.cpp:785
void startMemberDeclaration()
Definition: mangen.h:165
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: mangen.cpp:244
void endEmphasis()
Definition: mangen.h:138
void startGroupHeader(int)
Definition: mangen.cpp:270
void docify(const char *text)
Definition: mangen.cpp:299
void writeRuler()
Definition: mangen.h:130
void endIndexValue(const char *, bool)
Definition: mangen.h:75
static QStrList * l
Definition: config.cpp:1044
void endDirDepGraph(const DotDirDeps &)
Definition: mangen.h:216
void endGroupCollaboration(const DotGroupCollaboration &)
Definition: mangen.h:212
void startParameterList(bool)
Definition: mangen.h:231
void startDotGraph()
Definition: mangen.h:207
void writeLogo()
Definition: mangen.h:192
void endDoxyAnchor(const char *, const char *)
Definition: mangen.h:150
void endMemberHeader()
Definition: mangen.cpp:292
void endDescTableTitle()
Definition: mangen.h:203
void writeChar(char c)
Definition: mangen.cpp:353
void endTitle()
Definition: mangen.cpp:386
void endLabels()
Definition: mangen.cpp:826
void endMemberDocPrefixItem()
Definition: mangen.h:224
void codify(const char *text)
Definition: mangen.cpp:323
void endCenter()
Definition: mangen.h:160
void startIndexKey()
Definition: mangen.h:72
void startContents()
Definition: mangen.h:195
bool inHeader
Definition: mangen.h:270
void setCurrentDoc(Definition *, const char *, bool)
Definition: mangen.h:261
void startCodeFragment()
Definition: mangen.cpp:404
void endDescTableData()
Definition: mangen.h:205
void endDescForItem()
Definition: mangen.cpp:528
void writeStartAnnoItem(const char *type, const char *file, const char *path, const char *name)
Definition: mangen.cpp:239
void endSimpleSect()
Definition: mangen.cpp:668
void startInlineMemberDoc()
Definition: mangen.cpp:804
void startCodeLine(bool)
Definition: mangen.h:135
void startSimpleSect(SectionTypes, const char *, const char *, const char *)
Definition: mangen.cpp:653
void endSmall()
Definition: mangen.h:162
void endInlineMemberDoc()
Definition: mangen.cpp:808
void endCodeLine()
Definition: mangen.h:136
void lineBreak(const char *)
Definition: mangen.h:145
void startMemberHeader(const char *)
Definition: mangen.cpp:286
void startItemListItem()
Definition: mangen.cpp:391
void startMemberGroupDocs()
Definition: mangen.cpp:594
void endMemberList()
Definition: mangen.cpp:575
void endConstraintList()
Definition: mangen.cpp:745
void endDescTable()
Definition: mangen.h:201
void endInclDepGraph(const DotInclDepGraph &)
Definition: mangen.h:210
void writeTooltip(const char *, const DocLinkInfo &, const char *, const char *, const SourceLinkInfo &, const SourceLinkInfo &)
Definition: mangen.h:87
void endConstraintType()
Definition: mangen.cpp:731
void startLabels()
Definition: mangen.cpp:816
QStack< bool > * genStack
Definition: outputgen.h:491
std::void_t< T > n
void startMemberSections()
Definition: mangen.h:98
void startParameterName(bool)
Definition: mangen.h:229
void startMemberDoc(const char *, const char *, const char *, const char *, bool)
Definition: mangen.cpp:421
void startInlineHeader()
Definition: mangen.cpp:750
void endHeaderSection()
Definition: mangen.cpp:830
void startCenter()
Definition: mangen.h:159
void lastIndexPage()
Definition: mangen.h:221
void startDoxyAnchor(const char *, const char *, const char *, const char *, const char *)
Definition: mangen.cpp:429
void exceptionEntry(const char *, bool)
Definition: mangen.h:233
void startIndexSection(IndexSections)
Definition: mangen.h:53
void writeDoc(DocNode *, Definition *, MemberDef *)
Definition: mangen.cpp:690
void startMemberItem(const char *, int, const char *)
Definition: mangen.cpp:555
void endItemListItem()
Definition: mangen.cpp:400
void startHtmlLink(const char *url)
Definition: mangen.cpp:257
void endIndent()
Definition: mangen.h:182
void startIndexItem(const char *ref, const char *file)
Definition: mangen.cpp:231
void startQuickIndices()
Definition: mangen.h:188
void enable()
Definition: mangen.h:35
void startParagraph()
Definition: mangen.cpp:211
void endTextBlock(bool)
Definition: mangen.h:220
void startSection(const char *, const char *, SectionInfo::SectionType)
Definition: mangen.cpp:614
QFile * file
Definition: outputgen.h:487
void endCodeFragment()
Definition: mangen.cpp:412
void startBold()
Definition: mangen.h:139
void endPageRef(const char *, const char *)
Definition: mangen.h:187
void writeSynopsis()
Definition: mangen.cpp:497
bool firstCol
Definition: mangen.h:265
void endFile()
Definition: mangen.cpp:174
void startConstraintParam()
Definition: mangen.cpp:713
void endSubsubsection()
Definition: mangen.cpp:492
bool insideTabbing
Definition: mangen.h:269
void startSubsubsection()
Definition: mangen.cpp:484
void endTitleHead(const char *, const char *)
Definition: mangen.cpp:180
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
void writeInheritedSectionTitle(const char *, const char *, const char *, const char *, const char *, const char *)
Definition: mangen.h:167
void endInlineHeader()
Definition: mangen.cpp:759
void endGroupHeader(int)
Definition: mangen.cpp:278
void startFontClass(const char *)
Definition: mangen.h:235
void startParameterType(bool, const char *)
Definition: mangen.h:227
void startDescTableData()
Definition: mangen.h:204
void startTextLink(const char *, const char *)
Definition: mangen.h:90
void endConstraintParam()
Definition: mangen.cpp:719
void startSmall()
Definition: mangen.h:161
void startIndent()
Definition: mangen.h:181
FTextStream t
Definition: outputgen.h:486
void startConstraintList(const char *)
Definition: mangen.cpp:699
bool upperCase
Definition: mangen.h:268
void endMemberDeclaration(const char *, const char *)
Definition: mangen.h:166
void endMemberDoc(bool)
Definition: mangen.cpp:465
void endInlineMemberName()
Definition: mangen.cpp:799
void startFile(const char *name, const char *manName, const char *title)
Definition: mangen.cpp:168
void writeLineNumber(const char *, const char *, const char *, int l)
Definition: mangen.h:134
void writeQuickLinks(bool, HighlightedItem, const char *)
Definition: mangen.h:193
void startDescList(SectionTypes)
Definition: mangen.cpp:367
void startTitle()
Definition: mangen.cpp:378
void writeSearchInfo()
Definition: mangen.h:48
void startItemList()
Definition: mangen.h:76
void writeCodeLink(const char *ref, const char *file, const char *anchor, const char *name, const char *tooltip)
Definition: mangen.cpp:250
void endTextLink()
Definition: mangen.h:91
void endParameterList()
Definition: mangen.h:232
void endParameterName(bool, bool, bool)
Definition: mangen.h:230
void disable()
Definition: mangen.h:37
void writeFooter(const char *)
Definition: mangen.h:49
void endDescList()
Definition: mangen.h:170
void startIndexListItem()
Definition: mangen.h:68
void endInlineMemberType()
Definition: mangen.cpp:789
void endIndexList()
Definition: mangen.h:71
void writeAnchor(const char *, const char *)
Definition: mangen.h:131
void endIndexKey()
Definition: mangen.h:73
void startMemberGroupHeader(bool)
Definition: mangen.cpp:583
void endDotGraph(const DotClassGraph &)
Definition: mangen.h:208
void endClassDiagram(const ClassDiagram &, const char *, const char *)
Definition: mangen.h:185
void startMemberSubtitle()
Definition: mangen.h:105
void endMemberTemplateParams(const char *, const char *)
Definition: mangen.h:121
bool paragraph
Definition: mangen.h:266
HighlightedItem
Definition: index.h:180
ManGenerator & operator=(const ManGenerator &g)
void writeNavigationPath(const char *)
Definition: mangen.h:191
void startDescTableTitle()
Definition: mangen.h:202
void insertMemberAlign(bool)
Definition: mangen.h:104
void startClassDiagram()
Definition: mangen.h:184
void startProjectNumber()
Definition: mangen.h:56
void startMemberDocSimple()
Definition: mangen.cpp:765
void endFontClass()
Definition: mangen.h:236
void startHeaderSection()
Definition: mangen.h:100
void endTypewriter()
Definition: mangen.h:95
void startTextBlock(bool)
Definition: mangen.h:219
void endContents()
Definition: mangen.h:196
void endMemberDocList()
Definition: mangen.h:111
void endMemberGroupHeader()
Definition: mangen.cpp:588
void endSubsection()
Definition: mangen.cpp:478
void startMemberDescription(const char *, const char *)
Definition: mangen.h:163
void startGroupCollaboration()
Definition: mangen.h:211
void startInclDepGraph()
Definition: mangen.h:209
const bool TRUE
Definition: qglobal.h:371
void endProjectNumber()
Definition: mangen.h:57
QTextStream & endl(QTextStream &s)
type * top() const
Definition: qstack.h:63
void endIndexListItem()
Definition: mangen.h:69
void writeEndAnnoItem(const char *)
Definition: mangen.h:154
void endParameterType()
Definition: mangen.h:228
ManGenerator()
Definition: mangen.cpp:77