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 _TEXTDOCVISITOR_H 00020 #define _TEXTDOCVISITOR_H 00021 00022 #include "docvisitor.h" 00023 #include "docparser.h" 00024 #include <qstack.h> 00025 #include <qcstring.h> 00026 #include <qtextstream.h> 00027 00028 00030 class TextDocVisitor : public DocVisitor 00031 { 00032 public: 00033 TextDocVisitor(QTextStream &t) : DocVisitor(DocVisitor_Text), m_t(t) {} 00034 00035 //-------------------------------------- 00036 // visitor functions for leaf nodes 00037 //-------------------------------------- 00038 00039 void visit(DocWord *w) { filter(w->word()); } 00040 void visit(DocLinkedWord *w) { filter(w->word()); } 00041 void visit(DocWhiteSpace *) { m_t << " "; } 00042 void visit(DocSymbol *); 00043 void visit(DocURL *u) { filter(u->url()); } 00044 void visit(DocLineBreak *) { m_t << " "; } 00045 void visit(DocHorRuler *) {} 00046 void visit(DocStyleChange *) {} 00047 void visit(DocVerbatim *s) { filter(s->text()); } 00048 void visit(DocAnchor *) {} 00049 void visit(DocInclude *) {} 00050 void visit(DocIncOperator *) {} 00051 void visit(DocFormula *) {} 00052 void visit(DocIndexEntry *) {} 00053 00054 //-------------------------------------- 00055 // visitor functions for compound nodes 00056 //-------------------------------------- 00057 00058 void visitPre(DocAutoList *) {} 00059 void visitPost(DocAutoList *) {} 00060 void visitPre(DocAutoListItem *) {} 00061 void visitPost(DocAutoListItem *) {} 00062 void visitPre(DocPara *) {} 00063 void visitPost(DocPara *) {} 00064 void visitPre(DocRoot *) {} 00065 void visitPost(DocRoot *) {} 00066 void visitPre(DocSimpleSect *) {} 00067 void visitPost(DocSimpleSect *) {} 00068 void visitPre(DocTitle *) {} 00069 void visitPost(DocTitle *) {} 00070 void visitPre(DocSimpleList *) {} 00071 void visitPost(DocSimpleList *) {} 00072 void visitPre(DocSimpleListItem *) {} 00073 void visitPost(DocSimpleListItem *) {} 00074 void visitPre(DocSection *) {} 00075 void visitPost(DocSection *) {} 00076 void visitPre(DocHtmlList *) {} 00077 void visitPost(DocHtmlList *) {} 00078 void visitPre(DocHtmlListItem *) {} 00079 void visitPost(DocHtmlListItem *) {} 00080 void visitPre(DocHtmlDescList *) {} 00081 void visitPost(DocHtmlDescList *) {} 00082 void visitPre(DocHtmlDescTitle *) {} 00083 void visitPost(DocHtmlDescTitle *) {} 00084 void visitPre(DocHtmlDescData *) {} 00085 void visitPost(DocHtmlDescData *) {} 00086 void visitPre(DocHtmlTable *) {} 00087 void visitPost(DocHtmlTable *) {} 00088 void visitPre(DocHtmlRow *) {} 00089 void visitPost(DocHtmlRow *) {} 00090 void visitPre(DocHtmlCell *) {} 00091 void visitPost(DocHtmlCell *) {} 00092 void visitPre(DocHtmlCaption *) {} 00093 void visitPost(DocHtmlCaption *) {} 00094 void visitPre(DocInternal *) {} 00095 void visitPost(DocInternal *) {} 00096 void visitPre(DocHRef *) {} 00097 void visitPost(DocHRef *) {} 00098 void visitPre(DocHtmlHeader *) {} 00099 void visitPost(DocHtmlHeader *) {} 00100 void visitPre(DocImage *) {} 00101 void visitPost(DocImage *) {} 00102 void visitPre(DocDotFile *) {} 00103 void visitPost(DocDotFile *) {} 00104 void visitPre(DocLink *) {} 00105 void visitPost(DocLink *) {} 00106 void visitPre(DocRef *) {} 00107 void visitPost(DocRef *) {} 00108 void visitPre(DocSecRefItem *) {} 00109 void visitPost(DocSecRefItem *) {} 00110 void visitPre(DocSecRefList *) {} 00111 void visitPost(DocSecRefList *) {} 00112 void visitPre(DocParamSect *) {} 00113 void visitPost(DocParamSect *) {} 00114 void visitPre(DocParamList *) {} 00115 void visitPost(DocParamList *) {} 00116 void visitPre(DocXRefItem *) {} 00117 void visitPost(DocXRefItem *) {} 00118 void visitPre(DocInternalRef *) {} 00119 void visitPost(DocInternalRef *) {} 00120 void visitPre(DocCopy *) {} 00121 void visitPost(DocCopy *) {} 00122 void visitPre(DocText *) {} 00123 void visitPost(DocText *) {} 00124 00125 private: 00126 00127 void filter(const char *str); 00128 00129 QTextStream &m_t; 00130 }; 00131 00132 #endif