00001 /****************************************************************************** 00002 * 00003 * $Id: $ 00004 * 00005 * 00006 * Copyright (C) 1997-2008 by Dimitri van Heesch. 00007 * 00008 * Permission to use, copy, modify, and distribute this software and its 00009 * documentation under the terms of the GNU General Public License is hereby 00010 * granted. No representations are made about the suitability of this software 00011 * for any purpose. It is provided "as is" without express or implied warranty. 00012 * See the GNU General Public License for more details. 00013 * 00014 * Documents produced by Doxygen are derivative works derived from the 00015 * input used in their production; they are not affected by this license. 00016 * 00017 */ 00018 00019 #ifndef _MANDOCVISITOR_H 00020 #define _MANDOCVISITOR_H 00021 00022 #include "docvisitor.h" 00023 #include <qstack.h> 00024 #include <qcstring.h> 00025 00026 class QTextStream; 00027 class CodeOutputInterface; 00028 class QString; 00029 00031 class ManDocVisitor : public DocVisitor 00032 { 00033 public: 00034 ManDocVisitor(QTextStream &t,CodeOutputInterface &ci,const char *langExt); 00035 00036 //-------------------------------------- 00037 // visitor functions for leaf nodes 00038 //-------------------------------------- 00039 00040 void visit(DocWord *); 00041 void visit(DocLinkedWord *); 00042 void visit(DocWhiteSpace *); 00043 void visit(DocSymbol *); 00044 void visit(DocURL *); 00045 void visit(DocLineBreak *); 00046 void visit(DocHorRuler *); 00047 void visit(DocStyleChange *); 00048 void visit(DocVerbatim *); 00049 void visit(DocAnchor *); 00050 void visit(DocInclude *); 00051 void visit(DocIncOperator *); 00052 void visit(DocFormula *); 00053 void visit(DocIndexEntry *); 00054 00055 //-------------------------------------- 00056 // visitor functions for compound nodes 00057 //-------------------------------------- 00058 00059 void visitPre(DocAutoList *); 00060 void visitPost(DocAutoList *); 00061 void visitPre(DocAutoListItem *); 00062 void visitPost(DocAutoListItem *); 00063 void visitPre(DocPara *); 00064 void visitPost(DocPara *); 00065 void visitPre(DocRoot *); 00066 void visitPost(DocRoot *); 00067 void visitPre(DocSimpleSect *); 00068 void visitPost(DocSimpleSect *); 00069 void visitPre(DocTitle *); 00070 void visitPost(DocTitle *); 00071 void visitPre(DocSimpleList *); 00072 void visitPost(DocSimpleList *); 00073 void visitPre(DocSimpleListItem *); 00074 void visitPost(DocSimpleListItem *); 00075 void visitPre(DocSection *s); 00076 void visitPost(DocSection *); 00077 void visitPre(DocHtmlList *s); 00078 void visitPost(DocHtmlList *s); 00079 void visitPre(DocHtmlListItem *); 00080 void visitPost(DocHtmlListItem *); 00081 //void visitPre(DocHtmlPre *); 00082 //void visitPost(DocHtmlPre *); 00083 void visitPre(DocHtmlDescList *); 00084 void visitPost(DocHtmlDescList *); 00085 void visitPre(DocHtmlDescTitle *); 00086 void visitPost(DocHtmlDescTitle *); 00087 void visitPre(DocHtmlDescData *); 00088 void visitPost(DocHtmlDescData *); 00089 void visitPre(DocHtmlTable *t); 00090 void visitPost(DocHtmlTable *t); 00091 void visitPre(DocHtmlCaption *); 00092 void visitPost(DocHtmlCaption *); 00093 void visitPre(DocHtmlRow *); 00094 void visitPost(DocHtmlRow *) ; 00095 void visitPre(DocHtmlCell *); 00096 void visitPost(DocHtmlCell *); 00097 void visitPre(DocInternal *); 00098 void visitPost(DocInternal *); 00099 void visitPre(DocHRef *); 00100 void visitPost(DocHRef *); 00101 void visitPre(DocHtmlHeader *); 00102 void visitPost(DocHtmlHeader *) ; 00103 void visitPre(DocImage *); 00104 void visitPost(DocImage *); 00105 void visitPre(DocDotFile *); 00106 void visitPost(DocDotFile *); 00107 void visitPre(DocLink *lnk); 00108 void visitPost(DocLink *); 00109 void visitPre(DocRef *ref); 00110 void visitPost(DocRef *); 00111 void visitPre(DocSecRefItem *); 00112 void visitPost(DocSecRefItem *); 00113 void visitPre(DocSecRefList *); 00114 void visitPost(DocSecRefList *); 00115 //void visitPre(DocLanguage *); 00116 //void visitPost(DocLanguage *); 00117 void visitPre(DocParamSect *); 00118 void visitPost(DocParamSect *); 00119 void visitPre(DocParamList *); 00120 void visitPost(DocParamList *); 00121 void visitPre(DocXRefItem *); 00122 void visitPost(DocXRefItem *); 00123 void visitPre(DocInternalRef *); 00124 void visitPost(DocInternalRef *); 00125 void visitPre(DocCopy *); 00126 void visitPost(DocCopy *); 00127 void visitPre(DocText *); 00128 void visitPost(DocText *); 00129 00130 private: 00131 00132 //-------------------------------------- 00133 // helper functions 00134 //-------------------------------------- 00135 00136 void filter(const char *str); 00137 00138 void pushEnabled(); 00139 void popEnabled(); 00140 00141 //-------------------------------------- 00142 // state variables 00143 //-------------------------------------- 00144 00145 QTextStream &m_t; 00146 CodeOutputInterface &m_ci; 00147 bool m_insidePre; 00148 bool m_hide; 00149 bool m_firstCol; 00150 int m_indent; 00151 QStack<bool> m_enabled; 00152 QCString m_langExt; 00153 }; 00154 00155 #endif