outputgen.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * $Id: outputgen.h,v 1.48 2001/03/19 19:27:41 root Exp $
00004  *
00005  * Copyright (C) 1997-2008 by Dimitri van Heesch.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and its
00008  * documentation under the terms of the GNU General Public License is hereby 
00009  * granted. No representations are made about the suitability of this software 
00010  * for any purpose. It is provided "as is" without express or implied warranty.
00011  * See the GNU General Public License for more details.
00012  *
00013  * Documents produced by Doxygen are derivative works derived from the
00014  * input used in their production; they are not affected by this license.
00015  *
00016  */
00017 
00018 #ifndef OUTPUTGEN_H
00019 #define OUTPUTGEN_H
00020 
00021 #include "qtbc.h"
00022 #include <qtextstream.h>
00023 #include <qbuffer.h>
00024 #include <qfile.h>
00025 #include <qstack.h>
00026 #include "index.h"
00027 #include "section.h"
00028 
00029 class ClassDiagram;
00030 class DotClassGraph;
00031 class DotInclDepGraph;
00032 class DotCallGraph;
00033 class DotDirDeps;
00034 class DotGfxHierarchyTable;
00035 class DotGroupCollaboration;
00036 class DocNode;
00037 class MemberDef;
00038 class GroupDef;
00039 class Definition;
00040 
00043 class CodeOutputInterface
00044 {
00045   public:
00046     virtual ~CodeOutputInterface() {}
00051     virtual void codify(const char *s) = 0;
00052 
00062     virtual void writeCodeLink(const char *ref,const char *file,
00063                                const char *anchor,const char *name,
00064                                const char *tooltip) = 0;
00065 
00066     virtual void writeLineNumber(const char *ref,const char *file,
00067                                  const char *anchor,int lineNumber) = 0;
00068     virtual void startCodeLine() = 0;
00069     virtual void endCodeLine() = 0;
00070     virtual void startCodeAnchor(const char *label) = 0;
00071     virtual void endCodeAnchor() = 0;
00072     virtual void startFontClass(const char *) = 0;
00073     virtual void endFontClass() = 0;
00074     virtual void writeCodeAnchor(const char *name) = 0;
00075     virtual void linkableSymbol(int line,const char *symName,
00076                  Definition *symDef,Definition *context) = 0;
00077 };
00078 
00087 class BaseOutputDocInterface : public CodeOutputInterface
00088 {
00089   public:
00090     virtual ~BaseOutputDocInterface() {}
00091     enum ParamListTypes { Param, RetVal, Exception };
00092     enum SectionTypes { /*See, Return, Author, Version, 
00093                         Since, Date, Bug, Note,
00094                         Warning, Par, Deprecated, Pre, 
00095                         Post, Invar, Remark, Attention, 
00096                         Todo, Test, RCS, */ EnumValues, 
00097                         Examples 
00098                       };
00099 
00100     virtual void parseDoc(const char *,int, const char *,MemberDef *,
00101                           const QCString &,bool)  {} 
00102     virtual void parseText(const QCString &)  {}
00103     
00107     virtual void startItemList()  = 0;
00108 
00112     virtual void writeListItem()  = 0;
00113 
00115     virtual void endItemList()    = 0;
00116 
00120     virtual void docify(const char *s) = 0;
00121 
00125     virtual void writeChar(char c) = 0;
00126 
00130     virtual void writeString(const char *text) = 0;
00131 
00133     virtual void newParagraph()   = 0;
00134 
00136     virtual void startParagraph() = 0;
00138     virtual void endParagraph() = 0;
00139 
00148     virtual void writeObjectLink(const char *ref,const char *file,
00149                                  const char *anchor, const char *name) = 0;
00150 
00151 
00155     virtual void startHtmlLink(const char *url) = 0;
00156 
00159     virtual void endHtmlLink() = 0;
00160 
00161     
00165     virtual void startBold()      = 0;
00166 
00168     virtual void endBold()        = 0;
00169 
00173     virtual void startTypewriter() = 0;
00174 
00176     virtual void endTypewriter() = 0;
00177 
00181     virtual void startEmphasis() = 0;
00182 
00184     virtual void endEmphasis() = 0;
00185 
00191     virtual void startCodeFragment() = 0;
00192 
00195     virtual void endCodeFragment() = 0;
00196 
00197     
00198 
00199     
00201     virtual void writeRuler() = 0;
00202     
00206     virtual void startDescription() = 0;
00207 
00209     virtual void endDescription() = 0;
00210 
00212     virtual void startDescItem() = 0;
00213 
00217     virtual void endDescItem() = 0;
00218 
00219     virtual void startCenter() = 0;
00220     virtual void endCenter() = 0;
00221     virtual void startSmall() = 0;
00222     virtual void endSmall() = 0;
00223 
00224     virtual void startSimpleSect(SectionTypes t,const char *file,
00225                                  const char *anchor,const char *title) = 0;
00226     virtual void endSimpleSect() = 0;
00227     virtual void startParamList(ParamListTypes t,const char *title) = 0;
00228     virtual void endParamList() = 0;
00229 
00230     virtual void writeDescItem() = 0;
00231     virtual void startTitle() = 0;
00232     virtual void endTitle()   = 0;
00233 
00234     virtual void writeAnchor(const char *fileName,const char *name) = 0;
00235     virtual void startSection(const char *,const char *,SectionInfo::SectionType) = 0;
00236     virtual void endSection(const char *,SectionInfo::SectionType) = 0;
00237 
00238     virtual void lineBreak() = 0;
00239     virtual void addIndexItem(const char *s1,const char *s2) = 0;
00240 
00241     virtual void writeNonBreakableSpace(int) = 0;
00242     virtual void startDescTable() = 0;
00243     virtual void endDescTable() = 0;
00244     virtual void startDescTableTitle() = 0;
00245     virtual void endDescTableTitle() = 0;
00246     virtual void startDescTableData() = 0;
00247     virtual void endDescTableData() = 0;
00248     virtual void startTextLink(const char *file,const char *anchor) = 0;
00249     virtual void endTextLink() = 0;
00250     virtual void startPageRef() = 0;
00251     virtual void endPageRef(const char *,const char *) = 0;
00252     virtual void startSubsection() = 0;
00253     virtual void endSubsection() = 0;
00254     virtual void startSubsubsection() = 0;
00255     virtual void endSubsubsection() = 0;
00256 };
00257 
00262 class OutputGenerator : public BaseOutputDocInterface
00263 {
00264   public:
00265     enum OutputType { Html, Latex, Man, RTF, XML, DEF, Perl };
00266 
00267     OutputGenerator();
00268     virtual ~OutputGenerator();
00269 
00271     // generic generator methods
00273     virtual void enable() = 0;
00274     virtual void disable() = 0;
00275     virtual void enableIf(OutputType o) = 0;
00276     virtual void disableIf(OutputType o) = 0;
00277     virtual void disableIfNot(OutputType o) = 0;
00278     virtual bool isEnabled(OutputType o) = 0;
00279     virtual OutputGenerator *get(OutputType o) = 0;
00280     void startPlainFile(const char *name);
00281     void endPlainFile();
00282     QCString getContents() const;
00283     bool isEnabled() const { return active; }
00284     void pushGeneratorState();
00285     void popGeneratorState();
00286     void setEncoding(const QCString &enc) { encoding = enc; }
00287     virtual void postProcess(QByteArray &) { }
00288 
00289     virtual void printDoc(DocNode *,const char *langExt) = 0;
00290 
00292     // structural output interface
00294     virtual void startFile(const char *name,const char *manName,
00295                            const char *title) = 0;
00296     virtual void writeFooter() = 0;
00297     virtual void endFile() = 0;
00298     virtual void startIndexSection(IndexSections) = 0;
00299     virtual void endIndexSection(IndexSections) = 0;
00300     virtual void writePageLink(const char *,bool) = 0;
00301     virtual void startProjectNumber() = 0;
00302     virtual void endProjectNumber() = 0;
00303     virtual void writeStyleInfo(int part) = 0;
00304     virtual void startTitleHead(const char *) = 0;
00305     virtual void endTitleHead(const char *fileName,const char *name) = 0;
00306     virtual void startIndexList() = 0;
00307     virtual void endIndexList()   = 0;
00308     virtual void startIndexKey() = 0;
00309     virtual void endIndexKey()   = 0;
00310     virtual void startIndexValue(bool) = 0;
00311     virtual void endIndexValue(const char *,bool) = 0;
00312     virtual void startIndexItem(const char *ref,const char *file) = 0;
00313     virtual void endIndexItem(const char *ref,const char *file) = 0;
00314     virtual void startGroupHeader() = 0;
00315     virtual void endGroupHeader() = 0;
00316     virtual void startMemberSections() = 0;
00317     virtual void endMemberSections() = 0;
00318     virtual void startMemberHeader() = 0;
00319     virtual void endMemberHeader() = 0;
00320     virtual void startMemberSubtitle() = 0;
00321     virtual void endMemberSubtitle() = 0;
00322     virtual void startMemberDocList() = 0;
00323     virtual void endMemberDocList() = 0;
00324     virtual void startMemberList() = 0;
00325     virtual void endMemberList() = 0;
00326     virtual void startAnonTypeScope(int) = 0;
00327     virtual void endAnonTypeScope(int) = 0;
00328     virtual void startMemberItem(int) = 0;
00329     virtual void endMemberItem() = 0;
00330     virtual void startMemberTemplateParams() = 0;
00331     virtual void endMemberTemplateParams() = 0;
00332     virtual void startMemberGroupHeader(bool) = 0;
00333     virtual void endMemberGroupHeader() = 0;
00334     virtual void startMemberGroupDocs() = 0;
00335     virtual void endMemberGroupDocs() = 0;
00336     virtual void startMemberGroup() = 0;
00337     virtual void endMemberGroup(bool) = 0;
00338     virtual void insertMemberAlign(bool) = 0;
00339     virtual void startMemberDoc(const char *,const char *,
00340                                 const char *,const char *) = 0;
00341     virtual void endMemberDoc(bool) = 0;
00342     virtual void startDoxyAnchor(const char *fName,const char *manName,
00343                                  const char *anchor,const char *name,
00344                                  const char *args) = 0;
00345     virtual void endDoxyAnchor(const char *fileName,const char *anchor) = 0;
00346     virtual void writeLatexSpacing() = 0;
00347     virtual void writeStartAnnoItem(const char *type,const char *file,
00348                                     const char *path,const char *name) = 0;
00349     virtual void writeEndAnnoItem(const char *name) = 0;
00350     virtual void startMemberDescription() = 0;
00351     virtual void endMemberDescription() = 0;
00352     virtual void startIndent() = 0;
00353     virtual void endIndent() = 0;
00354     virtual void writeSynopsis() = 0;
00355     virtual void startClassDiagram() = 0;
00356     virtual void endClassDiagram(const ClassDiagram &,const char *,const char *) = 0;
00357     virtual void startDotGraph() = 0;
00358     virtual void endDotGraph(const DotClassGraph &g) = 0;
00359     virtual void startInclDepGraph() = 0;
00360     virtual void endInclDepGraph(const DotInclDepGraph &g) = 0;
00361     virtual void startGroupCollaboration() = 0;
00362     virtual void endGroupCollaboration(const DotGroupCollaboration &g) = 0;
00363     virtual void startCallGraph() = 0;
00364     virtual void endCallGraph(const DotCallGraph &g) = 0;
00365     virtual void startDirDepGraph() = 0;
00366     virtual void endDirDepGraph(const DotDirDeps &g) = 0;
00367     virtual void writeGraphicalHierarchy(const DotGfxHierarchyTable &g) = 0;
00368     virtual void startQuickIndices() = 0;
00369     virtual void endQuickIndices() = 0;
00370     virtual void writeQuickLinks(bool compact,HighlightedItem hli) = 0;
00371     virtual void startContents() = 0;
00372     virtual void endContents() = 0;
00373     virtual void startTextBlock(bool) = 0;
00374     virtual void endTextBlock(bool) = 0;
00375     virtual void lastIndexPage() = 0;
00376     virtual void startMemberDocPrefixItem() = 0;
00377     virtual void endMemberDocPrefixItem() = 0;
00378     virtual void startMemberDocName(bool) = 0;
00379     virtual void endMemberDocName() = 0;
00380     virtual void startParameterType(bool,const char *) = 0;
00381     virtual void endParameterType() = 0;
00382     virtual void startParameterName(bool) = 0;
00383     virtual void endParameterName(bool,bool,bool) = 0;
00384     virtual void startParameterList(bool) = 0;
00385     virtual void endParameterList() = 0;
00386 
00387     virtual void startConstraintList(const char *) = 0;
00388     virtual void startConstraintParam() = 0;
00389     virtual void endConstraintParam() = 0;
00390     virtual void startConstraintType() = 0;
00391     virtual void endConstraintType() = 0;
00392     virtual void startConstraintDocs() = 0;
00393     virtual void endConstraintDocs() = 0;
00394     virtual void endConstraintList() = 0;
00395 
00396   protected:
00397     QTextStream fs;
00398     QByteArray a;
00399     QBuffer b;
00400     QTextStream t;
00401     QFile *file;
00402     QCString dir;
00403     bool active;
00404     QStack<bool> *genStack;
00405     QString encoding;
00406 
00407   private:
00408     OutputGenerator(const OutputGenerator &o);
00409     OutputGenerator &operator=(const OutputGenerator &o);
00410 };
00411 
00419 class OutputDocInterface : public BaseOutputDocInterface
00420 {
00421   public:
00422     virtual ~OutputDocInterface() {}
00423 
00427     //virtual OutputDocInterface *clone() = 0;
00428 
00432     virtual void disableAllBut(OutputGenerator::OutputType o) = 0;
00433 
00437     virtual void enableAll() = 0;
00438 
00440     virtual void disableAll()= 0;
00441 
00443     virtual void disable(OutputGenerator::OutputType o) = 0;
00444 
00446     virtual void enable(OutputGenerator::OutputType o) = 0;
00447 
00451     virtual bool isEnabled(OutputGenerator::OutputType o) = 0;
00452 
00456     //virtual void append(const OutputDocInterface *g) = 0;
00457 
00461     virtual void pushGeneratorState() = 0;
00462 
00467     virtual void popGeneratorState() = 0;
00468 };
00469 
00470 
00471 #endif



Generated on Mon Mar 31 10:58:41 2008 by  doxygen 1.5.1