doxygen
outputgen.h
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 OUTPUTGEN_H
19 #define OUTPUTGEN_H
20 
21 #include <memory>
22 #include <stack>
23 #include <iostream>
24 #include <fstream>
25 
26 #include "types.h"
27 #include "index.h"
28 #include "section.h"
29 #include "textstream.h"
30 
31 class ClassDiagram;
32 class DotClassGraph;
33 class DotInclDepGraph;
34 class DotCallGraph;
35 class DotDirDeps;
38 class DocNode;
39 class MemberDef;
40 class Definition;
41 
43 {
44  QCString name;
45  QCString ref;
46  QCString url;
47  QCString anchor;
48 };
49 
51 {
52  QCString file;
53  int line;
54  QCString ref;
55  QCString url;
56  QCString anchor;
57 };
58 
62 {
63  public:
64  virtual ~CodeOutputInterface() {}
66  CodeOutputInterface(const CodeOutputInterface &) = delete;
67  CodeOutputInterface &operator=(const CodeOutputInterface &) = delete;
68 
70  virtual int id() const { return 0; }
71 
76  virtual void codify(const QCString &s) = 0;
77 
89  virtual void writeCodeLink(CodeSymbolType type,
90  const QCString &ref,const QCString &file,
91  const QCString &anchor,const QCString &name,
92  const QCString &tooltip) = 0;
93 
101  virtual void writeLineNumber(const QCString &ref,const QCString &file,
102  const QCString &anchor,int lineNumber, bool writeLineAnchor) = 0;
103 
112  virtual void writeTooltip(const QCString &id,
113  const DocLinkInfo &docInfo,
114  const QCString &decl,
115  const QCString &desc,
116  const SourceLinkInfo &defInfo,
117  const SourceLinkInfo &declInfo
118  ) = 0;
119 
120  virtual void startCodeLine(bool hasLineNumbers) = 0;
121 
123  virtual void endCodeLine() = 0;
124 
129  virtual void startFontClass(const QCString &clsName) = 0;
130 
132  virtual void endFontClass() = 0;
133 
137  virtual void writeCodeAnchor(const QCString &name) = 0;
138 
139  virtual void setCurrentDoc(const Definition *context,const QCString &anchor,bool isSourceFile) = 0;
140  virtual void addWord(const QCString &word,bool hiPriority) = 0;
141 
148  virtual void startCodeFragment(const QCString &style) = 0;
150  virtual void endCodeFragment(const QCString &style) = 0;
151 };
152 
162 {
163  public:
164  virtual ~BaseOutputDocInterface() {}
165  enum ParamListTypes { Param, RetVal, Exception };
166  enum SectionTypes { /*See, Return, Author, Version,
167  Since, Date, Bug, Note,
168  Warning, Par, Deprecated, Pre,
169  Post, Invar, Remark, Attention,
170  Todo, Test, RCS, */
171  EnumValues,
172  Examples
173  };
174 
175  virtual void parseText(const QCString &) {}
176 
180  virtual void startItemList() = 0;
181 
185  virtual void startItemListItem() = 0;
186 
190  virtual void endItemListItem() = 0;
191 
193  virtual void endItemList() = 0;
194 
198  virtual void docify(const QCString &s) = 0;
199 
203  virtual void writeChar(char c) = 0;
204 
208  virtual void writeString(const QCString &text) = 0;
209 
211  //virtual void newParagraph() = 0;
212 
214  virtual void startParagraph(const QCString &classDef) = 0;
216  virtual void endParagraph() = 0;
217 
226  virtual void writeObjectLink(const QCString &ref,const QCString &file,
227  const QCString &anchor, const QCString &name) = 0;
228 
229 
233  virtual void startHtmlLink(const QCString &url) = 0;
234 
237  virtual void endHtmlLink() = 0;
238 
239 
243  virtual void startBold() = 0;
244 
246  virtual void endBold() = 0;
247 
251  virtual void startTypewriter() = 0;
252 
254  virtual void endTypewriter() = 0;
255 
259  virtual void startEmphasis() = 0;
260 
262  virtual void endEmphasis() = 0;
263 
265  virtual void writeRuler() = 0;
266 
270  virtual void startDescription() = 0;
271 
273  virtual void endDescription() = 0;
274 
276  virtual void startDescItem() = 0;
277 
278  virtual void startDescForItem() = 0;
279  virtual void endDescForItem() = 0;
280 
284  virtual void endDescItem() = 0;
285 
286  virtual void startCenter() = 0;
287  virtual void endCenter() = 0;
288  virtual void startSmall() = 0;
289  virtual void endSmall() = 0;
290 
291  virtual void startExamples() = 0;
292  virtual void endExamples() = 0;
293  virtual void startParamList(ParamListTypes t,const QCString &title) = 0;
294  virtual void endParamList() = 0;
295 
296  //virtual void writeDescItem() = 0;
297  virtual void startTitle() = 0;
298  virtual void endTitle() = 0;
299 
300  virtual void writeAnchor(const QCString &fileName,const QCString &name) = 0;
301  virtual void startSection(const QCString &,const QCString &,SectionType) = 0;
302  virtual void endSection(const QCString &,SectionType) = 0;
303 
304  virtual void lineBreak(const QCString &style) = 0;
305  virtual void addIndexItem(const QCString &s1,const QCString &s2) = 0;
306 
307  virtual void writeNonBreakableSpace(int) = 0;
308  virtual void startDescTable(const QCString &title) = 0;
309  virtual void endDescTable() = 0;
310  virtual void startDescTableRow() = 0;
311  virtual void endDescTableRow() = 0;
312  virtual void startDescTableTitle() = 0;
313  virtual void endDescTableTitle() = 0;
314  virtual void startDescTableData() = 0;
315  virtual void endDescTableData() = 0;
316  virtual void startTextLink(const QCString &file,const QCString &anchor) = 0;
317  virtual void endTextLink() = 0;
318  virtual void startPageRef() = 0;
319  virtual void endPageRef(const QCString &,const QCString &) = 0;
320  virtual void startSubsection() = 0;
321  virtual void endSubsection() = 0;
322  virtual void startSubsubsection() = 0;
323  virtual void endSubsubsection() = 0;
324 };
325 
331 {
332  public:
333  enum OutputType { Html, Latex, Man, RTF, XML, DEF, Perl , Docbook};
334 
335  OutputGenerator(const QCString &dir);
337  OutputGenerator &operator=(const OutputGenerator &o);
338  virtual ~OutputGenerator();
339 
340  virtual OutputType type() const = 0;
341  virtual std::unique_ptr<OutputGenerator> clone() const = 0;
342 
344  // generic generator methods
346  void enable();
347  void disable();
348  void enableIf(OutputType o);
349  void disableIf(OutputType o);
350  void disableIfNot(OutputType o);
351  bool isEnabled(OutputType o);
352  OutputGenerator *get(OutputType o);
353  QCString dir() const;
354  QCString fileName() const;
355 
356  void startPlainFile(const QCString &name);
357  void endPlainFile();
358  //QCString getContents() const;
359  bool isEnabled() const { return m_active; }
360  void pushGeneratorState();
361  void popGeneratorState();
362  //void setEncoding(const QCString &enc) { encoding = enc; }
363  //virtual void postProcess(QByteArray &) { }
364 
365  virtual void writeDoc(DocNode *,const Definition *ctx,const MemberDef *md,int id) = 0;
366 
368  // structural output interface
370  virtual void startFile(const QCString &name,const QCString &manName,
371  const QCString &title,int id=0) = 0;
372  virtual void writeSearchInfo() = 0;
373  virtual void writeFooter(const QCString &navPath) = 0;
374  virtual void endFile() = 0;
375  virtual void startIndexSection(IndexSections) = 0;
376  virtual void endIndexSection(IndexSections) = 0;
377  virtual void writePageLink(const QCString &,bool) = 0;
378  virtual void startProjectNumber() = 0;
379  virtual void endProjectNumber() = 0;
380  virtual void writeStyleInfo(int part) = 0;
381  virtual void startTitleHead(const QCString &) = 0;
382  virtual void endTitleHead(const QCString &fileName,const QCString &name) = 0;
383  virtual void startIndexListItem() = 0;
384  virtual void endIndexListItem() = 0;
385  virtual void startIndexList() = 0;
386  virtual void endIndexList() = 0;
387  virtual void startIndexKey() = 0;
388  virtual void endIndexKey() = 0;
389  virtual void startIndexValue(bool) = 0;
390  virtual void endIndexValue(const QCString &,bool) = 0;
391  virtual void startIndexItem(const QCString &ref,const QCString &file) = 0;
392  virtual void endIndexItem(const QCString &ref,const QCString &file) = 0;
393  virtual void startGroupHeader(int) = 0;
394  virtual void endGroupHeader(int) = 0;
395  virtual void startMemberSections() = 0;
396  virtual void endMemberSections() = 0;
397  virtual void startHeaderSection() = 0;
398  virtual void endHeaderSection() = 0;
399  virtual void startMemberHeader(const QCString &anchor, int typ) = 0;
400  virtual void endMemberHeader() = 0;
401  virtual void startMemberSubtitle() = 0;
402  virtual void endMemberSubtitle() = 0;
403  virtual void startMemberDocList() = 0;
404  virtual void endMemberDocList() = 0;
405  virtual void startMemberList() = 0;
406  virtual void endMemberList() = 0;
407  virtual void startInlineHeader() = 0;
408  virtual void endInlineHeader() = 0;
409  virtual void startAnonTypeScope(int) = 0;
410  virtual void endAnonTypeScope(int) = 0;
411  virtual void startMemberItem(const QCString &,int,const QCString &) = 0;
412  virtual void endMemberItem() = 0;
413  virtual void startMemberTemplateParams() = 0;
414  virtual void endMemberTemplateParams(const QCString &,const QCString &) = 0;
415  virtual void startCompoundTemplateParams() = 0;
416  virtual void endCompoundTemplateParams() = 0;
417  virtual void startMemberGroupHeader(bool) = 0;
418  virtual void endMemberGroupHeader() = 0;
419  virtual void startMemberGroupDocs() = 0;
420  virtual void endMemberGroupDocs() = 0;
421  virtual void startMemberGroup() = 0;
422  virtual void endMemberGroup(bool) = 0;
423  virtual void insertMemberAlign(bool) = 0;
424  virtual void insertMemberAlignLeft(int,bool) = 0;
425  virtual void startMemberDoc(const QCString &,const QCString &,
426  const QCString &,const QCString &,int,int,bool) = 0;
427  virtual void endMemberDoc(bool) = 0;
428  virtual void startDoxyAnchor(const QCString &fName,const QCString &manName,
429  const QCString &anchor,const QCString &name,
430  const QCString &args) = 0;
431  virtual void endDoxyAnchor(const QCString &fileName,const QCString &anchor) = 0;
432  virtual void writeLatexSpacing() = 0;
433  virtual void writeStartAnnoItem(const QCString &type,const QCString &file,
434  const QCString &path,const QCString &name) = 0;
435  virtual void writeEndAnnoItem(const QCString &name) = 0;
436  virtual void startMemberDescription(const QCString &anchor,const QCString &inheritId, bool typ) = 0;
437  virtual void endMemberDescription() = 0;
438  virtual void startMemberDeclaration() = 0;
439  virtual void endMemberDeclaration(const QCString &anchor,const QCString &inheritId) = 0;
440  virtual void writeInheritedSectionTitle(const QCString &id,const QCString &ref,
441  const QCString &file,const QCString &anchor,
442  const QCString &title,const QCString &name) = 0;
443  virtual void startIndent() = 0;
444  virtual void endIndent() = 0;
445  virtual void writeSynopsis() = 0;
446  virtual void startClassDiagram() = 0;
447  virtual void endClassDiagram(const ClassDiagram &,const QCString &,const QCString &) = 0;
448  virtual void startDotGraph() = 0;
449  virtual void endDotGraph(DotClassGraph &g) = 0;
450  virtual void startInclDepGraph() = 0;
451  virtual void endInclDepGraph(DotInclDepGraph &g) = 0;
452  virtual void startGroupCollaboration() = 0;
453  virtual void endGroupCollaboration(DotGroupCollaboration &g) = 0;
454  virtual void startCallGraph() = 0;
455  virtual void endCallGraph(DotCallGraph &g) = 0;
456  virtual void startDirDepGraph() = 0;
457  virtual void endDirDepGraph(DotDirDeps &g) = 0;
458  virtual void writeGraphicalHierarchy(DotGfxHierarchyTable &g) = 0;
459  virtual void startQuickIndices() = 0;
460  virtual void endQuickIndices() = 0;
461  virtual void writeSplitBar(const QCString &) = 0;
462  virtual void writeNavigationPath(const QCString &) = 0;
463  virtual void writeLogo() = 0;
464  virtual void writeQuickLinks(bool compact,HighlightedItem hli,const QCString &file) = 0;
465  virtual void writeSummaryLink(const QCString &file,const QCString &anchor,const QCString &title,bool first) = 0;
466  virtual void startContents() = 0;
467  virtual void endContents() = 0;
468  virtual void startPageDoc(const QCString &) {}
469  virtual void endPageDoc() {}
470  virtual void startTextBlock(bool) = 0;
471  virtual void endTextBlock(bool) = 0;
472  virtual void lastIndexPage() = 0;
473  virtual void startMemberDocPrefixItem() = 0;
474  virtual void endMemberDocPrefixItem() = 0;
475  virtual void startMemberDocName(bool) = 0;
476  virtual void endMemberDocName() = 0;
477  virtual void startParameterType(bool,const QCString &key) = 0;
478  virtual void endParameterType() = 0;
479  virtual void startParameterName(bool) = 0;
480  virtual void endParameterName(bool,bool,bool) = 0;
481  virtual void startParameterList(bool) = 0;
482  virtual void endParameterList() = 0;
483  virtual void exceptionEntry(const QCString &,bool) = 0;
484 
485  virtual void startConstraintList(const QCString &) = 0;
486  virtual void startConstraintParam() = 0;
487  virtual void endConstraintParam() = 0;
488  virtual void startConstraintType() = 0;
489  virtual void endConstraintType() = 0;
490  virtual void startConstraintDocs() = 0;
491  virtual void endConstraintDocs() = 0;
492  virtual void endConstraintList() = 0;
493 
494  virtual void startMemberDocSimple(bool) = 0;
495  virtual void endMemberDocSimple(bool) = 0;
496  virtual void startInlineMemberType() = 0;
497  virtual void endInlineMemberType() = 0;
498  virtual void startInlineMemberName() = 0;
499  virtual void endInlineMemberName() = 0;
500  virtual void startInlineMemberDoc() = 0;
501  virtual void endInlineMemberDoc() = 0;
502 
503 
504  virtual void startLabels() = 0;
505  virtual void writeLabel(const QCString &,bool) = 0;
506  virtual void endLabels() = 0;
507 
508  virtual void cleanup() = 0;
509 
510  protected:
511  TextStream m_t;
512  private:
513  QCString m_dir;
514  QCString m_fileName;
515  FILE *m_file;
516  bool m_active = true;
517  std::stack<bool> m_genStack;
518 };
519 
528 {
529  public:
530  virtual ~OutputDocInterface() {}
531 
535  virtual void disableAllBut(OutputGenerator::OutputType o) = 0;
536 
540  virtual void enableAll() = 0;
541 
543  virtual void disableAll()= 0;
544 
546  virtual void disable(OutputGenerator::OutputType o) = 0;
547 
549  virtual void enable(OutputGenerator::OutputType o) = 0;
550 
554  virtual bool isEnabled(OutputGenerator::OutputType o) = 0;
555 
559  //virtual void append(const OutputDocInterface *g) = 0;
560 
564  virtual void pushGeneratorState() = 0;
565 
570  virtual void popGeneratorState() = 0;
571 };
572 
573 #endif
This file contains a number of basic enums and types.
The common base class of all entity definitions found in the sources.
Definition: definition.h:76
A model of a class/file/namespace member symbol.
Definition: memberdef.h:45
Base Interface used for generating output outside of the comment blocks.
Definition: outputgen.h:161
Text streaming class that buffers data.
Definition: textstream.h:33
Interface used for generating documentation.
Definition: outputgen.h:527
Represents a graphical class hierarchy.
Definition: dotgfxhierarchytable.h:31
virtual int id() const
Identifier for the output file.
Definition: outputgen.h:70
Representation of a group collaboration graph.
Definition: dotgroupcollaboration.h:28
Class representing a built-in class diagram.
Definition: diagram.h:29
Representation of an call graph.
Definition: dotcallgraph.h:26
Representation of a class inheritance or dependency graph.
Definition: dotclassgraph.h:28
Abstract node interface with type information.
Definition: docparser.h:96
Abstract output generator.
Definition: outputgen.h:330
Representation of an include dependency graph.
Definition: dotincldepgraph.h:30
Representation of an directory dependency graph.
Definition: dotdirdeps.h:25
This is an alternative implementation of QCString.
Definition: qcstring.h:108
Output interface for code parser.
Definition: outputgen.h:61
Definition: outputgen.h:50
Definition: outputgen.h:42