void RTFDocVisitor::visitPost(DocTitle *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocTitle)}\n"); m_t << "\\par" << endl; m_t << "}"; // end bold incIndentLevel(); m_t << rtf_Style_Reset << getStyle("DescContinue"); m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocSecRefList *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSecRefList)}\n"); m_t << "{" << endl; incIndentLevel(); m_t << rtf_Style_Reset << getStyle("LatexTOC") << endl; m_t << "\\par" << endl; m_lastIsPara=TRUE; }
void RTFDocVisitor::visitPost(DocXRefItem *x) { if (m_hide) return; if (x->title().isEmpty()) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n"); m_t << "\\par" << endl; decIndentLevel(); m_t << "}" << endl; // end xref item m_lastIsPara=TRUE; }
void RTFDocVisitor::visitPre(DocSimpleSect *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSimpleSect)}\n"); if (!m_lastIsPara) m_t << "\\par" << endl; m_t << "{"; // start desc //m_t << "{\\b "; // start bold m_t << "{" << rtf_Style["Heading5"]->reference << endl; switch(s->type()) { case DocSimpleSect::See: m_t << theTranslator->trSeeAlso(); break; case DocSimpleSect::Return: m_t << theTranslator->trReturns(); break; case DocSimpleSect::Author: m_t << theTranslator->trAuthor(TRUE,TRUE); break; case DocSimpleSect::Authors: m_t << theTranslator->trAuthor(TRUE,FALSE); break; case DocSimpleSect::Version: m_t << theTranslator->trVersion(); break; case DocSimpleSect::Since: m_t << theTranslator->trSince(); break; case DocSimpleSect::Date: m_t << theTranslator->trDate(); break; case DocSimpleSect::Note: m_t << theTranslator->trNote(); break; case DocSimpleSect::Warning: m_t << theTranslator->trWarning(); break; case DocSimpleSect::Pre: m_t << theTranslator->trPrecondition(); break; case DocSimpleSect::Post: m_t << theTranslator->trPostcondition(); break; case DocSimpleSect::Invar: m_t << theTranslator->trInvariant(); break; case DocSimpleSect::Remark: m_t << theTranslator->trRemarks(); break; case DocSimpleSect::Attention: m_t << theTranslator->trAttention(); break; case DocSimpleSect::User: break; case DocSimpleSect::Rcs: break; case DocSimpleSect::Unknown: break; } // special case 1: user defined title if (s->type()!=DocSimpleSect::User && s->type()!=DocSimpleSect::Rcs) { m_t << ":"; m_t << "\\par"; m_t << "}"; // end bold incIndentLevel(); m_t << rtf_Style_Reset << getStyle("DescContinue"); } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocXRefItem *x) { if (m_hide) return; if (x->title().isEmpty()) return; bool anonymousEnum = x->file()=="@"; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocXRefItem)}\n"); if (!m_lastIsPara) { m_t << "\\par" << endl; m_lastIsPara=TRUE; } m_t << "{"; // start param list //m_t << "{\\b "; // start bold m_t << "{" << rtf_Style["Heading5"]->reference << endl; if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum) { QCString refName; if (!x->file().isEmpty()) { refName+=x->file(); } if (!x->file().isEmpty() && !x->anchor().isEmpty()) { refName+="_"; } if (!x->anchor().isEmpty()) { refName+=x->anchor(); } m_t << "{\\field " "{\\*\\fldinst " "{ HYPERLINK \\\\l \"" << refName << "\" " "}{}" "}" "{\\fldrslt " "{\\cs37\\ul\\cf2 "; filter(x->title()); m_t << "}" "}" "}"; } else { filter(x->title()); } m_t << ":"; m_t << "\\par"; m_t << "}"; // end bold incIndentLevel(); m_t << rtf_Style_Reset << getStyle("DescContinue"); m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPost(DocHtmlHeader *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlHeader)}\n"); if (isTableOfContentEntriesEnabled()) { // close open table of contens entry m_t << "} \\par"; } m_t << "}" << endl; // end section m_lastIsPara=TRUE; }
void RTFDocVisitor::visitPre(DocInternal *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocInternal)}\n"); m_t << "{"; // start desc m_t << "{\\b "; // start bold m_t << theTranslator->trForInternalUseOnly(); m_t << "}"; // end bold m_t << "\\par" << endl; incIndentLevel(); m_t << rtf_Style_Reset << getStyle("DescContinue"); m_lastIsPara=FALSE; }
void RTFDocVisitor::visit(DocWhiteSpace *w) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n"); if (m_insidePre) { m_t << w->chars(); } else { m_t << " "; } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPost(DocParamSect *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocParamSect)}\n"); //m_t << "\\par" << endl; bool useTable = s->type()==DocParamSect::Param || s->type()==DocParamSect::RetVal || s->type()==DocParamSect::Exception || s->type()==DocParamSect::TemplateParam; if (!useTable) { decIndentLevel(); } m_t << "}" << endl; }
void RTFDocVisitor::visit(DocSymbol *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n"); const char *res = HtmlEntityMapper::instance()->rtf(s->symbol()); if (res) { m_t << res; } else { err("RTF: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPost(DocPara *p) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocPara)}\n"); if (!m_lastIsPara && !p->isLast() && // omit <p> for last paragraph !(p->parent() && // and for parameters & sections p->parent()->kind()==DocNode::Kind_ParamSect ) ) { m_t << "\\par" << endl; m_lastIsPara=TRUE; } }
void RTFDocVisitor::visit(DocStyleChange *s) { if (m_hide) return; m_lastIsPara=FALSE; DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n"); switch (s->style()) { case DocStyleChange::Bold: if (s->enable()) m_t << "{\\b "; else m_t << "} "; break; case DocStyleChange::Italic: if (s->enable()) m_t << "{\\i "; else m_t << "} "; break; case DocStyleChange::Code: if (s->enable()) m_t << "{\\f2 "; else m_t << "} "; break; case DocStyleChange::Subscript: if (s->enable()) m_t << "{\\sub "; else m_t << "} "; break; case DocStyleChange::Superscript: if (s->enable()) m_t << "{\\super "; else m_t << "} "; break; case DocStyleChange::Center: if (s->enable()) m_t << "{\\qc "; else m_t << "} "; break; case DocStyleChange::Small: if (s->enable()) m_t << "{\\sub "; else m_t << "} "; break; case DocStyleChange::Preformatted: if (s->enable()) { m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); m_insidePre=TRUE; } else { m_insidePre=FALSE; m_t << "\\par"; m_t << "}" << endl; } m_lastIsPara=TRUE; break; case DocStyleChange::Div: /* HTML only */ break; case DocStyleChange::Span: /* HTML only */ break; } }
void RTFDocVisitor::visit(DocInclude *inc) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n"); switch(inc->type()) { case DocInclude::IncWithLines: { m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); QFileInfo cfi( inc->file() ); FileDef fd( cfi.dirPath(), cfi.fileName() ); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(), inc->isExample(), inc->exampleFile(), &fd); m_t << "\\par"; m_t << "}" << endl; } break; case DocInclude::Include: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); Doxygen::parserManager->getParser(inc->extension()) ->parseCode(m_ci,inc->context(), inc->text(),inc->isExample(), inc->exampleFile()); m_t << "\\par"; m_t << "}" << endl; break; case DocInclude::DontInclude: break; case DocInclude::HtmlInclude: break; case DocInclude::VerbInclude: m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); filter(inc->text()); m_t << "\\par"; m_t << "}" << endl; break; } m_lastIsPara=TRUE; }
void RTFDocVisitor::visitPre(DocRef *ref) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocRef)}\n"); // when ref->isSubPage()==TRUE we use ref->file() for HTML and // ref->anchor() for LaTeX/RTF if (ref->isSubPage()) { startLink(ref->ref(),0,ref->anchor()); } else { if (!ref->file().isEmpty()) startLink(ref->ref(),ref->file(),ref->anchor()); } if (!ref->hasLinkText()) filter(ref->targetTitle()); }
void RTFDocVisitor::visitPre(DocHtmlHeader *header) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlHeader)}\n"); m_t << "{" // start section << rtf_Style_Reset; QCString heading; int level = QMIN(header->level()+2,4); heading.sprintf("Heading%d",level); // set style m_t << rtf_Style[heading]->reference; // make table of contents entry m_t << "{\\tc\\tcl \\v " << level << "}"; m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPost(DocHRef *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHRef)}\n"); if (Config_getBool("RTF_HYPERLINKS")) { m_t << "}" "}" "}"; } else { m_t << "}"; } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocParamList *pl) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamList)}\n"); // Put in the direction: in/out/in,out if specified. if (pl->direction()!=DocParamSect::Unspecified) { m_t << "["; if (pl->direction()==DocParamSect::In) { 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 << "{\\i "; //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 << "} "; m_lastIsPara=TRUE; }
void RTFDocVisitor::visit(DocIncOperator *op) { //printf("DocIncOperator: type=%d first=%d, last=%d text=`%s'\n", // op->type(),op->isFirst(),op->isLast(),op->text().data()); DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n"); SrcLangExt langExt = getLanguageFromFileName(m_langExt); if (op->isFirst()) { if (!m_hide) { m_t << "{" << endl; m_t << "\\par" << endl; m_t << rtf_Style_Reset << getStyle("CodeExample"); } pushEnabled(); m_hide = TRUE; } if (op->type()!=DocIncOperator::Skip) { popEnabled(); if (!m_hide) { Doxygen::parserManager->getParser(m_langExt) ->parseCode(m_ci,op->context(),op->text(),langExt, op->isExample(),op->exampleFile()); } pushEnabled(); m_hide=TRUE; } if (op->isLast()) { popEnabled(); if (!m_hide) { m_t << "\\par"; m_t << "}" << endl; } m_lastIsPara=TRUE; } else { if (!m_hide) m_t << endl; m_lastIsPara=FALSE; } }
void RTFDocVisitor::visitPre(DocHtmlHeader *header) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlHeader)}\n"); m_t << "{" // start section << rtf_Style_Reset; QCString heading; int level = QMIN(header->level(), 4); heading.sprintf("Heading%d",level); // set style m_t << rtf_Style[heading]->reference; if (isTableOfContentEntriesEnabled()) { // make open table of contents entry that will be closed in visitPost method m_t << "{\\tc\\tcl" << level << " "; } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocHtmlListItem *) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlListItem)}\n"); m_t << "\\par" << endl; m_t << rtf_Style_Reset; if (rtf_listItemInfo[m_indentLevel].isEnum) { m_t << getStyle("ListEnum") << endl; m_t << rtf_listItemInfo[m_indentLevel].number << ".\\tab "; rtf_listItemInfo[m_indentLevel].number++; } else { m_t << getStyle("ListBullet") << endl; } incIndentLevel(); m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocParamSect *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocParamSect)}\n"); m_t << "{"; // start param list if (!m_lastIsPara) m_t << "\\par" << endl; //m_t << "{\\b "; // start bold m_t << "{" << rtf_Style["Heading5"]->reference << endl; switch(s->type()) { case DocParamSect::Param: m_t << theTranslator->trParameters(); break; case DocParamSect::RetVal: m_t << theTranslator->trReturnValues(); break; case DocParamSect::Exception: m_t << theTranslator->trExceptions(); break; case DocParamSect::TemplateParam: /* TODO: add this m_t << theTranslator->trTemplateParam(); break; */ m_t << "Template Parameters"; break; default: ASSERT(0); } m_t << ":"; m_t << "\\par"; m_t << "}" << endl; bool useTable = s->type()==DocParamSect::Param || s->type()==DocParamSect::RetVal || s->type()==DocParamSect::Exception || s->type()==DocParamSect::TemplateParam; if (!useTable) { incIndentLevel(); } m_t << rtf_Style_Reset << getStyle("DescContinue"); m_lastIsPara=TRUE; }
void RTFDocVisitor::visitPre(DocSection *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocSection)}\n"); if (!m_lastIsPara) m_t << "\\par" << endl; m_t << "{{" // start section << rtf_Style_Reset; QCString heading; int level = QMIN(s->level()+1,4); heading.sprintf("Heading%d",level); // set style m_t << rtf_Style[heading]->reference << endl; // make table of contents entry filter(s->title()); m_t << endl << "\\par" << "}" << endl; m_t << "{\\tc\\tcl" << level << " \\v "; filter(s->title()); m_t << "}" << endl; m_lastIsPara=TRUE; }
void RTFDocVisitor::visit(DocAnchor *anc) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n"); QCString anchor; if (!anc->file().isEmpty()) { anchor+=anc->file(); } if (!anc->file().isEmpty() && !anc->anchor().isEmpty()) { anchor+="_"; } if (!anc->anchor().isEmpty()) { anchor+=anc->anchor(); } m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}" << endl; m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}" << endl; m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocHRef *href) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHRef)}\n"); if (Config_getBool("RTF_HYPERLINKS")) { m_t << "{\\field " "{\\*\\fldinst " "{ HYPERLINK \\\\l \"" << href->url() << "\" " "}{}" "}" "{\\fldrslt " "{\\cs37\\ul\\cf2 "; } else { m_t << "{\\f2 "; } m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPre(DocImage *img) { DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocImage)}\n"); if (img->type()==DocImage::Rtf) { m_t << "\\par" << endl; m_t << "{" << endl; m_t << rtf_Style_Reset << endl; m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \""; m_t << img->name(); m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl; m_t << "}" << endl; m_lastIsPara=TRUE; } else // other format -> skip { } // hide caption since it is not supported at the moment pushEnabled(); m_hide=TRUE; }
void RTFDocVisitor::visit(DocCite *cite) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocCite)}\n"); if (!cite->file().isEmpty()) { startLink(cite->ref(),cite->file(),cite->anchor()); } else { m_t << "{\\b "; } filter(cite->text()); if (!cite->file().isEmpty()) { endLink(cite->ref()); } else { m_t << "}"; } }
void RTFDocVisitor::visitPre(DocHtmlRow *r) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n"); uint i,columnWidth=r->numCells()>0 ? rtf_pageWidth/r->numCells() : 10; m_t << "\\trowd \\trgaph108\\trleft-108" "\\trbrdrt\\brdrs\\brdrw10 " "\\trbrdrl\\brdrs\\brdrw10 " "\\trbrdrb\\brdrs\\brdrw10 " "\\trbrdrr\\brdrs\\brdrw10 " "\\trbrdrh\\brdrs\\brdrw10 " "\\trbrdrv\\brdrs\\brdrw10 "<< endl; for (i=0;i<r->numCells();i++) { m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 " "\\clbrdrl\\brdrs\\brdrw10 " "\\clbrdrb\\brdrs\\brdrw10 " "\\clbrdrr \\brdrs\\brdrw10 " "\\cltxlrtb " "\\cellx" << ((i+1)*columnWidth) << endl; } m_t << "\\pard \\widctlpar\\intbl\\adjustright" << endl; m_lastIsPara=FALSE; }
void RTFDocVisitor::visitPost(DocHtmlCaption *) { DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlCaption)}\n"); }
void RTFDocVisitor::visitPost(DocHtmlListItem *) { decIndentLevel(); DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n"); }
void RTFDocVisitor::visitPre(DocTitle *) { DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocTitle)}\n"); }