Orb/Doxygen/src/htmldocvisitor.h
changeset 3 d8fccb2cd802
parent 0 42188c7ea2d9
child 4 468f4c8d3d5b
equal deleted inserted replaced
2:932c358ece3e 3:d8fccb2cd802
       
     1 /******************************************************************************
       
     2  *
       
     3  * 
       
     4  *
       
     5  *
       
     6  * Copyright (C) 1997-2008 by Dimitri van Heesch.
       
     7  *
       
     8  * Permission to use, copy, modify, and distribute this software and its
       
     9  * documentation under the terms of the GNU General Public License is hereby 
       
    10  * granted. No representations are made about the suitability of this software 
       
    11  * for any purpose. It is provided "as is" without express or implied warranty.
       
    12  * See the GNU General Public License for more details.
       
    13  *
       
    14  * Documents produced by Doxygen are derivative works derived from the
       
    15  * input used in their production; they are not affected by this license.
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef _HTMLDOCVISITOR_H
       
    20 #define _HTMLDOCVISITOR_H
       
    21 
       
    22 #include "docvisitor.h"
       
    23 #include <qstack.h>
       
    24 #include <qcstring.h>
       
    25 
       
    26 class DocNode;
       
    27 class QTextStream;
       
    28 class CodeOutputInterface;
       
    29 class QString;
       
    30 
       
    31 /*! @brief Concrete visitor implementation for HTML output. */
       
    32 class HtmlDocVisitor : public DocVisitor
       
    33 {
       
    34   public:
       
    35     HtmlDocVisitor(QTextStream &t,CodeOutputInterface &ci,const char *langExt);
       
    36     
       
    37     //--------------------------------------
       
    38     // visitor functions for leaf nodes
       
    39     //--------------------------------------
       
    40     
       
    41     void visit(DocWord *);
       
    42     void visit(DocLinkedWord *);
       
    43     void visit(DocWhiteSpace *);
       
    44     void visit(DocSymbol *);
       
    45     void visit(DocURL *);
       
    46     void visit(DocLineBreak *);
       
    47     void visit(DocHorRuler *);
       
    48     void visit(DocStyleChange *);
       
    49     void visit(DocVerbatim *);
       
    50     void visit(DocAnchor *);
       
    51     void visit(DocInclude *);
       
    52     void visit(DocIncOperator *);
       
    53     void visit(DocFormula *);
       
    54     void visit(DocIndexEntry *);
       
    55     void visit(DocSimpleSectSep *);
       
    56 
       
    57     //--------------------------------------
       
    58     // visitor functions for compound nodes
       
    59     //--------------------------------------
       
    60     
       
    61     void visitPre(DocAutoList *);
       
    62     void visitPost(DocAutoList *);
       
    63     void visitPre(DocAutoListItem *);
       
    64     void visitPost(DocAutoListItem *);
       
    65     void visitPre(DocPara *) ;
       
    66     void visitPost(DocPara *);
       
    67     void visitPre(DocRoot *);
       
    68     void visitPost(DocRoot *);
       
    69     void visitPre(DocSimpleSect *);
       
    70     void visitPost(DocSimpleSect *);
       
    71     void visitPre(DocTitle *);
       
    72     void visitPost(DocTitle *);
       
    73     void visitPre(DocSimpleList *);
       
    74     void visitPost(DocSimpleList *);
       
    75     void visitPre(DocSimpleListItem *);
       
    76     void visitPost(DocSimpleListItem *);
       
    77     void visitPre(DocSection *);
       
    78     void visitPost(DocSection *);
       
    79     void visitPre(DocHtmlList *);
       
    80     void visitPost(DocHtmlList *) ;
       
    81     void visitPre(DocHtmlListItem *);
       
    82     void visitPost(DocHtmlListItem *);
       
    83     void visitPre(DocHtmlDescList *);
       
    84     void visitPost(DocHtmlDescList *);
       
    85     void visitPre(DocHtmlDescTitle *);
       
    86     void visitPost(DocHtmlDescTitle *);
       
    87     void visitPre(DocHtmlDescData *);
       
    88     void visitPost(DocHtmlDescData *);
       
    89     void visitPre(DocHtmlTable *);
       
    90     void visitPost(DocHtmlTable *);
       
    91     void visitPre(DocHtmlRow *);
       
    92     void visitPost(DocHtmlRow *) ;
       
    93     void visitPre(DocHtmlCell *);
       
    94     void visitPost(DocHtmlCell *);
       
    95     void visitPre(DocHtmlCaption *);
       
    96     void visitPost(DocHtmlCaption *);
       
    97     void visitPre(DocInternal *);
       
    98     void visitPost(DocInternal *);
       
    99     void visitPre(DocHRef *);
       
   100     void visitPost(DocHRef *);
       
   101     void visitPre(DocHtmlHeader *);
       
   102     void visitPost(DocHtmlHeader *);
       
   103     void visitPre(DocImage *);
       
   104     void visitPost(DocImage *);
       
   105     void visitPre(DocDotFile *);
       
   106     void visitPost(DocDotFile *);
       
   107     void visitPre(DocLink *);
       
   108     void visitPost(DocLink *);
       
   109     void visitPre(DocRef *);
       
   110     void visitPost(DocRef *);
       
   111     void visitPre(DocSecRefItem *);
       
   112     void visitPost(DocSecRefItem *);
       
   113     void visitPre(DocSecRefList *);
       
   114     void visitPost(DocSecRefList *);
       
   115     void visitPre(DocParamSect *);
       
   116     void visitPost(DocParamSect *);
       
   117     void visitPre(DocParamList *);
       
   118     void visitPost(DocParamList *);
       
   119     void visitPre(DocXRefItem *);
       
   120     void visitPost(DocXRefItem *);
       
   121     void visitPre(DocInternalRef *);
       
   122     void visitPost(DocInternalRef *);
       
   123     void visitPre(DocCopy *);
       
   124     void visitPost(DocCopy *);
       
   125     void visitPre(DocText *);
       
   126     void visitPost(DocText *);
       
   127 
       
   128   private:
       
   129 
       
   130     //--------------------------------------
       
   131     // helper functions 
       
   132     //--------------------------------------
       
   133     
       
   134     void filter(const char *str);
       
   135     void filterQuotedCdataAttr(const char* str);
       
   136     void startLink(const QString &ref,const QString &file,
       
   137                    const QString &relPath,const QString &anchor,
       
   138                    const QString &tooltip = QString::null);
       
   139     void endLink();
       
   140     void writeDotFile(const QString &fileName,const QString &relPath,const QString &context);
       
   141     void writeMscFile(const QString &fileName,const QString &relPath,const QString &context);
       
   142 
       
   143     void pushEnabled();
       
   144     void popEnabled();
       
   145 
       
   146     void forceEndParagraph(DocNode *n);
       
   147     void forceStartParagraph(DocNode *n);
       
   148 
       
   149     //--------------------------------------
       
   150     // state variables
       
   151     //--------------------------------------
       
   152 
       
   153     QTextStream &m_t;
       
   154     CodeOutputInterface &m_ci;
       
   155     bool m_insidePre;
       
   156     bool m_hide;
       
   157     QStack<bool> m_enabled;
       
   158     QCString m_langExt;
       
   159 };
       
   160 
       
   161 #endif