My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HtmlDocVisitor Class Reference

Concrete visitor implementation for HTML output. More...

#include <htmldocvisitor.h>

Inheritance diagram for HtmlDocVisitor:
DocVisitor

Public Member Functions

 HtmlDocVisitor (FTextStream &t, CodeOutputInterface &ci, Definition *ctx)
 
void visit (DocWord *)
 
void visit (DocLinkedWord *)
 
void visit (DocWhiteSpace *)
 
void visit (DocSymbol *)
 
void visit (DocURL *)
 
void visit (DocLineBreak *)
 
void visit (DocHorRuler *)
 
void visit (DocStyleChange *)
 
void visit (DocVerbatim *)
 
void visit (DocAnchor *)
 
void visit (DocInclude *)
 
void visit (DocIncOperator *)
 
void visit (DocFormula *)
 
void visit (DocIndexEntry *)
 
void visit (DocSimpleSectSep *)
 
void visit (DocCite *)
 
void visitPre (DocAutoList *)
 
void visitPost (DocAutoList *)
 
void visitPre (DocAutoListItem *)
 
void visitPost (DocAutoListItem *)
 
void visitPre (DocPara *)
 
void visitPost (DocPara *)
 
void visitPre (DocRoot *)
 
void visitPost (DocRoot *)
 
void visitPre (DocSimpleSect *)
 
void visitPost (DocSimpleSect *)
 
void visitPre (DocTitle *)
 
void visitPost (DocTitle *)
 
void visitPre (DocSimpleList *)
 
void visitPost (DocSimpleList *)
 
void visitPre (DocSimpleListItem *)
 
void visitPost (DocSimpleListItem *)
 
void visitPre (DocSection *)
 
void visitPost (DocSection *)
 
void visitPre (DocHtmlList *)
 
void visitPost (DocHtmlList *)
 
void visitPre (DocHtmlListItem *)
 
void visitPost (DocHtmlListItem *)
 
void visitPre (DocHtmlDescList *)
 
void visitPost (DocHtmlDescList *)
 
void visitPre (DocHtmlDescTitle *)
 
void visitPost (DocHtmlDescTitle *)
 
void visitPre (DocHtmlDescData *)
 
void visitPost (DocHtmlDescData *)
 
void visitPre (DocHtmlTable *)
 
void visitPost (DocHtmlTable *)
 
void visitPre (DocHtmlRow *)
 
void visitPost (DocHtmlRow *)
 
void visitPre (DocHtmlCell *)
 
void visitPost (DocHtmlCell *)
 
void visitPre (DocHtmlCaption *)
 
void visitPost (DocHtmlCaption *)
 
void visitPre (DocInternal *)
 
void visitPost (DocInternal *)
 
void visitPre (DocHRef *)
 
void visitPost (DocHRef *)
 
void visitPre (DocHtmlHeader *)
 
void visitPost (DocHtmlHeader *)
 
void visitPre (DocImage *)
 
void visitPost (DocImage *)
 
void visitPre (DocDotFile *)
 
void visitPost (DocDotFile *)
 
void visitPre (DocMscFile *)
 
void visitPost (DocMscFile *)
 
void visitPre (DocDiaFile *)
 
void visitPost (DocDiaFile *)
 
void visitPre (DocLink *)
 
void visitPost (DocLink *)
 
void visitPre (DocRef *)
 
void visitPost (DocRef *)
 
void visitPre (DocSecRefItem *)
 
void visitPost (DocSecRefItem *)
 
void visitPre (DocSecRefList *)
 
void visitPost (DocSecRefList *)
 
void visitPre (DocParamSect *)
 
void visitPost (DocParamSect *)
 
void visitPre (DocParamList *)
 
void visitPost (DocParamList *)
 
void visitPre (DocXRefItem *)
 
void visitPost (DocXRefItem *)
 
void visitPre (DocInternalRef *)
 
void visitPost (DocInternalRef *)
 
void visitPre (DocCopy *)
 
void visitPost (DocCopy *)
 
void visitPre (DocText *)
 
void visitPost (DocText *)
 
void visitPre (DocHtmlBlockQuote *)
 
void visitPost (DocHtmlBlockQuote *)
 
void visitPre (DocVhdlFlow *)
 
void visitPost (DocVhdlFlow *)
 
void visitPre (DocParBlock *)
 
void visitPost (DocParBlock *)
 
- Public Member Functions inherited from DocVisitor
 DocVisitor (int id)
 
virtual ~DocVisitor ()
 
int id () const
 

Private Member Functions

void writeObfuscatedMailAddress (const QCString &url)
 
void filter (const char *str)
 
void filterQuotedCdataAttr (const char *str)
 
void startLink (const QCString &ref, const QCString &file, const QCString &relPath, const QCString &anchor, const QCString &tooltip="")
 
void endLink ()
 
void writeDotFile (const QCString &fileName, const QCString &relPath, const QCString &context)
 
void writeMscFile (const QCString &fileName, const QCString &relPath, const QCString &context)
 
void writeDiaFile (const QCString &fileName, const QCString &relPath, const QCString &context)
 
void writePlantUMLFile (const QCString &fileName, const QCString &relPath, const QCString &context)
 
void pushEnabled ()
 
void popEnabled ()
 
void forceEndParagraph (DocNode *n)
 
void forceStartParagraph (DocNode *n)
 

Private Attributes

FTextStreamm_t
 
CodeOutputInterfacem_ci
 
bool m_insidePre
 
bool m_hide
 
QStack< bool > m_enabled
 
Definitionm_ctx
 
QCString m_langExt
 

Detailed Description

Concrete visitor implementation for HTML output.

Definition at line 33 of file htmldocvisitor.h.

Constructor & Destructor Documentation

HtmlDocVisitor::HtmlDocVisitor ( FTextStream t,
CodeOutputInterface ci,
Definition ctx 
)

Definition at line 149 of file htmldocvisitor.cpp.

References Definition::getDefFileExtension(), and m_langExt.

m_hide(FALSE), m_ctx(ctx)
{
if (ctx) m_langExt=ctx->getDefFileExtension();
}

Member Function Documentation

void HtmlDocVisitor::endLink ( )
private

Definition at line 1960 of file htmldocvisitor.cpp.

References m_t.

Referenced by visit(), and visitPost().

{
m_t << "</a>";
}
void HtmlDocVisitor::filter ( const char *  str)
private

Definition at line 1898 of file htmldocvisitor.cpp.

References m_t.

Referenced by visit(), and visitPre().

{
if (str==0) return;
const char *p=str;
char c;
while (*p)
{
c=*p++;
switch(c)
{
case '<': m_t << "&lt;"; break;
case '>': m_t << "&gt;"; break;
case '&': m_t << "&amp;"; break;
default: m_t << c;
}
}
}
void HtmlDocVisitor::filterQuotedCdataAttr ( const char *  str)
private

Escape basic entities to produce a valid CDATA attribute value, assume that the outer quoting will be using the double quote "

Definition at line 1918 of file htmldocvisitor.cpp.

References m_t.

Referenced by visit().

{
if (str==0) return;
const char *p=str;
char c;
while (*p)
{
c=*p++;
switch(c)
{
case '&': m_t << "&amp;"; break;
case '"': m_t << "&quot;"; break;
case '<': m_t << "&lt;"; break;
case '>': m_t << "&gt;"; break;
default: m_t << c;
}
}
}
void HtmlDocVisitor::forceEndParagraph ( DocNode n)
private

Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph. This method will forcefully end the current paragraph and forceStartParagraph() will restart it.

Definition at line 2113 of file htmldocvisitor.cpp.

References CompAccept< T >::children(), getParagraphContext(), insideStyleChangeThatIsOutsideParagraph(), DocNode::kind(), DocNode::Kind_Para, DocNode::Kind_WhiteSpace, m_t, mustBeOutsideParagraph(), and DocNode::parent().

Referenced by visit(), and visitPre().

{
//printf("forceEndParagraph(%p) %d\n",n,n->kind());
if (n->parent() && n->parent()->kind()==DocNode::Kind_Para)
{
DocPara *para = (DocPara*)n->parent();
int nodeIndex = para->children().findRef(n);
nodeIndex--;
if (nodeIndex<0) return; // first node
while (nodeIndex>=0 &&
para->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace
)
{
nodeIndex--;
}
if (nodeIndex>=0)
{
DocNode *n = para->children().at(nodeIndex);
//printf("n=%p kind=%d outside=%d\n",n,n->kind(),mustBeOutsideParagraph(n));
if (mustBeOutsideParagraph(n)) return;
}
nodeIndex--;
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
bool isFirst;
bool isLast;
getParagraphContext(para,isFirst,isLast);
//printf("forceEnd first=%d last=%d styleOutsideParagraph=%d\n",isFirst,isLast,styleOutsideParagraph);
if (isFirst && isLast) return;
if (styleOutsideParagraph) return;
m_t << "</p>";
}
}
void HtmlDocVisitor::forceStartParagraph ( DocNode n)
private

Used for items found inside a paragraph, which due to XHTML restrictions have to be outside of the paragraph. This method will forcefully start the paragraph, that was previously ended by forceEndParagraph().

Definition at line 2151 of file htmldocvisitor.cpp.

References CompAccept< T >::children(), getParagraphContext(), insideStyleChangeThatIsOutsideParagraph(), DocNode::kind(), DocNode::Kind_Para, DocNode::Kind_WhiteSpace, m_t, mustBeOutsideParagraph(), and DocNode::parent().

Referenced by visit(), and visitPost().

{
//printf("forceStartParagraph(%p) %d\n",n,n->kind());
if (n->parent() && n->parent()->kind()==DocNode::Kind_Para) // if we are inside a paragraph
{
DocPara *para = (DocPara*)n->parent();
int nodeIndex = para->children().findRef(n);
int numNodes = para->children().count();
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
if (styleOutsideParagraph) return;
nodeIndex++;
if (nodeIndex==numNodes) return; // last node
while (nodeIndex<numNodes &&
para->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace
)
{
nodeIndex++;
}
if (nodeIndex<numNodes)
{
DocNode *n = para->children().at(nodeIndex);
if (mustBeOutsideParagraph(n)) return;
}
else
{
return; // only whitespace at the end!
}
bool isFirst;
bool isLast;
getParagraphContext(para,isFirst,isLast);
//printf("forceStart first=%d last=%d\n",isFirst,isLast);
if (isFirst && isLast) return;
m_t << "<p>";
}
}
void HtmlDocVisitor::popEnabled ( )
private

Definition at line 1970 of file htmldocvisitor.cpp.

References m_enabled, and m_hide.

Referenced by visit(), and visitPost().

{
bool *v=m_enabled.pop();
ASSERT(v!=0);
m_hide = *v;
delete v;
}
void HtmlDocVisitor::pushEnabled ( )
private

Definition at line 1965 of file htmldocvisitor.cpp.

References m_enabled, and m_hide.

Referenced by visit(), and visitPre().

{
m_enabled.push(new bool(m_hide));
}
void HtmlDocVisitor::startLink ( const QCString &  ref,
const QCString &  file,
const QCString &  relPath,
const QCString &  anchor,
const QCString &  tooltip = "" 
)
private

Definition at line 1937 of file htmldocvisitor.cpp.

References convertToHtml(), externalLinkTarget(), externalRef(), Doxygen::htmlFileExtension, and m_t.

Referenced by visit(), and visitPre().

{
//printf("HtmlDocVisitor: file=%s anchor=%s\n",file.data(),anchor.data());
if (!ref.isEmpty()) // link to entity imported via tag file
{
m_t << "<a class=\"elRef\" ";
m_t << externalLinkTarget() << externalRef(relPath,ref,FALSE);
}
else // local link
{
m_t << "<a class=\"el\" ";
}
m_t << "href=\"";
m_t << externalRef(relPath,ref,TRUE);
if (!file.isEmpty()) m_t << file << Doxygen::htmlFileExtension;
if (!anchor.isEmpty()) m_t << "#" << anchor;
m_t << "\"";
if (!tooltip.isEmpty()) m_t << " title=\"" << convertToHtml(tooltip) << "\"";
m_t << ">";
}
void HtmlDocVisitor::visit ( DocWord w)
virtual

Implements DocVisitor.

Definition at line 161 of file htmldocvisitor.cpp.

References filter(), m_hide, and DocWord::word().

Referenced by visitPre().

{
//printf("word: %s\n",w->word().data());
if (m_hide) return;
filter(w->word());
}
void HtmlDocVisitor::visit ( DocLinkedWord w)
virtual

Implements DocVisitor.

Definition at line 168 of file htmldocvisitor.cpp.

References DocLinkedWord::anchor(), endLink(), DocLinkedWord::file(), filter(), m_hide, DocLinkedWord::ref(), DocLinkedWord::relPath(), startLink(), DocLinkedWord::tooltip(), and DocLinkedWord::word().

{
if (m_hide) return;
//printf("linked word: %s\n",w->word().data());
startLink(w->ref(),w->file(),w->relPath(),w->anchor(),w->tooltip());
filter(w->word());
}
void HtmlDocVisitor::visit ( DocWhiteSpace w)
virtual

Implements DocVisitor.

Definition at line 177 of file htmldocvisitor.cpp.

References DocWhiteSpace::chars(), m_hide, m_insidePre, and m_t.

{
if (m_hide) return;
{
m_t << w->chars();
}
else
{
m_t << " ";
}
}
void HtmlDocVisitor::visit ( DocSymbol s)
virtual

Implements DocVisitor.

Definition at line 190 of file htmldocvisitor.cpp.

References err(), HtmlEntityMapper::html(), HtmlEntityMapper::instance(), m_hide, m_t, and DocSymbol::symbol().

{
if (m_hide) return;
const char *res = HtmlEntityMapper::instance()->html(s->symbol());
if (res)
{
m_t << res;
}
else
{
err("HTML: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE));
}
}
void HtmlDocVisitor::visit ( DocURL u)
virtual

Implements DocVisitor.

Definition at line 218 of file htmldocvisitor.cpp.

References filter(), DocURL::isEmail(), m_hide, m_t, DocURL::url(), and writeObfuscatedMailAddress().

{
if (m_hide) return;
if (u->isEmail()) // mail address
{
QCString url = u->url();
uint size=5,i;
for (i=0;i<url.length();)
{
filter(url.mid(i,size));
if (i<url.length()-size) m_t << "<span style=\"display: none;\">.nosp@m.</span>";
i+=size;
if (size==5) size=4; else size=5;
}
m_t << "</a>";
}
else // web address
{
m_t << "<a href=\"";
m_t << u->url() << "\">";
filter(u->url());
m_t << "</a>";
}
}
void HtmlDocVisitor::visit ( DocLineBreak )
virtual

Implements DocVisitor.

Definition at line 244 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<br />\n";
}
void HtmlDocVisitor::visit ( DocHorRuler hr)
virtual

Implements DocVisitor.

Definition at line 250 of file htmldocvisitor.cpp.

References forceEndParagraph(), forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<hr/>\n";
}
void HtmlDocVisitor::visit ( DocStyleChange s)
virtual

Implements DocVisitor.

Definition at line 258 of file htmldocvisitor.cpp.

References DocStyleChange::attribs(), DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Code, DocStyleChange::Div, DocStyleChange::enable(), forceEndParagraph(), forceStartParagraph(), htmlAttribsToString(), DocStyleChange::Italic, m_hide, m_insidePre, m_t, DocStyleChange::Preformatted, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::style(), DocStyleChange::Subscript, and DocStyleChange::Superscript.

{
if (m_hide) return;
switch (s->style())
{
if (s->enable()) m_t << "<b" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</b>";
break;
if (s->enable()) m_t << "<em" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</em>";
break;
if (s->enable()) m_t << "<code" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</code>";
break;
if (s->enable()) m_t << "<sub" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sub>";
break;
if (s->enable()) m_t << "<sup" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</sup>";
break;
if (s->enable())
{
m_t << "<center" << htmlAttribsToString(s->attribs()) << ">";
}
else
{
m_t << "</center>";
}
break;
if (s->enable()) m_t << "<small" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</small>";
break;
if (s->enable())
{
m_t << "<pre" << htmlAttribsToString(s->attribs()) << ">";
}
else
{
m_insidePre=FALSE;
m_t << "</pre>";
}
break;
if (s->enable())
{
m_t << "<div" << htmlAttribsToString(s->attribs()) << ">";
}
else
{
m_t << "</div>";
}
break;
if (s->enable()) m_t << "<span" << htmlAttribsToString(s->attribs()) << ">"; else m_t << "</span>";
break;
}
}
void HtmlDocVisitor::visit ( DocVerbatim s)
virtual

Implements DocVisitor.

Definition at line 353 of file htmldocvisitor.cpp.

References DocVerbatim::children(), DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context(), DocVerbatim::DocbookOnly, DocVerbatim::Dot, endl(), err(), DocVerbatim::exampleFile(), filter(), forceEndParagraph(), forceStartParagraph(), getLanguageFromFileName(), ParserManager::getParser(), DocVerbatim::HtmlOnly, DocVerbatim::isBlock(), DocVerbatim::isExample(), DocVerbatim::language(), DocVerbatim::LatexOnly, m_ci, m_ctx, m_hide, m_langExt, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, ParserInterface::parseCode(), Doxygen::parserManager, DocVerbatim::PlantUML, PREFRAG_END, PREFRAG_START, DocVerbatim::relPath(), DocVerbatim::RtfOnly, DocVerbatim::text(), DocVerbatim::type(), DocVerbatim::Verbatim, visitCaption(), visitPostCaption(), visitPreCaption(), writeDotFile(), writeMscFile(), writePlantUMLFile(), writePlantUMLSource(), and DocVerbatim::XmlOnly.

{
if (m_hide) return;
QCString lang = m_langExt;
if (!s->language().isEmpty()) // explicit language setting
{
lang = s->language();
}
switch(s->type())
{
s->context(),
s->text(),
langExt,
s->isExample(),
0, // fileDef
-1, // startLine
-1, // endLine
FALSE, // inlineFragment
0, // memberDef
TRUE, // show line numbers
m_ctx // search context
);
break;
m_t << /*PREFRAG_START <<*/ "<pre class=\"fragment\">";
filter(s->text());
m_t << "</pre>" /*<< PREFRAG_END*/;
break;
if (s->isBlock()) forceEndParagraph(s);
m_t << s->text();
break;
/* nothing */
break;
{
static int dotindex = 1;
QCString fileName(4096);
fileName.sprintf("%s%d%s",
(Config_getString(HTML_OUTPUT)+"/inline_dotgraph_").data(),
dotindex++,
".dot"
);
QFile file(fileName);
if (!file.open(IO_WriteOnly))
{
err("Could not open file %s for writing\n",fileName.data());
}
else
{
file.writeBlock( s->text(), s->text().length() );
file.close();
m_t << "<div align=\"center\">" << endl;
writeDotFile(fileName,s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
m_t << "</div>" << endl;
if (Config_getBool(DOT_CLEANUP)) file.remove();
}
}
break;
{
static int mscindex = 1;
QCString baseName(4096);
baseName.sprintf("%s%d",
(Config_getString(HTML_OUTPUT)+"/inline_mscgraph_").data(),
mscindex++
);
QFile file(baseName+".msc");
if (!file.open(IO_WriteOnly))
{
err("Could not open file %s.msc for writing\n",baseName.data());
}
else
{
QCString text = "msc {";
text+=s->text();
text+="}";
file.writeBlock( text, text.length() );
file.close();
m_t << "<div align=\"center\">" << endl;
writeMscFile(baseName+".msc",s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
m_t << "</div>" << endl;
if (Config_getBool(DOT_CLEANUP)) file.remove();
}
}
break;
{
static QCString htmlOutput = Config_getString(HTML_OUTPUT);
QCString baseName = writePlantUMLSource(htmlOutput,s->exampleFile(),s->text());
m_t << "<div align=\"center\">" << endl;
writePlantUMLFile(baseName,s->relPath(),s->context());
visitPreCaption(m_t, s);
visitCaption(this, s->children());
m_t << "</div>" << endl;
}
break;
}
}
void HtmlDocVisitor::visit ( DocAnchor anc)
virtual

Implements DocVisitor.

Definition at line 493 of file htmldocvisitor.cpp.

References DocAnchor::anchor(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<a class=\"anchor\" id=\"" << anc->anchor() << "\"></a>";
}
void HtmlDocVisitor::visit ( DocInclude inc)
virtual

Implements DocVisitor.

Definition at line 499 of file htmldocvisitor.cpp.

References DocInclude::blockId(), DocInclude::context(), DocInclude::DontInclude, err(), DocInclude::exampleFile(), DocInclude::extension(), extractBlock(), DocInclude::file(), filter(), forceEndParagraph(), forceStartParagraph(), getLanguageFromFileName(), ParserManager::getParser(), DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncludeDoc, DocInclude::IncWithLines, DocInclude::isExample(), DocInclude::LatexInclude, m_ci, m_ctx, m_hide, m_t, parseCode(), Doxygen::parserManager, PREFRAG_END, PREFRAG_START, DocInclude::Snippet, DocInclude::SnippetDoc, DocInclude::text(), DocInclude::type(), and DocInclude::VerbInclude.

{
if (m_hide) return;
switch(inc->type())
{
inc->context(),
inc->text(),
langExt,
inc->isExample(),
inc->exampleFile(),
0, // fileDef
-1, // startLine
-1, // endLine
TRUE, // inlineFragment
0, // memberDef
FALSE, // show line numbers
m_ctx // search context
);
break;
{
QFileInfo cfi( inc->file() );
FileDef fd( cfi.dirPath().utf8(), cfi.fileName().utf8() );
inc->context(),
inc->text(),
langExt,
inc->isExample(),
inc->exampleFile(),
&fd, // fileDef,
-1, // start line
-1, // end line
FALSE, // inline fragment
0, // memberDef
TRUE, // show line numbers
m_ctx // search context
);
}
break;
break;
m_t << inc->text();
break;
break;
m_t << /*PREFRAG_START <<*/ "<pre class=\"fragment\">";
filter(inc->text());
m_t << "</pre>" /*<< PREFRAG_END*/;
break;
{
m_t << PREFRAG_START;
inc->context(),
extractBlock(inc->text(),inc->blockId()),
langExt,
inc->isExample(),
inc->exampleFile(),
0,
-1, // startLine
-1, // endLine
TRUE, // inlineFragment
0, // memberDef
TRUE, // show line number
m_ctx // search context
);
m_t << PREFRAG_END;
}
break;
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
"Please create a bug report\n",__FILE__);
break;
}
}
void HtmlDocVisitor::visit ( DocIncOperator op)
virtual

Implements DocVisitor.

Definition at line 596 of file htmldocvisitor.cpp.

References DocIncOperator::context(), endl(), DocIncOperator::exampleFile(), getLanguageFromFileName(), ParserManager::getParser(), DocIncOperator::isExample(), DocIncOperator::isFirst(), DocIncOperator::isLast(), m_ci, m_ctx, m_hide, m_langExt, m_t, ParserInterface::parseCode(), Doxygen::parserManager, popEnabled(), PREFRAG_END, PREFRAG_START, pushEnabled(), DocIncOperator::Skip, DocIncOperator::text(), and DocIncOperator::type().

{
//printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n",
// op->type(),op->isFirst(),op->isLast(),op->text().data());
if (op->isFirst())
{
m_hide=TRUE;
}
{
if (!m_hide)
{
op->context(),
op->text(),
langExt,
op->isExample(),
op->exampleFile(),
0, // fileDef
-1, // startLine
-1, // endLine
FALSE, // inline fragment
0, // memberDef
TRUE, // show line numbers
m_ctx // search context
);
}
m_hide=TRUE;
}
if (op->isLast())
{
}
else
{
if (!m_hide) m_t << endl;
}
}
void HtmlDocVisitor::visit ( DocFormula f)
virtual

Implements DocVisitor.

Definition at line 643 of file htmldocvisitor.cpp.

References Config_getBool, convertToHtml(), endl(), filterQuotedCdataAttr(), forceEndParagraph(), forceStartParagraph(), DocFormula::isInline(), m_hide, m_t, DocFormula::name(), DocFormula::relPath(), and DocFormula::text().

{
if (m_hide) return;
bool bDisplay = !f->isInline();
if (bDisplay)
{
m_t << "<p class=\"formulaDsp\">" << endl;
}
if (Config_getBool(USE_MATHJAX))
{
QCString text = f->text();
bool closeInline = FALSE;
if (!bDisplay && !text.isEmpty() && text.at(0)=='$' &&
text.at(text.length()-1)=='$')
{
closeInline=TRUE;
text = text.mid(1,text.length()-2);
m_t << "\\(";
}
m_t << convertToHtml(text);
if (closeInline)
{
m_t << "\\)";
}
}
else
{
m_t << "<img class=\"formula"
<< (bDisplay ? "Dsp" : "Inl");
m_t << "\" alt=\"";
m_t << "\"";
// TODO: cache image dimensions on formula generation and give height/width
// for faster preloading and better rendering of the page
m_t << " src=\"" << f->relPath() << f->name() << ".png\"/>";
}
if (bDisplay)
{
m_t << endl << "</p>" << endl;
}
}
void HtmlDocVisitor::visit ( DocIndexEntry e)
virtual

Implements DocVisitor.

Definition at line 689 of file htmldocvisitor.cpp.

References IndexList::addIndexItem(), MemberDef::anchor(), convertIndexWordToAnchor(), DocIndexEntry::entry(), Doxygen::indexList, m_t, DocIndexEntry::member(), and DocIndexEntry::scope().

{
QCString anchor = convertIndexWordToAnchor(e->entry());
if (e->member())
{
anchor.prepend(e->member()->anchor()+"_");
}
m_t << "<a name=\"" << anchor << "\"></a>";
//printf("*** DocIndexEntry: word='%s' scope='%s' member='%s'\n",
// e->entry().data(),
// e->scope() ? e->scope()->name().data() : "<null>",
// e->member() ? e->member()->name().data() : "<null>"
// );
}
void HtmlDocVisitor::visit ( DocSimpleSectSep )
virtual

Implements DocVisitor.

Definition at line 705 of file htmldocvisitor.cpp.

References endl(), and m_t.

{
m_t << "</dd>" << endl;
m_t << "<dd>" << endl;
}
void HtmlDocVisitor::visit ( DocCite cite)
virtual

Implements DocVisitor.

Definition at line 711 of file htmldocvisitor.cpp.

References DocCite::anchor(), endLink(), DocCite::file(), filter(), m_hide, m_t, DocCite::ref(), DocCite::relPath(), startLink(), and DocCite::text().

{
if (m_hide) return;
if (!cite->file().isEmpty())
{
startLink(cite->ref(),cite->file(),cite->relPath(),cite->anchor());
}
else
{
m_t << "<b>[";
}
filter(cite->text());
if (!cite->file().isEmpty())
{
}
else
{
m_t << "]</b>";
}
}
void HtmlDocVisitor::visitPost ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 763 of file htmldocvisitor.cpp.

References forceStartParagraph(), DocAutoList::isEnumList(), DocNode::isPreformatted(), m_hide, and m_t.

{
//printf("DocAutoList::visitPost\n");
if (m_hide) return;
if (l->isEnumList())
{
m_t << "</ol>";
}
else
{
m_t << "</ul>";
}
if (!l->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPost ( DocAutoListItem li)
virtual

Implements DocVisitor.

Definition at line 785 of file htmldocvisitor.cpp.

References DocNode::isPreformatted(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</li>";
if (!li->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPost ( DocPara p)
virtual

Implements DocVisitor.

Definition at line 1041 of file htmldocvisitor.cpp.

References CompAccept< T >::children(), getParagraphContext(), DocNode::kind(), DocNode::Kind_AutoListItem, DocNode::Kind_Copy, DocNode::Kind_HtmlBlockQuote, DocNode::Kind_HtmlCell, DocNode::Kind_HtmlDescData, DocNode::Kind_HtmlListItem, DocNode::Kind_Internal, DocNode::Kind_ParBlock, DocNode::Kind_Root, DocNode::Kind_Section, DocNode::Kind_SimpleListItem, DocNode::Kind_SimpleSect, DocNode::Kind_WhiteSpace, DocNode::Kind_XRefItem, m_t, mustBeOutsideParagraph(), and DocNode::parent().

{
bool needsTag = FALSE;
if (p->parent())
{
switch (p->parent()->kind())
{
needsTag = TRUE;
break;
needsTag = !((DocRoot*)p->parent())->singleLine();
break;
default:
needsTag = FALSE;
}
}
// if the last element of a paragraph is something that should be outside of
// the paragraph (<ul>,<dl>,<table>) then that will already have ended the
// paragraph and we don't need to do it here
int nodeIndex = p->children().count()-1;
if (nodeIndex>=0)
{
while (nodeIndex>=0 && p->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace)
{
nodeIndex--;
}
if (nodeIndex>=0)
{
DocNode *n = p->children().at(nodeIndex);
{
needsTag = FALSE;
}
}
}
bool isFirst;
bool isLast;
getParagraphContext(p,isFirst,isLast);
//printf("endPara first=%d last=%d\n",isFirst,isLast);
if (isFirst && isLast) needsTag=FALSE;
//printf("DocPara::visitPost needsTag=%d\n",needsTag);
if (needsTag) m_t << "</p>\n";
}
void HtmlDocVisitor::visitPost ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 1106 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPost ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 1159 of file htmldocvisitor.cpp.

References forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</dd></dl>\n";
}
void HtmlDocVisitor::visitPost ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 1170 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</dt><dd>";
}
void HtmlDocVisitor::visitPost ( DocSimpleList sl)
virtual

Implements DocVisitor.

Definition at line 1185 of file htmldocvisitor.cpp.

References forceStartParagraph(), DocNode::isPreformatted(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</ul>";
if (!sl->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPost ( DocSimpleListItem li)
virtual

Implements DocVisitor.

Definition at line 1199 of file htmldocvisitor.cpp.

References DocNode::isPreformatted(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</li>";
if (!li->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPost ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 1217 of file htmldocvisitor.cpp.

References forceStartParagraph().

void HtmlDocVisitor::visitPost ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 1236 of file htmldocvisitor.cpp.

References forceStartParagraph(), DocNode::isPreformatted(), m_hide, m_t, DocHtmlList::Ordered, and DocHtmlList::type().

{
if (m_hide) return;
{
m_t << "</ol>";
}
else
{
m_t << "</ul>";
}
if (!s->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlListItem )
virtual

Implements DocVisitor.

Definition at line 1258 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</li>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlDescList dl)
virtual

Implements DocVisitor.

Definition at line 1271 of file htmldocvisitor.cpp.

References forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</dl>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlDescTitle )
virtual

Implements DocVisitor.

Definition at line 1284 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</dt>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlDescData )
virtual

Implements DocVisitor.

Definition at line 1296 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</dd>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 1324 of file htmldocvisitor.cpp.

References forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</table>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlRow )
virtual

Implements DocVisitor.

Definition at line 1337 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</tr>\n";
}
void HtmlDocVisitor::visitPost ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 1356 of file htmldocvisitor.cpp.

References DocHtmlCell::isHeading(), m_hide, and m_t.

{
if (m_hide) return;
if (c->isHeading()) m_t << "</th>"; else m_t << "</td>";
}
void HtmlDocVisitor::visitPost ( DocHtmlCaption )
virtual

Implements DocVisitor.

Definition at line 1368 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</caption>\n";
}
void HtmlDocVisitor::visitPost ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 1381 of file htmldocvisitor.cpp.

References m_hide.

{
if (m_hide) return;
//forceStartParagraph(i);
}
void HtmlDocVisitor::visitPost ( DocHRef )
virtual

Implements DocVisitor.

Definition at line 1402 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</a>";
}
void HtmlDocVisitor::visitPost ( DocHtmlHeader header)
virtual

Implements DocVisitor.

Definition at line 1416 of file htmldocvisitor.cpp.

References forceStartParagraph(), DocHtmlHeader::level(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</h" << header->level() << ">\n";
}
void HtmlDocVisitor::visitPost ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 1487 of file htmldocvisitor.cpp.

References endl(), forceStartParagraph(), DocImage::hasCaption(), DocImage::Html, m_hide, m_t, popEnabled(), and DocImage::type().

{
if (img->type()==DocImage::Html)
{
if (m_hide) return;
if (img->hasCaption())
{
m_t << "</div>";
}
m_t << "</div>" << endl;
}
else // other format
{
}
}
void HtmlDocVisitor::visitPost ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 1516 of file htmldocvisitor.cpp.

References endl(), DocDotFile::hasCaption(), m_hide, and m_t.

{
if (m_hide) return;
if (df->hasCaption())
{
m_t << "</div>" << endl;
}
m_t << "</div>" << endl;
}
void HtmlDocVisitor::visitPost ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 1536 of file htmldocvisitor.cpp.

References endl(), DocMscFile::hasCaption(), m_hide, and m_t.

{
if (m_hide) return;
if (df->hasCaption())
{
m_t << "</div>" << endl;
}
m_t << "</div>" << endl;
}
void HtmlDocVisitor::visitPost ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 1556 of file htmldocvisitor.cpp.

References endl(), DocDiaFile::hasCaption(), m_hide, and m_t.

{
if (m_hide) return;
if (df->hasCaption())
{
m_t << "</div>" << endl;
}
m_t << "</div>" << endl;
}
void HtmlDocVisitor::visitPost ( DocLink )
virtual

Implements DocVisitor.

Definition at line 1572 of file htmldocvisitor.cpp.

References endLink(), and m_hide.

{
if (m_hide) return;
}
void HtmlDocVisitor::visitPost ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1590 of file htmldocvisitor.cpp.

References endLink(), DocRef::file(), and m_hide.

{
if (m_hide) return;
if (!ref->file().isEmpty()) endLink();
//m_t << " ";
}
void HtmlDocVisitor::visitPost ( DocSecRefItem )
virtual

Implements DocVisitor.

Definition at line 1610 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "</a></li>\n";
}
void HtmlDocVisitor::visitPost ( DocSecRefList s)
virtual

Implements DocVisitor.

Definition at line 1624 of file htmldocvisitor.cpp.

References endl(), forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</ul>" << endl;
m_t << "</div>" << endl;
}
void HtmlDocVisitor::visitPost ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1684 of file htmldocvisitor.cpp.

References endl(), forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << " </table>" << endl;
m_t << " </dd>" << endl;
m_t << "</dl>" << endl;
}
void HtmlDocVisitor::visitPost ( DocParamList )
virtual

Implements DocVisitor.

Definition at line 1766 of file htmldocvisitor.cpp.

References endl(), m_hide, and m_t.

{
//printf("DocParamList::visitPost\n");
if (m_hide) return;
m_t << "</td></tr>" << endl;
}
void HtmlDocVisitor::visitPost ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1796 of file htmldocvisitor.cpp.

References endl(), forceStartParagraph(), m_hide, m_t, and DocXRefItem::title().

{
if (m_hide) return;
if (x->title().isEmpty()) return;
m_t << "</dd></dl>" << endl;
}
void HtmlDocVisitor::visitPost ( DocInternalRef )
virtual

Implements DocVisitor.

Definition at line 1810 of file htmldocvisitor.cpp.

References endLink(), m_hide, and m_t.

{
if (m_hide) return;
m_t << " ";
}
void HtmlDocVisitor::visitPost ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1821 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPost ( DocText )
virtual

Implements DocVisitor.

Definition at line 1829 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPost ( DocHtmlBlockQuote b)
virtual

Implements DocVisitor.

Definition at line 1848 of file htmldocvisitor.cpp.

References endl(), forceStartParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "</blockquote>" << endl;
}
void HtmlDocVisitor::visitPost ( DocVhdlFlow vf)
virtual

Implements DocVisitor.

Definition at line 1876 of file htmldocvisitor.cpp.

References forceStartParagraph(), VhdlDocGen::getFlowMember(), m_hide, and m_t.

{
if (m_hide) return;
if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
{
m_t << "</p>";
}
}
void HtmlDocVisitor::visitPost ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1891 of file htmldocvisitor.cpp.

References m_hide.

{
if (m_hide) return;
}
void HtmlDocVisitor::visitPre ( DocAutoList l)
virtual

Implements DocVisitor.

Definition at line 739 of file htmldocvisitor.cpp.

References DocAutoList::depth(), forceEndParagraph(), DocAutoList::isEnumList(), DocNode::isPreformatted(), m_hide, m_t, NUM_HTML_LIST_TYPES, and types.

{
//printf("DocAutoList::visitPre\n");
if (m_hide) return;
if (l->isEnumList())
{
//
// Do list type based on depth:
// 1.
// a.
// i.
// A.
// 1. (repeat)...
//
m_t << "<ol type=\"" << types[l->depth() % NUM_HTML_LIST_TYPES] << "\">";
}
else
{
m_t << "<ul>";
}
if (!l->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPre ( DocAutoListItem )
virtual

Implements DocVisitor.

Definition at line 779 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<li>";
}
void HtmlDocVisitor::visitPre ( DocPara p)
virtual

Implements DocVisitor.

Definition at line 962 of file htmldocvisitor.cpp.

References CompAccept< T >::children(), getParagraphContext(), DocNode::kind(), DocNode::Kind_AutoListItem, DocNode::Kind_Copy, DocNode::Kind_HtmlBlockQuote, DocNode::Kind_HtmlCell, DocNode::Kind_HtmlDescData, DocNode::Kind_HtmlListItem, DocNode::Kind_Internal, DocNode::Kind_ParBlock, DocNode::Kind_Root, DocNode::Kind_Section, DocNode::Kind_SimpleListItem, DocNode::Kind_SimpleSect, DocNode::Kind_WhiteSpace, DocNode::Kind_XRefItem, m_hide, m_t, mustBeOutsideParagraph(), and DocNode::parent().

{
if (m_hide) return;
//printf("DocPara::visitPre: parent of kind %d ",
// p->parent() ? p->parent()->kind() : -1);
bool needsTag = FALSE;
if (p && p->parent())
{
switch (p->parent()->kind())
{
needsTag = TRUE;
break;
needsTag = !((DocRoot*)p->parent())->singleLine();
break;
default:
needsTag = FALSE;
}
}
// if the first element of a paragraph is something that should be outside of
// the paragraph (<ul>,<dl>,<table>,..) then that will already started the
// paragraph and we don't need to do it here
uint nodeIndex = 0;
if (p && nodeIndex<p->children().count())
{
while (nodeIndex<p->children().count() &&
p->children().at(nodeIndex)->kind()==DocNode::Kind_WhiteSpace)
{
nodeIndex++;
}
if (nodeIndex<p->children().count())
{
DocNode *n = p->children().at(nodeIndex);
{
needsTag = FALSE;
}
}
}
// check if this paragraph is the first or last child of a <li> or <dd>.
// this allows us to mark the tag with a special class so we can
// fix the otherwise ugly spacing.
int t;
static const char *contexts[7] =
{ "", // 0
" class=\"startli\"", // 1
" class=\"startdd\"", // 2
" class=\"endli\"", // 3
" class=\"enddd\"", // 4
" class=\"starttd\"", // 5
" class=\"endtd\"" // 6
};
bool isFirst;
bool isLast;
t = getParagraphContext(p,isFirst,isLast);
//printf("startPara first=%d last=%d\n",isFirst,isLast);
if (isFirst && isLast) needsTag=FALSE;
//printf(" needsTag=%d\n",needsTag);
// write the paragraph tag (if needed)
if (needsTag) m_t << "<p" << contexts[t] << ">";
}
void HtmlDocVisitor::visitPre ( DocRoot )
virtual

Implements DocVisitor.

Definition at line 1102 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPre ( DocSimpleSect s)
virtual

Implements DocVisitor.

Definition at line 1110 of file htmldocvisitor.cpp.

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, forceEndParagraph(), DocSimpleSect::Invar, m_hide, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, Translator::trAttention(), Translator::trAuthor(), Translator::trCopyright(), Translator::trDate(), Translator::trInvariant(), Translator::trNote(), Translator::trPostcondition(), Translator::trPrecondition(), Translator::trRemarks(), Translator::trReturns(), Translator::trSeeAlso(), Translator::trSince(), Translator::trVersion(), Translator::trWarning(), DocSimpleSect::type(), DocSimpleSect::typeString(), DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, and DocSimpleSect::Warning.

{
if (m_hide) return;
m_t << "<dl class=\"section " << s->typeString() << "\"><dt>";
switch(s->type())
{
m_t << theTranslator->trSeeAlso(); break;
m_t << theTranslator->trReturns(); break;
m_t << theTranslator->trAuthor(TRUE,TRUE); break;
m_t << theTranslator->trAuthor(TRUE,FALSE); break;
m_t << theTranslator->trVersion(); break;
m_t << theTranslator->trSince(); break;
m_t << theTranslator->trDate(); break;
m_t << theTranslator->trNote(); break;
m_t << theTranslator->trWarning(); break;
m_t << theTranslator->trRemarks(); break;
case DocSimpleSect::User: break;
case DocSimpleSect::Rcs: break;
}
// special case 1: user defined title
{
m_t << "</dt><dd>";
}
}
void HtmlDocVisitor::visitPre ( DocTitle )
virtual

Implements DocVisitor.

Definition at line 1166 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPre ( DocSimpleList sl)
virtual

Implements DocVisitor.

Definition at line 1176 of file htmldocvisitor.cpp.

References forceEndParagraph(), DocNode::isPreformatted(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<ul>";
if (!sl->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPre ( DocSimpleListItem )
virtual

Implements DocVisitor.

Definition at line 1193 of file htmldocvisitor.cpp.

References m_hide, and m_t.

{
if (m_hide) return;
m_t << "<li>";
}
void HtmlDocVisitor::visitPre ( DocSection s)
virtual

Implements DocVisitor.

Definition at line 1206 of file htmldocvisitor.cpp.

References DocSection::anchor(), convertCharEntitiesToUTF8(), endl(), filter(), forceEndParagraph(), DocSection::level(), m_hide, m_t, and DocSection::title().

{
if (m_hide) return;
m_t << "<h" << s->level() << ">";
m_t << "<a class=\"anchor\" id=\"" << s->anchor();
m_t << "\"></a>" << endl;
m_t << "</h" << s->level() << ">\n";
}
void HtmlDocVisitor::visitPre ( DocHtmlList s)
virtual

Implements DocVisitor.

Definition at line 1222 of file htmldocvisitor.cpp.

References DocHtmlList::attribs(), forceEndParagraph(), htmlAttribsToString(), m_hide, m_t, DocHtmlList::Ordered, and DocHtmlList::type().

{
if (m_hide) return;
{
m_t << "<ol" << htmlAttribsToString(s->attribs()) << ">\n";
}
else
{
m_t << "<ul" << htmlAttribsToString(s->attribs()) << ">\n";
}
}
void HtmlDocVisitor::visitPre ( DocHtmlListItem i)
virtual

Implements DocVisitor.

Definition at line 1251 of file htmldocvisitor.cpp.

References DocHtmlListItem::attribs(), htmlAttribsToString(), DocNode::isPreformatted(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<li" << htmlAttribsToString(i->attribs()) << ">";
if (!i->isPreformatted()) m_t << "\n";
}
void HtmlDocVisitor::visitPre ( DocHtmlDescList dl)
virtual

Implements DocVisitor.

Definition at line 1264 of file htmldocvisitor.cpp.

References DocHtmlDescList::attribs(), forceEndParagraph(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<dl" << htmlAttribsToString(dl->attribs()) << ">\n";
}
void HtmlDocVisitor::visitPre ( DocHtmlDescTitle dt)
virtual

Implements DocVisitor.

Definition at line 1278 of file htmldocvisitor.cpp.

References DocHtmlDescTitle::attribs(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<dt" << htmlAttribsToString(dt->attribs()) << ">";
}
void HtmlDocVisitor::visitPre ( DocHtmlDescData dd)
virtual

Implements DocVisitor.

Definition at line 1290 of file htmldocvisitor.cpp.

References DocHtmlDescData::attribs(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<dd" << htmlAttribsToString(dd->attribs()) << ">";
}
void HtmlDocVisitor::visitPre ( DocHtmlTable t)
virtual

Implements DocVisitor.

Definition at line 1302 of file htmldocvisitor.cpp.

References DocHtmlCaption::anchor(), DocHtmlTable::attribs(), DocHtmlTable::caption(), forceEndParagraph(), DocHtmlTable::hasCaption(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
if (t->hasCaption())
{
m_t << "<a class=\"anchor\" id=\"" << t->caption()->anchor() << "\"></a>\n";
}
QString attrs = htmlAttribsToString(t->attribs());
if (attrs.isEmpty())
{
m_t << "<table class=\"doxtable\">\n";
}
else
{
m_t << "<table" << htmlAttribsToString(t->attribs()) << ">\n";
}
}
void HtmlDocVisitor::visitPre ( DocHtmlRow tr)
virtual

Implements DocVisitor.

Definition at line 1331 of file htmldocvisitor.cpp.

References DocHtmlRow::attribs(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<tr" << htmlAttribsToString(tr->attribs()) << ">\n";
}
void HtmlDocVisitor::visitPre ( DocHtmlCell c)
virtual

Implements DocVisitor.

Definition at line 1343 of file htmldocvisitor.cpp.

References DocHtmlCell::attribs(), htmlAttribsToString(), DocHtmlCell::isHeading(), m_hide, and m_t.

{
if (m_hide) return;
if (c->isHeading())
{
m_t << "<th" << htmlAttribsToString(c->attribs()) << ">";
}
else
{
m_t << "<td" << htmlAttribsToString(c->attribs()) << ">";
}
}
void HtmlDocVisitor::visitPre ( DocHtmlCaption c)
virtual

Implements DocVisitor.

Definition at line 1362 of file htmldocvisitor.cpp.

References DocHtmlCaption::attribs(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<caption" << htmlAttribsToString(c->attribs()) << ">";
}
void HtmlDocVisitor::visitPre ( DocInternal )
virtual

Implements DocVisitor.

Definition at line 1374 of file htmldocvisitor.cpp.

References m_hide.

{
if (m_hide) return;
//forceEndParagraph(i);
//m_t << "<p><b>" << theTranslator->trForInternalUseOnly() << "</b></p>" << endl;
}
void HtmlDocVisitor::visitPre ( DocHRef href)
virtual

Implements DocVisitor.

Definition at line 1387 of file htmldocvisitor.cpp.

References DocHRef::attribs(), convertToXML(), correctURL(), htmlAttribsToString(), m_hide, m_t, DocHRef::relPath(), DocHRef::url(), and writeObfuscatedMailAddress().

{
if (m_hide) return;
if (href->url().left(7)=="mailto:")
{
}
else
{
QCString url = correctURL(href->url(),href->relPath());
m_t << "<a href=\"" << convertToXML(url) << "\""
<< htmlAttribsToString(href->attribs()) << ">";
}
}
void HtmlDocVisitor::visitPre ( DocHtmlHeader header)
virtual

Implements DocVisitor.

Definition at line 1408 of file htmldocvisitor.cpp.

References DocHtmlHeader::attribs(), forceEndParagraph(), htmlAttribsToString(), DocHtmlHeader::level(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<h" << header->level()
<< htmlAttribsToString(header->attribs()) << ">";
}
void HtmlDocVisitor::visitPre ( DocImage img)
virtual

Implements DocVisitor.

Definition at line 1423 of file htmldocvisitor.cpp.

References DocImage::attribs(), correctURL(), endl(), forceEndParagraph(), DocImage::hasCaption(), DocImage::height(), DocImage::Html, htmlAttribsToString(), m_hide, m_t, DocImage::name(), pushEnabled(), DocImage::relPath(), DocImage::type(), DocImage::url(), and DocImage::width().

{
if (img->type()==DocImage::Html)
{
if (m_hide) return;
QString baseName=img->name();
int i;
if ((i=baseName.findRev('/'))!=-1 || (i=baseName.findRev('\\'))!=-1)
{
baseName=baseName.right(baseName.length()-i-1);
}
m_t << "<div class=\"image\">" << endl;
QCString url = img->url();
QCString sizeAttribs;
if (!img->width().isEmpty())
{
sizeAttribs+=" width=\""+img->width()+"\"";
}
if (!img->height().isEmpty())
{
sizeAttribs+=" height=\""+img->height()+"\"";
}
if (url.isEmpty())
{
if (img->name().right(4)==".svg")
{
m_t << "<object type=\"image/svg+xml\" data=\"" << img->relPath() << img->name()
<< "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << ">" << baseName
<< "</object>" << endl;
}
else
{
m_t << "<img src=\"" << img->relPath() << img->name() << "\" alt=\""
<< baseName << "\"" << sizeAttribs << htmlAttribsToString(img->attribs())
<< "/>" << endl;
}
}
else
{
if (url.right(4)==".svg")
{
m_t << "<object type=\"image/svg+xml\" data=\"" << correctURL(url,img->relPath())
<< "\"" << sizeAttribs << htmlAttribsToString(img->attribs()) << "></object>" << endl;
}
else
{
m_t << "<img src=\"" << correctURL(url,img->relPath()) << "\""
<< sizeAttribs << htmlAttribsToString(img->attribs())
<< "/>" << endl;
}
}
if (img->hasCaption())
{
m_t << "<div class=\"caption\">" << endl;
}
}
else // other format -> skip
{
m_hide=TRUE;
}
}
void HtmlDocVisitor::visitPre ( DocDotFile df)
virtual

Implements DocVisitor.

Definition at line 1505 of file htmldocvisitor.cpp.

References DocDotFile::context(), endl(), DocDotFile::file(), DocDotFile::hasCaption(), m_hide, m_t, DocDotFile::relPath(), and writeDotFile().

{
if (m_hide) return;
m_t << "<div class=\"dotgraph\">" << endl;
writeDotFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
m_t << "<div class=\"caption\">" << endl;
}
}
void HtmlDocVisitor::visitPre ( DocMscFile df)
virtual

Implements DocVisitor.

Definition at line 1526 of file htmldocvisitor.cpp.

References DocMscFile::context(), endl(), DocMscFile::file(), DocMscFile::hasCaption(), m_hide, m_t, DocMscFile::relPath(), and writeMscFile().

{
if (m_hide) return;
m_t << "<div class=\"mscgraph\">" << endl;
writeMscFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
m_t << "<div class=\"caption\">" << endl;
}
}
void HtmlDocVisitor::visitPre ( DocDiaFile df)
virtual

Implements DocVisitor.

Definition at line 1546 of file htmldocvisitor.cpp.

References DocDiaFile::context(), endl(), DocDiaFile::file(), DocDiaFile::hasCaption(), m_hide, m_t, DocDiaFile::relPath(), and writeDiaFile().

{
if (m_hide) return;
m_t << "<div class=\"diagraph\">" << endl;
writeDiaFile(df->file(),df->relPath(),df->context());
if (df->hasCaption())
{
m_t << "<div class=\"caption\">" << endl;
}
}
void HtmlDocVisitor::visitPre ( DocLink lnk)
virtual

Implements DocVisitor.

Definition at line 1566 of file htmldocvisitor.cpp.

References DocLink::anchor(), DocLink::file(), m_hide, DocLink::ref(), DocLink::relPath(), and startLink().

{
if (m_hide) return;
startLink(lnk->ref(),lnk->file(),lnk->relPath(),lnk->anchor());
}
void HtmlDocVisitor::visitPre ( DocRef ref)
virtual

Implements DocVisitor.

Definition at line 1578 of file htmldocvisitor.cpp.

References DocRef::anchor(), DocRef::file(), filter(), DocRef::hasLinkText(), DocRef::isSubPage(), m_hide, DocRef::ref(), DocRef::relPath(), startLink(), and DocRef::targetTitle().

{
if (m_hide) return;
if (!ref->file().isEmpty())
{
// when ref->isSubPage()==TRUE we use ref->file() for HTML and
// ref->anchor() for LaTeX/RTF
startLink(ref->ref(),ref->file(),ref->relPath(),ref->isSubPage() ? QCString() : ref->anchor());
}
if (!ref->hasLinkText()) filter(ref->targetTitle());
}
void HtmlDocVisitor::visitPre ( DocSecRefItem ref)
virtual

Implements DocVisitor.

Definition at line 1597 of file htmldocvisitor.cpp.

References DocSecRefItem::anchor(), DocSecRefItem::file(), Doxygen::htmlFileExtension, m_hide, and m_t.

{
if (m_hide) return;
QString refName=ref->file();
if (refName.right(Doxygen::htmlFileExtension.length())!=
{
}
m_t << "<li><a href=\"" << refName << "#" << ref->anchor() << "\">";
}
void HtmlDocVisitor::visitPre ( DocSecRefList s)
virtual

Implements DocVisitor.

Definition at line 1616 of file htmldocvisitor.cpp.

References endl(), forceEndParagraph(), m_hide, and m_t.

{
if (m_hide) return;
m_t << "<div class=\"multicol\">" << endl;
m_t << "<ul>" << endl;
}
void HtmlDocVisitor::visitPre ( DocParamSect s)
virtual

Implements DocVisitor.

Definition at line 1651 of file htmldocvisitor.cpp.

References endl(), DocParamSect::Exception, forceEndParagraph(), m_hide, m_t, DocParamSect::Param, DocParamSect::RetVal, DocParamSect::TemplateParam, theTranslator, Translator::trExceptions(), Translator::trParameters(), Translator::trReturnValues(), Translator::trTemplateParameters(), and DocParamSect::type().

{
if (m_hide) return;
QCString className;
QCString heading;
switch(s->type())
{
className="params";
break;
className="retval";
break;
className="exception";
break;
className="tparams";
break;
default:
ASSERT(0);
}
m_t << "<dl class=\"" << className << "\"><dt>";
m_t << heading;
m_t << "</dt><dd>" << endl;
m_t << " <table class=\"" << className << "\">" << endl;
}
void HtmlDocVisitor::visitPre ( DocParamList pl)
virtual

Implements DocVisitor.

Definition at line 1693 of file htmldocvisitor.cpp.

References DocParamList::direction(), DocParamSect::hasInOutSpecifier(), DocParamSect::hasTypeSpecifier(), DocParamSect::In, DocParamSect::InOut, DocNode::kind(), DocNode::Kind_LinkedWord, DocNode::Kind_ParamSect, DocNode::Kind_Word, m_hide, m_t, DocParamSect::Out, DocParamList::parameters(), DocParamList::paramTypes(), DocNode::parent(), DocParamSect::Unspecified, and visit().

{
//printf("DocParamList::visitPre\n");
if (m_hide) return;
m_t << " <tr>";
DocParamSect *sect = 0;
{
sect=(DocParamSect*)pl->parent();
}
if (sect && sect->hasInOutSpecifier())
{
m_t << "<td class=\"paramdir\">";
{
m_t << "[";
{
m_t << "in";
}
else if (pl->direction()==DocParamSect::Out)
{
m_t << "out";
}
else if (pl->direction()==DocParamSect::InOut)
{
m_t << "in,out";
}
m_t << "]";
}
m_t << "</td>";
}
if (sect && sect->hasTypeSpecifier())
{
m_t << "<td class=\"paramtype\">";
QListIterator<DocNode> li(pl->paramTypes());
DocNode *type;
bool first=TRUE;
for (li.toFirst();(type=li.current());++li)
{
if (!first) m_t << "&#160;|&#160;"; else first=FALSE;
if (type->kind()==DocNode::Kind_Word)
{
visit((DocWord*)type);
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
visit((DocLinkedWord*)type);
}
}
m_t << "</td>";
}
m_t << "<td class=\"paramname\">";
//QStrListIterator li(pl->parameters());
//const char *s;
QListIterator<DocNode> li(pl->parameters());
DocNode *param;
bool first=TRUE;
for (li.toFirst();(param=li.current());++li)
{
if (!first) m_t << ","; else first=FALSE;
if (param->kind()==DocNode::Kind_Word)
{
visit((DocWord*)param);
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
visit((DocLinkedWord*)param);
}
}
m_t << "</td><td>";
}
void HtmlDocVisitor::visitPre ( DocXRefItem x)
virtual

Implements DocVisitor.

Definition at line 1773 of file htmldocvisitor.cpp.

References DocXRefItem::anchor(), DocXRefItem::file(), filter(), forceEndParagraph(), Doxygen::htmlFileExtension, DocXRefItem::key(), m_hide, m_t, DocXRefItem::relPath(), and DocXRefItem::title().

{
if (m_hide) return;
if (x->title().isEmpty()) return;
bool anonymousEnum = x->file()=="@";
if (!anonymousEnum)
{
m_t << "<dl class=\"" << x->key() << "\"><dt><b><a class=\"el\" href=\""
<< "#" << x->anchor() << "\">";
}
else
{
m_t << "<dl class=\"" << x->key() << "\"><dt><b>";
}
filter(x->title());
m_t << ":";
if (!anonymousEnum) m_t << "</a>";
m_t << "</b></dt><dd>";
}
void HtmlDocVisitor::visitPre ( DocInternalRef ref)
virtual

Implements DocVisitor.

Definition at line 1804 of file htmldocvisitor.cpp.

References DocInternalRef::anchor(), DocInternalRef::file(), m_hide, DocInternalRef::relPath(), and startLink().

{
if (m_hide) return;
startLink(0,ref->file(),ref->relPath(),ref->anchor());
}
void HtmlDocVisitor::visitPre ( DocCopy )
virtual

Implements DocVisitor.

Definition at line 1817 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPre ( DocText )
virtual

Implements DocVisitor.

Definition at line 1825 of file htmldocvisitor.cpp.

{
}
void HtmlDocVisitor::visitPre ( DocHtmlBlockQuote b)
virtual

Implements DocVisitor.

Definition at line 1833 of file htmldocvisitor.cpp.

References DocHtmlBlockQuote::attribs(), forceEndParagraph(), htmlAttribsToString(), m_hide, and m_t.

{
if (m_hide) return;
QString attrs = htmlAttribsToString(b->attribs());
if (attrs.isEmpty())
{
m_t << "<blockquote class=\"doxtable\">\n";
}
else
{
m_t << "<blockquote" << htmlAttribsToString(b->attribs()) << ">\n";
}
}
void HtmlDocVisitor::visitPre ( DocVhdlFlow vf)
virtual

Implements DocVisitor.

Definition at line 1855 of file htmldocvisitor.cpp.

References FlowChart::convertNameToFileName(), forceEndParagraph(), VhdlDocGen::getFlowMember(), DocVhdlFlow::hasCaption(), m_hide, m_t, and Definition::name().

{
if (m_hide) return;
if (VhdlDocGen::getFlowMember()) // use VHDL flow chart creator
{
m_t << "<p>";
m_t << "flowchart: " ; // TODO: translate me
m_t << "<a href=\"";
m_t << fname.data();
m_t << ".svg\">";
m_t << "</a>";
if (vf->hasCaption())
{
m_t << "<br />";
}
}
}
void HtmlDocVisitor::visitPre ( DocParBlock )
virtual

Implements DocVisitor.

Definition at line 1886 of file htmldocvisitor.cpp.

References m_hide.

{
if (m_hide) return;
}
void HtmlDocVisitor::writeDiaFile ( const QCString &  fileName,
const QCString &  relPath,
const QCString &  context 
)
private

Definition at line 2021 of file htmldocvisitor.cpp.

References Config_getString, DIA_BITMAP, endl(), m_t, and writeDiaGraphFromFile().

Referenced by visitPre().

{
QCString baseName=fileName;
int i;
if ((i=baseName.findRev('/'))!=-1) // strip path
{
baseName=baseName.right(baseName.length()-i-1);
}
if ((i=baseName.find('.'))!=-1) // strip extension
{
baseName=baseName.left(i);
}
baseName.prepend("dia_");
QCString outDir = Config_getString(HTML_OUTPUT);
writeDiaGraphFromFile(fileName,outDir,baseName,DIA_BITMAP);
m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />" << endl;
}
void HtmlDocVisitor::writeDotFile ( const QCString &  fileName,
const QCString &  relPath,
const QCString &  context 
)
private

Definition at line 1978 of file htmldocvisitor.cpp.

References Config_getString, GOF_BITMAP, m_t, writeDotGraphFromFile(), and writeDotImageMapFromFile().

Referenced by visit(), and visitPre().

{
QCString baseName=fn;
int i;
if ((i=baseName.findRev('/'))!=-1)
{
baseName=baseName.right(baseName.length()-i-1);
}
if ((i=baseName.find('.'))!=-1) // strip extension
{
baseName=baseName.left(i);
}
baseName.prepend("dot_");
QCString outDir = Config_getString(HTML_OUTPUT);
writeDotGraphFromFile(fn,outDir,baseName,GOF_BITMAP);
writeDotImageMapFromFile(m_t,fn,outDir,relPath,baseName,context);
}
void HtmlDocVisitor::writeMscFile ( const QCString &  fileName,
const QCString &  relPath,
const QCString &  context 
)
private

Definition at line 1997 of file htmldocvisitor.cpp.

References Config_getString, getDotImageExtension(), m_t, MSC_BITMAP, MSC_SVG, writeMscGraphFromFile(), and writeMscImageMapFromFile().

Referenced by visit(), and visitPre().

{
QCString baseName=fileName;
int i;
if ((i=baseName.findRev('/'))!=-1) // strip path
{
baseName=baseName.right(baseName.length()-i-1);
}
if ((i=baseName.find('.'))!=-1) // strip extension
{
baseName=baseName.left(i);
}
baseName.prepend("msc_");
QCString outDir = Config_getString(HTML_OUTPUT);
QCString imgExt = getDotImageExtension();
if ("svg" == imgExt)
mscFormat = MSC_SVG;
writeMscGraphFromFile(fileName,outDir,baseName,mscFormat);
writeMscImageMapFromFile(m_t,fileName,outDir,relPath,baseName,context,mscFormat);
}
void HtmlDocVisitor::writeObfuscatedMailAddress ( const QCString &  url)
private

Definition at line 204 of file htmldocvisitor.cpp.

References m_t.

Referenced by visit(), and visitPre().

{
m_t << "<a href=\"#\" onclick=\"location.href='mai'+'lto:'";
uint i;
int size=3;
for (i=0;i<url.length();)
{
m_t << "+'" << url.mid(i,size) << "'";
i+=size;
if (size==3) size=2; else size=3;
}
m_t << "; return false;\">";
}
void HtmlDocVisitor::writePlantUMLFile ( const QCString &  fileName,
const QCString &  relPath,
const QCString &  context 
)
private

Definition at line 2042 of file htmldocvisitor.cpp.

References Config_getString, endl(), generatePlantUMLOutput(), getDotImageExtension(), m_t, PUML_BITMAP, and PUML_SVG.

Referenced by visit().

{
QCString baseName=fileName;
int i;
if ((i=baseName.findRev('/'))!=-1) // strip path
{
baseName=baseName.right(baseName.length()-i-1);
}
if ((i=baseName.findRev('.'))!=-1) // strip extension
{
baseName=baseName.left(i);
}
static QCString outDir = Config_getString(HTML_OUTPUT);
QCString imgExt = getDotImageExtension();
if (imgExt=="svg")
{
generatePlantUMLOutput(fileName,outDir,PUML_SVG);
//m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />" << endl;
//m_t << "<p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p>";
//m_t << "</iframe>" << endl;
m_t << "<object type=\"image/svg+xml\" data=\"" << relPath << baseName << ".svg\"></object>" << endl;
}
else
{
m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />" << endl;
}
}

Member Data Documentation

CodeOutputInterface& HtmlDocVisitor::m_ci
private

Definition at line 169 of file htmldocvisitor.h.

Referenced by visit().

Definition* HtmlDocVisitor::m_ctx
private

Definition at line 173 of file htmldocvisitor.h.

Referenced by visit().

QStack<bool> HtmlDocVisitor::m_enabled
private

Definition at line 172 of file htmldocvisitor.h.

Referenced by popEnabled(), and pushEnabled().

bool HtmlDocVisitor::m_hide
private

Definition at line 171 of file htmldocvisitor.h.

Referenced by popEnabled(), pushEnabled(), visit(), visitPost(), and visitPre().

bool HtmlDocVisitor::m_insidePre
private

Definition at line 170 of file htmldocvisitor.h.

Referenced by visit().

QCString HtmlDocVisitor::m_langExt
private

Definition at line 174 of file htmldocvisitor.h.

Referenced by HtmlDocVisitor(), and visit().

FTextStream& HtmlDocVisitor::m_t
private

The documentation for this class was generated from the following files: