ISLEman
rtfgen.h
1 /******************************************************************************
2  *
3  *
4  *
5  * Copyright (C) 1997-2015 by Parker Waechter & 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 RTFGEN_H
19 #define RTFGEN_H
20 
21 #include "outputgen.h"
22 
23 class QFile;
24 
27 {
28  public:
29  RTFGenerator();
30  ~RTFGenerator();
31  static void init();
32  static void writeStyleSheetFile(QFile &f);
33  static void writeExtensionsFile(QFile &file);
34 
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==RTF) enable(); }
39  void disableIf(OutputType o) { if (o==RTF) disable(); }
40  void disableIfNot(OutputType o) { if (o!=RTF) disable(); }
41  bool isEnabled(OutputType o) { return (o==RTF && active); }
42  OutputGenerator *get(OutputType o) { return (o==RTF) ? this : 0; }
43 
44  void writeDoc(DocNode *,Definition *,MemberDef *);
45 
46  void startFile(const char *name,const char *manName,const char *title);
47  void writeSearchInfo() {}
48  void writeFooter(const char *) {}
49  void endFile();
50  void clearBuffer();
51  //void postProcess(QByteArray &);
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() {}
63 
64  void newParagraph();
65  void startParagraph(const char *classDef);
66  void endParagraph();
67  void writeString(const char *text);
68  void startIndexListItem();
69  void endIndexListItem();
70  void startIndexList();
71  void endIndexList();
72  void startIndexKey();
73  void endIndexKey();
74  void startIndexValue(bool);
75  void endIndexValue(const char *,bool);
76  void startItemList();
77  void endItemList();
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 *f,const char *anchor);
91  void endTextLink();
92  void startHtmlLink(const char *url);
93  void endHtmlLink();
94  void startTypewriter() { t << "{\\f2 "; }
95  void endTypewriter() { t << "}"; }
96  void startGroupHeader(int);
97  void endGroupHeader(int);
98  //void writeListItem();
99  void startItemListItem();
100  void endItemListItem();
101 
102  void startMemberSections() {}
103  void endMemberSections() {}
104  void startHeaderSection() {}
105  void endHeaderSection() {}
106  void startMemberHeader(const char *) { startGroupHeader(FALSE); }
107  void endMemberHeader() { endGroupHeader(FALSE); }
108  void startMemberSubtitle();
109  void endMemberSubtitle();
110  void startMemberDocList() {}
111  void endMemberDocList() {}
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();
120  void startMemberTemplateParams() {}
121  void endMemberTemplateParams(const char *,const char *) {}
122  void insertMemberAlign(bool) {}
123 
124  void writeRuler() { rtfwriteRuler_thin(); }
125 
126  void writeAnchor(const char *fileName,const char *name);
127  void startCodeFragment();
128  void endCodeFragment();
129  void writeLineNumber(const char *,const char *,const char *,int l) { t << QString("%1").arg(l,5) << " "; }
130  void startCodeLine(bool) { col=0; }
131  void endCodeLine() { lineBreak(); }
132  void startEmphasis() { t << "{\\i "; }
133  void endEmphasis() { t << "}"; }
134  void startBold() { t << "{\\b "; }
135  void endBold() { t << "}"; }
136  void startDescription();
137  void endDescription();
138  void startDescItem();
139  void endDescItem();
140  void lineBreak(const char *style=0);
141  void startMemberDoc(const char *,const char *,const char *,const char *,int,int,bool);
142  void endMemberDoc(bool);
143  void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
144  void endDoxyAnchor(const char *,const char *);
145  void writeChar(char c);
146  void writeLatexSpacing() {};//{ t << "\\hspace{0.3cm}"; }
147  void writeStartAnnoItem(const char *type,const char *file,
148  const char *path,const char *name);
149  void writeEndAnnoItem(const char *name);
150  void startSubsection();
151  void endSubsection();
152  void startSubsubsection();
153  void endSubsubsection();
154  void startCenter() { t << "{\\qc" << endl; }
155  void endCenter() { t << "}"; }
156  void startSmall() { t << "{\\sub "; }
157  void endSmall() { t << "}"; }
158 
159  void startMemberDescription(const char *,const char *);
160  void endMemberDescription();
161  void startMemberDeclaration() {}
162  void endMemberDeclaration(const char *,const char *) {}
163  void writeInheritedSectionTitle(const char *,const char *,const char *,
164  const char *,const char *,const char *) {}
165  void startDescList(SectionTypes);
166  void startSimpleSect(SectionTypes,const char *,const char *,const char *);
167  void endSimpleSect();
168  void startParamList(ParamListTypes,const char *);
169  void endParamList();
170  //void writeDescItem();
171  void startDescForItem();
172  void endDescForItem();
173  void startSection(const char *,const char *,SectionInfo::SectionType);
174  void endSection(const char *,SectionInfo::SectionType);
175  void addIndexItem(const char *,const char *);
176  void startIndent();
177  void endIndent();
178  void writeSynopsis() {}
179  void startClassDiagram();
180  void endClassDiagram(const ClassDiagram &,const char *filename,const char *name);
181  void startPageRef();
182  void endPageRef(const char *,const char *);
183  void startQuickIndices() {}
184  void endQuickIndices() {}
185  void writeSplitBar(const char *) {}
186  void writeNavigationPath(const char *) {}
187  void writeLogo() {}
188  void writeQuickLinks(bool,HighlightedItem,const char *) {}
189  void writeSummaryLink(const char *,const char *,const char *,bool) {}
190  void startContents() {}
191  void endContents() {}
192  void writeNonBreakableSpace(int);
193 
194  void startDescTable(const char *title);
195  void endDescTable();
196  void startDescTableRow();
197  void endDescTableRow();
198  void startDescTableTitle();
199  void endDescTableTitle();
200  void startDescTableData();
201  void endDescTableData();
202 
203  void startDotGraph();
204  void endDotGraph(const DotClassGraph &);
205  void startInclDepGraph();
206  void endInclDepGraph(const DotInclDepGraph &);
207  void startGroupCollaboration();
208  void endGroupCollaboration(const DotGroupCollaboration &g);
209  void startCallGraph();
210  void endCallGraph(const DotCallGraph &);
211  void startDirDepGraph();
212  void endDirDepGraph(const DotDirDeps &g);
213  void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {}
214 
215  void startMemberGroupHeader(bool);
216  void endMemberGroupHeader();
217  void startMemberGroupDocs();
218  void endMemberGroupDocs();
219  void startMemberGroup();
220  void endMemberGroup(bool);
221 
222  void startTextBlock(bool dense);
223  void endTextBlock(bool);
224  void lastIndexPage();
225 
226  void startMemberDocPrefixItem() {}
227  void endMemberDocPrefixItem() {}
228  void startMemberDocName(bool) {}
229  void endMemberDocName() {}
230  void startParameterType(bool,const char *);
231  void endParameterType();
232  void startParameterName(bool) {}
233  void endParameterName(bool,bool,bool) {}
234  void startParameterList(bool) {}
235  void endParameterList() {}
236  void exceptionEntry(const char*,bool);
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(bool);
248  void endMemberDocSimple(bool);
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 startFontClass(const char *) {}
261  void endFontClass() {}
262 
263  void writeCodeAnchor(const char *) {}
264  void setCurrentDoc(Definition *,const char *,bool) {}
265  void addWord(const char *,bool) {}
266 
267  static bool preProcessFileInplace(const char *path,const char *name);
268 
269  private:
270  RTFGenerator(const RTFGenerator &);
271  RTFGenerator &operator=(const RTFGenerator &);
272 
273  const char *rtf_BList_DepthStyle();
274  const char *rtf_CList_DepthStyle();
275  const char *rtf_EList_DepthStyle();
276  const char *rtf_LCList_DepthStyle();
277  const char *rtf_DList_DepthStyle();
278  const char *rtf_Code_DepthStyle();
279  void incrementIndentLevel();
280  void decrementIndentLevel();
281  int col;
282  bool m_prettyCode;
283 
284  bool m_bstartedBody; // has startbody been called yet?
285  int m_listLevel; // // RTF does not really have a addative indent...manually set list level.
286  bool m_omitParagraph; // should a the next paragraph command be ignored?
287  int m_numCols; // number of columns in a table
288  QCString relPath;
289 
290  void beginRTFDocument();
291  void beginRTFChapter();
292  void beginRTFSection();
293  void rtfwriteRuler_doubleline();
294  void rtfwriteRuler_emboss();
295  void rtfwriteRuler_thick();
296  void rtfwriteRuler_thin();
297  void writeRTFReference(const char *label);
298  //char *getMultiByte(int c);
299 };
300 
301 #endif
void docify(const char *text)
Definition: rtfgen.cpp:1765
The common base class of all entity definitions found in the sources.
Definition: definition.h:92
A model of a class/file/namespace member symbol.
Definition: memberdef.h:43
void startTypewriter()
Definition: rtfgen.h:94
void startItemListItem()
Definition: rtfgen.cpp:1039
void endFontClass()
Definition: rtfgen.h:261
void endDescription()
Definition: rtfgen.cpp:1608
void writeString(const char *text)
Definition: rtfgen.cpp:971
static bool preProcessFileInplace(const char *path, const char *name)
This is an API to a VERY brittle RTF preprocessor that combines nested RTF files. ...
Definition: rtfgen.cpp:2627
The QString class provides an abstraction of Unicode text and the classic C null-terminated char arra...
Definition: qstring.h:350
Generator for RTF output.
Definition: rtfgen.h:26
void endCodeLine()
Definition: rtfgen.h:131
Represents a graphical class hierarchy.
Definition: dot.h:149
Representation of a group collaboration graph.
Definition: dot.h:278
void startCodeFragment()
Definition: rtfgen.cpp:1920
void endBold()
Definition: rtfgen.h:135
void endDescItem()
Definition: rtfgen.cpp:1622
void endEmphasis()
Definition: rtfgen.h:133
void endTypewriter()
Definition: rtfgen.h:95
void endHtmlLink()
Definition: rtfgen.cpp:1112
void writeRuler()
Definition: rtfgen.h:124
The QFile class is an I/O device that operates on files.
Definition: qfile.h:50
void startItemList()
Definition: rtfgen.cpp:999
void startEmphasis()
Definition: rtfgen.h:132
void startBold()
Definition: rtfgen.h:134
Class representing a built-in class diagram.
Definition: diagram.h:29
void writeTooltip(const char *, const DocLinkInfo &, const char *, const char *, const SourceLinkInfo &, const SourceLinkInfo &)
Definition: rtfgen.h:87
void writeObjectLink(const char *ref, const char *file, const char *anchor, const char *name)
Definition: rtfgen.cpp:1344
void startDescItem()
Definition: rtfgen.cpp:1615
void codify(const char *text)
Definition: rtfgen.cpp:1810
void writeLineNumber(const char *, const char *, const char *, int l)
Definition: rtfgen.h:129
Representation of an call graph.
Definition: dot.h:232
void endItemList()
Definition: rtfgen.cpp:1009
void endParagraph()
Definition: rtfgen.cpp:2175
Representation of a class inheritance or dependency graph.
Definition: dot.h:169
QString arg(long a, int fieldwidth=0, int base=10) const
Definition: qstring.cpp:12593
void writeCodeLink(const char *ref, const char *file, const char *anchor, const char *name, const char *tooltip)
Definition: rtfgen.cpp:1400
Abstract node interface with type information.
Definition: docparser.h:79
Abstract output generator.
Definition: outputgen.h:322
void startFontClass(const char *)
Definition: rtfgen.h:260
Representation of an include dependency graph.
Definition: dot.h:203
void endItemListItem()
Definition: rtfgen.cpp:1057
Representation of an directory dependency graph.
Definition: dot.h:258
void startParagraph(const char *classDef)
Definition: rtfgen.cpp:2168
void startHtmlLink(const char *url)
Definition: rtfgen.cpp:1096
void endCodeFragment()
Definition: rtfgen.cpp:1929
This is an alternative implementation of QCString.
Definition: qcstring.h:131
Definition: outputgen.h:48
Definition: outputgen.h:40
void writeChar(char c)
Definition: rtfgen.cpp:1845
void writeCodeAnchor(const char *)
Definition: rtfgen.h:263
void startDescription()
Definition: rtfgen.cpp:1601