rtfgen.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *
00003  * $Id: rtfgen.h,v 1.13 2001/03/19 19:27:41 root Exp $
00004  *
00005  * Copyright (C) 1997-2008 by Parker Waechter & 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 RTFGEN_H
00019 #define RTFGEN_H
00020 
00021 #include "outputgen.h"
00022 
00023 class QFile;
00024 
00025 class RTFGenerator : public OutputGenerator
00026 {
00027   public:
00028     RTFGenerator();
00029    ~RTFGenerator();
00030     static void init();
00031     static void writeStyleSheetFile(QFile &f);
00032     static void writeExtensionsFile(QFile &file);
00033 
00034     void enable() 
00035     { if (genStack->top()) active=*genStack->top(); else active=TRUE; }
00036     void disable() { active=FALSE; }
00037     void enableIf(OutputType o)  { if (o==RTF) active=TRUE;  }
00038     void disableIf(OutputType o) { if (o==RTF) active=FALSE; }
00039     void disableIfNot(OutputType o) { if (o!=RTF) active=FALSE; }
00040     bool isEnabled(OutputType o) { return (o==RTF && active); } 
00041     OutputGenerator *get(OutputType o) { return (o==RTF) ? this : 0; }
00042 
00043     void printDoc(DocNode *,const char *);
00044 
00045     void startFile(const char *name,const char *manName,const char *title);
00046     void writeFooter() {}
00047     void endFile();
00048     void clearBuffer();
00049     void postProcess(QByteArray &);
00050     
00051     void startIndexSection(IndexSections);
00052     void endIndexSection(IndexSections);
00053     void writePageLink(const char *,bool);
00054     void startProjectNumber();
00055     void endProjectNumber();
00056     void writeStyleInfo(int part);
00057     void startTitleHead(const char *);
00058     void startTitle();
00059     void endTitleHead(const char *,const char *name);
00060     void endTitle() {} 
00061 
00062     void newParagraph();
00063     void startParagraph();
00064     void endParagraph();
00065     void writeString(const char *text);
00066     void startIndexList();
00067     void endIndexList();
00068     void startIndexKey();
00069     void endIndexKey();
00070     void startIndexValue(bool);
00071     void endIndexValue(const char *,bool);
00072     void startItemList();
00073     void endItemList();
00074     void startIndexItem(const char *ref,const char *file);
00075     void endIndexItem(const char *ref,const char *file);
00076     void docify(const char *text);
00077     void codify(const char *text);
00078     void writeObjectLink(const char *ref,const char *file,
00079                          const char *anchor,const char *name);
00080     void writeCodeLink(const char *ref, const char *file,
00081                        const char *anchor,const char *name,
00082                        const char *tooltip);
00083     void startTextLink(const char *f,const char *anchor);
00084     void endTextLink();
00085     void startHtmlLink(const char *url);
00086     void endHtmlLink();
00087     void startTypewriter() { t << "{\\f2 "; }
00088     void endTypewriter()   { t << "}";      }
00089     void startGroupHeader();
00090     void endGroupHeader();
00091     void writeListItem();
00092 
00093     void startMemberSections() {}
00094     void endMemberSections() {} 
00095     void startMemberHeader() { startGroupHeader(); }
00096     void endMemberHeader() { endGroupHeader(); }
00097     void startMemberSubtitle(); 
00098     void endMemberSubtitle(); 
00099     void startMemberDocList() {}
00100     void endMemberDocList() {}
00101     void startMemberList();
00102     void endMemberList();
00103     void startAnonTypeScope(int) {}
00104     void endAnonTypeScope(int) {}
00105     void startMemberItem(int);
00106     void endMemberItem();
00107     void startMemberTemplateParams() {}
00108     void endMemberTemplateParams() {}
00109     void insertMemberAlign(bool) {}
00110 
00111     void writeRuler() { rtfwriteRuler_thin(); }
00112         
00113     void writeAnchor(const char *fileName,const char *name);
00114     void startCodeFragment();
00115     void endCodeFragment();
00116     void writeLineNumber(const char *,const char *,const char *,int l) { t << l << " "; }
00117     void startCodeLine() { col=0; }
00118     void endCodeLine() { lineBreak(); }
00119     void startEmphasis() { t << "{\\i ";  }
00120     void endEmphasis()   { t << "}"; }
00121     void startBold()     { t << "{\\b "; }
00122     void endBold()       { t << "}"; }
00123     void startDescription();
00124     void endDescription();
00125     void startDescItem();
00126     void endDescItem();
00127     void lineBreak();
00128     void startMemberDoc(const char *,const char *,const char *,const char *);
00129     void endMemberDoc(bool);
00130     void startDoxyAnchor(const char *,const char *,const char *,const char *,const char *);
00131     void endDoxyAnchor(const char *,const char *);
00132     void startCodeAnchor(const char *) {};
00133     void endCodeAnchor() {};
00134     void writeChar(char c);
00135     void writeLatexSpacing() {};//{ t << "\\hspace{0.3cm}"; }
00136     void writeStartAnnoItem(const char *type,const char *file, 
00137                             const char *path,const char *name);
00138     void writeEndAnnoItem(const char *name);
00139     void startSubsection();
00140     void endSubsection();
00141     void startSubsubsection();
00142     void endSubsubsection();
00143     void startCenter()      { t << "{\\qc" << endl; }
00144     void endCenter()        { t << "}"; }
00145     void startSmall()       { t << "{\\sub "; }
00146     void endSmall()         { t << "}"; }
00147 
00148     void startMemberDescription();
00149     void endMemberDescription();
00150     void startDescList(SectionTypes);
00151     void startSimpleSect(SectionTypes,const char *,const char *,const char *);
00152     void endSimpleSect();
00153     void startParamList(ParamListTypes,const char *);
00154     void endParamList();
00155     void writeDescItem();
00156     void startSection(const char *,const char *,SectionInfo::SectionType);
00157     void endSection(const char *,SectionInfo::SectionType);
00158     void addIndexItem(const char *,const char *);
00159     void startIndent();
00160     void endIndent();
00161     void writeSynopsis()     {}
00162     void startClassDiagram();
00163     void endClassDiagram(const ClassDiagram &,const char *filename,const char *name);
00164     void startPageRef();
00165     void endPageRef(const char *,const char *);
00166     void startQuickIndices() {}
00167     void endQuickIndices() {}
00168     void writeQuickLinks(bool,HighlightedItem) {}
00169     void startContents() {}
00170     void endContents() {}
00171     void writeNonBreakableSpace(int);
00172         
00173     void startDescTable();
00174     void endDescTable();
00175     void startDescTableTitle();
00176     void endDescTableTitle();
00177     void startDescTableData();
00178     void endDescTableData();
00179     
00180     void startDotGraph();
00181     void endDotGraph(const DotClassGraph &);
00182     void startInclDepGraph();
00183     void endInclDepGraph(const DotInclDepGraph &);
00184     void startGroupCollaboration();
00185     void endGroupCollaboration(const DotGroupCollaboration &g);
00186     void startCallGraph();
00187     void endCallGraph(const DotCallGraph &);
00188     void startDirDepGraph();
00189     void endDirDepGraph(const DotDirDeps &g);
00190     void writeGraphicalHierarchy(const DotGfxHierarchyTable &) {}
00191 
00192     void startMemberGroupHeader(bool);
00193     void endMemberGroupHeader();
00194     void startMemberGroupDocs();
00195     void endMemberGroupDocs();
00196     void startMemberGroup();
00197     void endMemberGroup(bool);
00198     
00199     void startTextBlock(bool dense);
00200     void endTextBlock(bool);
00201     void lastIndexPage();
00202 
00203     void startMemberDocPrefixItem() {}
00204     void endMemberDocPrefixItem() {}
00205     void startMemberDocName(bool) {}
00206     void endMemberDocName() {}
00207     void startParameterType(bool,const char *);
00208     void endParameterType() {}
00209     void startParameterName(bool) {}
00210     void endParameterName(bool,bool,bool) {}
00211     void startParameterList(bool) {}
00212     void endParameterList() {}
00213 
00214     void startConstraintList(const char  *);
00215     void startConstraintParam();
00216     void endConstraintParam();
00217     void startConstraintType();
00218     void endConstraintType();
00219     void startConstraintDocs();
00220     void endConstraintDocs();
00221     void endConstraintList();
00222 
00223 
00224     void startFontClass(const char *) {}
00225     void endFontClass() {}
00226 
00227     void writeCodeAnchor(const char *) {}
00228     void linkableSymbol(int,const char *,Definition *,Definition *) {}
00229 
00230     static bool preProcessFileInplace(const char *path,const char *name);
00231     
00232   private:
00233     RTFGenerator(const RTFGenerator &);
00234     RTFGenerator &operator=(const RTFGenerator &);
00235 
00236     const char *rtf_BList_DepthStyle();
00237     const char *rtf_CList_DepthStyle();
00238     const char *rtf_EList_DepthStyle();
00239     const char *rtf_LCList_DepthStyle();
00240     const char *rtf_DList_DepthStyle();
00241     const char *rtf_Code_DepthStyle();
00242     void incrementIndentLevel();
00243     void decrementIndentLevel();
00244     int  col;
00245 
00246     bool m_bstartedBody;  // has startbody been called yet?
00247     int  m_listLevel; // // RTF does not really have a addative indent...manually set list level.
00248     bool m_omitParagraph; // should a the next paragraph command be ignored?
00249     int  m_numCols; // number of columns in a table
00250     QCString relPath;
00251 
00252     void beginRTFDocument();
00253     void beginRTFChapter();
00254     void beginRTFSection();
00255     void rtfwriteRuler_doubleline();
00256     void rtfwriteRuler_emboss();
00257     void rtfwriteRuler_thick();
00258     void rtfwriteRuler_thin();
00259     void writeRTFReference(const char *label);
00260     //char *getMultiByte(int c);
00261 };
00262 
00263 #endif



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