|
1 /****************************************************************************** |
|
2 * |
|
3 * |
|
4 * |
|
5 * Copyright (C) 1997-2008 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 |
|
25 class RTFGenerator : public OutputGenerator |
|
26 { |
|
27 public: |
|
28 RTFGenerator(); |
|
29 ~RTFGenerator(); |
|
30 static void init(); |
|
31 static void writeStyleSheetFile(QFile &f); |
|
32 static void writeExtensionsFile(QFile &file); |
|
33 |
|
34 void enable() |
|
35 { if (genStack->top()) active=*genStack->top(); else active=TRUE; } |
|
36 void disable() { active=FALSE; } |
|
37 void enableIf(OutputType o) { if (o==RTF) active=TRUE; } |
|
38 void disableIf(OutputType o) { if (o==RTF) active=FALSE; } |
|
39 void disableIfNot(OutputType o) { if (o!=RTF) active=FALSE; } |
|
40 bool isEnabled(OutputType o) { return (o==RTF && active); } |
|
41 OutputGenerator *get(OutputType o) { return (o==RTF) ? this : 0; } |
|
42 |
|
43 void printDoc(DocNode *,const char *); |
|
44 |
|
45 void startFile(const char *name,const char *manName,const char *title); |
|
46 void writeFooter() {} |
|
47 void endFile(); |
|
48 void clearBuffer(); |
|
49 void postProcess(QByteArray &); |
|
50 |
|
51 void startIndexSection(IndexSections); |
|
52 void endIndexSection(IndexSections); |
|
53 void writePageLink(const char *,bool); |
|
54 void startProjectNumber(); |
|
55 void endProjectNumber(); |
|
56 void writeStyleInfo(int part); |
|
57 void startTitleHead(const char *); |
|
58 void startTitle(); |
|
59 void endTitleHead(const char *,const char *name); |
|
60 void endTitle() {} |
|
61 |
|
62 void newParagraph(); |
|
63 void startParagraph(); |
|
64 void endParagraph(); |
|
65 void writeString(const char *text); |
|
66 void startIndexListItem() {} |
|
67 void endIndexListItem() {} |
|
68 void startIndexList(); |
|
69 void endIndexList(); |
|
70 void startIndexKey(); |
|
71 void endIndexKey(); |
|
72 void startIndexValue(bool); |
|
73 void endIndexValue(const char *,bool); |
|
74 void startItemList(); |
|
75 void endItemList(); |
|
76 void startIndexItem(const char *ref,const char *file); |
|
77 void endIndexItem(const char *ref,const char *file); |
|
78 void docify(const char *text); |
|
79 void codify(const char *text); |
|
80 void writeObjectLink(const char *ref,const char *file, |
|
81 const char *anchor,const char *name); |
|
82 void writeCodeLink(const char *ref, const char *file, |
|
83 const char *anchor,const char *name, |
|
84 const char *tooltip); |
|
85 void startTextLink(const char *f,const char *anchor); |
|
86 void endTextLink(); |
|
87 void startHtmlLink(const char *url); |
|
88 void endHtmlLink(); |
|
89 void startTypewriter() { t << "{\\f2 "; } |
|
90 void endTypewriter() { t << "}"; } |
|
91 void startGroupHeader(); |
|
92 void endGroupHeader(); |
|
93 //void writeListItem(); |
|
94 void startItemListItem(); |
|
95 void endItemListItem(); |
|
96 |
|
97 void startMemberSections() {} |
|
98 void endMemberSections() {} |
|
99 void startMemberHeader() { startGroupHeader(); } |
|
100 void endMemberHeader() { endGroupHeader(); } |
|
101 void startMemberSubtitle(); |
|
102 void endMemberSubtitle(); |
|
103 void startMemberDocList() {} |
|
104 void endMemberDocList() {} |
|
105 void startMemberList(); |
|
106 void endMemberList(); |
|
107 void startAnonTypeScope(int) {} |
|
108 void endAnonTypeScope(int) {} |
|
109 void startMemberItem(int); |
|
110 void endMemberItem(); |
|
111 void startMemberTemplateParams() {} |
|
112 void endMemberTemplateParams() {} |
|
113 void insertMemberAlign(bool) {} |
|
114 |
|
115 void writeRuler() { rtfwriteRuler_thin(); } |
|
116 |
|
117 void writeAnchor(const char *fileName,const char *name); |
|
118 void startCodeFragment(); |
|
119 void endCodeFragment(); |
|
120 void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; } |
|
121 void startCodeLine() { col=0; } |
|
122 void endCodeLine() { lineBreak(); } |
|
123 void startEmphasis() { t << "{\\i "; } |
|
124 void endEmphasis() { t << "}"; } |
|
125 void startBold() { t << "{\\b "; } |
|
126 void endBold() { t << "}"; } |
|
127 void startDescription(); |
|
128 void endDescription(); |
|
129 void startDescItem(); |
|
130 void endDescItem(); |
|
131 void lineBreak(const char *style=0); |
|
132 void startMemberDoc(const char *,const char *,const char *,const char *); |
|
133 void endMemberDoc(bool); |
|
134 void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *); |
|
135 void endDoxyAnchor(const char *,const char *); |
|
136 void startCodeAnchor(const char *) {}; |
|
137 void endCodeAnchor() {}; |
|
138 void writeChar(char c); |
|
139 void writeLatexSpacing() {};//{ t << "\\hspace{0.3cm}"; } |
|
140 void writeStartAnnoItem(const char *type,const char *file, |
|
141 const char *path,const char *name); |
|
142 void writeEndAnnoItem(const char *name); |
|
143 void startSubsection(); |
|
144 void endSubsection(); |
|
145 void startSubsubsection(); |
|
146 void endSubsubsection(); |
|
147 void startCenter() { t << "{\\qc" << endl; } |
|
148 void endCenter() { t << "}"; } |
|
149 void startSmall() { t << "{\\sub "; } |
|
150 void endSmall() { t << "}"; } |
|
151 |
|
152 void startMemberDescription(); |
|
153 void endMemberDescription(); |
|
154 void startDescList(SectionTypes); |
|
155 void startSimpleSect(SectionTypes,const char *,const char *,const char *); |
|
156 void endSimpleSect(); |
|
157 void startParamList(ParamListTypes,const char *); |
|
158 void endParamList(); |
|
159 //void writeDescItem(); |
|
160 void startDescForItem(); |
|
161 void endDescForItem(); |
|
162 void startSection(const char *,const char *,SectionInfo::SectionType); |
|
163 void endSection(const char *,SectionInfo::SectionType); |
|
164 void addIndexItem(const char *,const char *); |
|
165 void startIndent(); |
|
166 void endIndent(); |
|
167 void writeSynopsis() {} |
|
168 void startClassDiagram(); |
|
169 void endClassDiagram(const ClassDiagram &,const char *filename,const char *name); |
|
170 void startPageRef(); |
|
171 void endPageRef(const char *,const char *); |
|
172 void startQuickIndices() {} |
|
173 void endQuickIndices() {} |
|
174 void writeQuickLinks(bool,HighlightedItem) {} |
|
175 void startContents() {} |
|
176 void endContents() {} |
|
177 void writeNonBreakableSpace(int); |
|
178 |
|
179 void startDescTable(); |
|
180 void endDescTable(); |
|
181 void startDescTableTitle(); |
|
182 void endDescTableTitle(); |
|
183 void startDescTableData(); |
|
184 void endDescTableData(); |
|
185 |
|
186 void startDotGraph(); |
|
187 void endDotGraph(const DotClassGraph &); |
|
188 void startInclDepGraph(); |
|
189 void endInclDepGraph(const DotInclDepGraph &); |
|
190 void startGroupCollaboration(); |
|
191 void endGroupCollaboration(const DotGroupCollaboration &g); |
|
192 void startCallGraph(); |
|
193 void endCallGraph(const DotCallGraph &); |
|
194 void startDirDepGraph(); |
|
195 void endDirDepGraph(const DotDirDeps &g); |
|
196 void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {} |
|
197 |
|
198 void startMemberGroupHeader(bool); |
|
199 void endMemberGroupHeader(); |
|
200 void startMemberGroupDocs(); |
|
201 void endMemberGroupDocs(); |
|
202 void startMemberGroup(); |
|
203 void endMemberGroup(bool); |
|
204 |
|
205 void startTextBlock(bool dense); |
|
206 void endTextBlock(bool); |
|
207 void lastIndexPage(); |
|
208 |
|
209 void startMemberDocPrefixItem() {} |
|
210 void endMemberDocPrefixItem() {} |
|
211 void startMemberDocName(bool) {} |
|
212 void endMemberDocName() {} |
|
213 void startParameterType(bool,const char *); |
|
214 void endParameterType() {} |
|
215 void startParameterName(bool) {} |
|
216 void endParameterName(bool,bool,bool) {} |
|
217 void startParameterList(bool) {} |
|
218 void endParameterList() {} |
|
219 |
|
220 void startConstraintList(const char *); |
|
221 void startConstraintParam(); |
|
222 void endConstraintParam(); |
|
223 void startConstraintType(); |
|
224 void endConstraintType(); |
|
225 void startConstraintDocs(); |
|
226 void endConstraintDocs(); |
|
227 void endConstraintList(); |
|
228 |
|
229 |
|
230 void startFontClass(const char *) {} |
|
231 void endFontClass() {} |
|
232 |
|
233 void writeCodeAnchor(const char *) {} |
|
234 void linkableSymbol(int,const char *,Definition *,Definition *) {} |
|
235 |
|
236 static bool preProcessFileInplace(const char *path,const char *name); |
|
237 |
|
238 private: |
|
239 RTFGenerator(const RTFGenerator &); |
|
240 RTFGenerator &operator=(const RTFGenerator &); |
|
241 |
|
242 const char *rtf_BList_DepthStyle(); |
|
243 const char *rtf_CList_DepthStyle(); |
|
244 const char *rtf_EList_DepthStyle(); |
|
245 const char *rtf_LCList_DepthStyle(); |
|
246 const char *rtf_DList_DepthStyle(); |
|
247 const char *rtf_Code_DepthStyle(); |
|
248 void incrementIndentLevel(); |
|
249 void decrementIndentLevel(); |
|
250 int col; |
|
251 |
|
252 bool m_bstartedBody; // has startbody been called yet? |
|
253 int m_listLevel; // // RTF does not really have a addative indent...manually set list level. |
|
254 bool m_omitParagraph; // should a the next paragraph command be ignored? |
|
255 int m_numCols; // number of columns in a table |
|
256 QCString relPath; |
|
257 |
|
258 void beginRTFDocument(); |
|
259 void beginRTFChapter(); |
|
260 void beginRTFSection(); |
|
261 void rtfwriteRuler_doubleline(); |
|
262 void rtfwriteRuler_emboss(); |
|
263 void rtfwriteRuler_thick(); |
|
264 void rtfwriteRuler_thin(); |
|
265 void writeRTFReference(const char *label); |
|
266 //char *getMultiByte(int c); |
|
267 }; |
|
268 |
|
269 #endif |