Skip to main content

The RTFDocVisitor Class Reference

Concrete visitor implementation for RTF output. More...

Declaration

class RTFDocVisitor { ... }

Included Headers

Base class

classDocVisitor

Helper base class for functionality shared by all visitors. More...

Public Constructors Index

RTFDocVisitor (TextStream &t, OutputCodeList &ci, const QCString &langExt, int hierarchyLevel=0)

Public Operators Index

voidoperator() (const DocWord &)
voidoperator() (const DocLinkedWord &)
voidoperator() (const DocWhiteSpace &)
voidoperator() (const DocSymbol &)
voidoperator() (const DocEmoji &)
voidoperator() (const DocURL &)
voidoperator() (const DocLineBreak &)
voidoperator() (const DocHorRuler &)
voidoperator() (const DocStyleChange &)
voidoperator() (const DocVerbatim &)
voidoperator() (const DocAnchor &)
voidoperator() (const DocInclude &)
voidoperator() (const DocIncOperator &)
voidoperator() (const DocFormula &)
voidoperator() (const DocIndexEntry &)
voidoperator() (const DocSimpleSectSep &)
voidoperator() (const DocCite &)
voidoperator() (const DocSeparator &)
voidoperator() (const DocAutoList &)
voidoperator() (const DocAutoListItem &)
voidoperator() (const DocPara &)
voidoperator() (const DocRoot &)
voidoperator() (const DocSimpleSect &)
voidoperator() (const DocTitle &)
voidoperator() (const DocSimpleList &)
voidoperator() (const DocSimpleListItem &)
voidoperator() (const DocSection &s)
voidoperator() (const DocHtmlList &s)
voidoperator() (const DocHtmlListItem &)
voidoperator() (const DocHtmlDescList &)
voidoperator() (const DocHtmlDescTitle &)
voidoperator() (const DocHtmlDescData &)
voidoperator() (const DocHtmlTable &t)
voidoperator() (const DocHtmlCaption &)
voidoperator() (const DocHtmlRow &)
voidoperator() (const DocHtmlCell &)
voidoperator() (const DocInternal &)
voidoperator() (const DocHRef &)
voidoperator() (const DocHtmlSummary &)
voidoperator() (const DocHtmlDetails &)
voidoperator() (const DocHtmlHeader &)
voidoperator() (const DocImage &)
voidoperator() (const DocDotFile &)
voidoperator() (const DocMscFile &)
voidoperator() (const DocDiaFile &)
voidoperator() (const DocPlantUmlFile &)
voidoperator() (const DocLink &)
voidoperator() (const DocRef &ref)
voidoperator() (const DocSecRefItem &)
voidoperator() (const DocSecRefList &)
voidoperator() (const DocParamSect &)
voidoperator() (const DocParamList &)
voidoperator() (const DocXRefItem &)
voidoperator() (const DocInternalRef &)
voidoperator() (const DocText &)
voidoperator() (const DocHtmlBlockQuote &)
voidoperator() (const DocVhdlFlow &)
voidoperator() (const DocParBlock &)

Private Member Functions Index

template <class T>
voidvisitChildren (const T &t)
voidfilter (const QCString &str, bool verbatim=FALSE)
voidstartLink (const QCString &ref, const QCString &file, const QCString &anchor)
voidendLink (const QCString &ref)
QCStringgetStyle (const QCString &name)
QCStringgetListTable (const int id)
intindentLevel () const
voidincIndentLevel ()
voiddecIndentLevel ()
voidincludePicturePreRTF (const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
voidincludePicturePostRTF (bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)
voidwriteDotFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
voidwriteDotFile (const DocDotFile &)
voidwriteMscFile (const QCString &fileName, bool hasCaption, const QCString &srcFile, int srcLine)
voidwriteMscFile (const DocMscFile &)
voidwriteDiaFile (const DocDiaFile &)
voidwritePlantUMLFile (const QCString &fileName, bool hasCaption)

Private Member Attributes Index

TextStream &m_t
OutputCodeList &m_ci
boolm_insidePre = false
boolm_hide = false
boolm_lastIsPara = false
QCStringm_langExt
intm_indentLevel = 0
intm_hierarchyLevel = 0
RTFListItemInfom_listItemInfo[maxIndentLevels]

Private Static Attributes Index

static const intmaxIndentLevels = 13

Description

Concrete visitor implementation for RTF output.

Definition at line 31 of file rtfdocvisitor.h.

Public Constructors

RTFDocVisitor()

RTFDocVisitor::RTFDocVisitor (TextStream & t, OutputCodeList & ci, const QCString & langExt, int hierarchyLevel=0)

Declaration at line 34 of file rtfdocvisitor.h, definition at line 70 of file rtfdocvisitor.cpp.

71 const QCString &langExt, int hierarchyLevel)
72 : m_t(t), m_ci(ci), m_langExt(langExt), m_hierarchyLevel(hierarchyLevel)
73{
74}

References m_ci, m_hierarchyLevel, m_langExt and m_t.

Public Operators

operator()()

void RTFDocVisitor::operator() (const DocWord & w)

Declaration at line 40 of file rtfdocvisitor.h, definition at line 119 of file rtfdocvisitor.cpp.

120{
121 if (m_hide) return;
122 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWord)}\n");
123 filter(w.word());
125}

References DBG_RTF, FALSE, filter, m_hide, m_lastIsPara and DocWord::word.

operator()()

void RTFDocVisitor::operator() (const DocLinkedWord & w)

Declaration at line 41 of file rtfdocvisitor.h, definition at line 127 of file rtfdocvisitor.cpp.

128{
129 if (m_hide) return;
130 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLinkedWord)}\n");
131 startLink(w.ref(),w.file(),w.anchor());
132 filter(w.word());
133 endLink(w.ref());
135}

References DocLinkedWord::anchor, DBG_RTF, endLink, FALSE, DocLinkedWord::file, filter, m_hide, m_lastIsPara, DocLinkedWord::ref, startLink and DocLinkedWord::word.

operator()()

void RTFDocVisitor::operator() (const DocWhiteSpace & w)

Declaration at line 42 of file rtfdocvisitor.h, definition at line 137 of file rtfdocvisitor.cpp.

138{
139 if (m_hide) return;
140 DBG_RTF("{\\comment RTFDocVisitor::visit(DocWhiteSpace)}\n");
141 if (m_insidePre)
142 {
143 m_t << w.chars();
144 }
145 else
146 {
147 m_t << " ";
148 }
150}

References DocWhiteSpace::chars, DBG_RTF, FALSE, m_hide, m_insidePre, m_lastIsPara and m_t.

operator()()

void RTFDocVisitor::operator() (const DocSymbol & s)

Declaration at line 43 of file rtfdocvisitor.h, definition at line 152 of file rtfdocvisitor.cpp.

153{
154 if (m_hide) return;
155 DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n");
156 const char *res = HtmlEntityMapper::instance().rtf(s.symbol());
157 if (res)
158 {
159 m_t << res;
160 }
161 else
162 {
163 err("RTF: non supported HTML-entity found: {}\n",HtmlEntityMapper::instance().html(s.symbol(),TRUE));
164 }
166}

References DBG_RTF, err, FALSE, HtmlEntityMapper::instance, m_hide, m_lastIsPara, m_t, HtmlEntityMapper::rtf, DocSymbol::symbol and TRUE.

operator()()

void RTFDocVisitor::operator() (const DocEmoji & s)

Declaration at line 44 of file rtfdocvisitor.h, definition at line 168 of file rtfdocvisitor.cpp.

169{
170 if (m_hide) return;
171 DBG_RTF("{\\comment RTFDocVisitor::visit(DocEmoji)}\n");
172 const char *res = EmojiEntityMapper::instance().unicode(s.index());
173 if (res)
174 {
175 const char *p = res;
176 int val = 0;
177 int val1 = 0;
178 while (*p)
179 {
180 switch(*p)
181 {
182 case '&': case '#': case 'x':
183 break;
184 case ';':
185 val1 = val;
186 val = 55296 + ( ( val1 - 65536 ) & 1047552 ) / 1024 - 0x10000;
187 m_t << "\\u" << val << "?";
188 val = 56320 + ( ( val1 - 65536 ) & 1023 ) - 65536 ;
189 m_t << "\\u" << val << "?";
190 val = 0;
191 break;
192 case '0': case '1': case '2': case '3': case '4':
193 case '5': case '6': case '7': case '8': case '9':
194 val = val * 16 + *p - '0';
195 break;
196 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
197 val = val * 16 + *p - 'a' + 10;
198 break;
199 }
200 p++;
201 }
202 }
203 else
204 {
205 m_t << s.name();
206 }
208}

References DBG_RTF, FALSE, DocEmoji::index, EmojiEntityMapper::instance, m_hide, m_lastIsPara, m_t, DocEmoji::name and EmojiEntityMapper::unicode.

operator()()

void RTFDocVisitor::operator() (const DocURL & u)

Declaration at line 45 of file rtfdocvisitor.h, definition at line 210 of file rtfdocvisitor.cpp.

211{
212 if (m_hide) return;
213 DBG_RTF("{\\comment RTFDocVisitor::visit(DocURL)}\n");
214 if (Config_getBool(RTF_HYPERLINKS))
215 {
216 m_t << "{\\field "
217 "{\\*\\fldinst "
218 "{ HYPERLINK \"";
219 if (u.isEmail()) m_t << "mailto:";
220 m_t << u.url();
221 m_t << "\" }"
222 "{}";
223 m_t << "}"
224 "{\\fldrslt "
225 "{\\cs37\\ul\\cf2 ";
226 filter(u.url());
227 m_t << "}"
228 "}"
229 "}\n";
230 }
231 else
232 {
233 m_t << "{\\f2 ";
234 filter(u.url());
235 m_t << "}";
236 }
238}

References Config_getBool, DBG_RTF, FALSE, filter, DocURL::isEmail, m_hide, m_lastIsPara, m_t and DocURL::url.

operator()()

void RTFDocVisitor::operator() (const DocLineBreak &)

Declaration at line 46 of file rtfdocvisitor.h, definition at line 240 of file rtfdocvisitor.cpp.

241{
242 if (m_hide) return;
243 DBG_RTF("{\\comment RTFDocVisitor::visit(DocLineBreak)}\n");
244 m_t << "\\par\n";
246}

References DBG_RTF, m_hide, m_lastIsPara, m_t and TRUE.

operator()()

void RTFDocVisitor::operator() (const DocHorRuler &)

Declaration at line 47 of file rtfdocvisitor.h, definition at line 248 of file rtfdocvisitor.cpp.

249{
250 if (m_hide) return;
251 DBG_RTF("{\\comment RTFDocVisitor::visit(DocHorRuler)}\n");
252 m_t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}\n";
254}

References DBG_RTF, m_hide, m_lastIsPara, m_t and TRUE.

operator()()

void RTFDocVisitor::operator() (const DocStyleChange & s)

Declaration at line 48 of file rtfdocvisitor.h, definition at line 256 of file rtfdocvisitor.cpp.

257{
258 if (m_hide) return;
260 DBG_RTF("{\\comment RTFDocVisitor::visit(DocStyleChange)}\n");
261 switch (s.style())
262 {
264 if (s.enable()) m_t << "{\\b "; else m_t << "} ";
265 break;
269 if (s.enable()) m_t << "{\\strike "; else m_t << "} ";
270 break;
273 if (s.enable()) m_t << "{\\ul "; else m_t << "} ";
274 break;
276 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
277 break;
281 if (s.enable()) m_t << "{\\f2 "; else m_t << "} ";
282 break;
284 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
285 break;
287 if (s.enable()) m_t << "{\\super "; else m_t << "} ";
288 break;
290 if (s.enable()) m_t << "{\\qc "; else m_t << "} ";
291 break;
293 if (s.enable()) m_t << "{\\sub "; else m_t << "} ";
294 break;
296 if (s.enable()) m_t << "{\\i "; else m_t << "} ";
297 break;
299 if (s.enable())
300 {
301 m_t << "{\n";
302 m_t << "\\par\n";
303 m_t << rtf_Style_Reset << getStyle("CodeExample");
305 }
306 else
307 {
309 m_t << "\\par";
310 m_t << "}\n";
311 }
313 break;
314 case DocStyleChange::Div: /* HTML only */ break;
315 case DocStyleChange::Span: /* HTML only */ break;
316 }
317}

References DocStyleChange::Bold, DocStyleChange::Center, DocStyleChange::Cite, DocStyleChange::Code, DBG_RTF, DocStyleChange::Del, DocStyleChange::Div, DocStyleChange::enable, FALSE, getStyle, DocStyleChange::Ins, DocStyleChange::Italic, DocStyleChange::Kbd, m_hide, m_insidePre, m_lastIsPara, m_t, DocStyleChange::Preformatted, rtf_Style_Reset, DocStyleChange::S, DocStyleChange::Small, DocStyleChange::Span, DocStyleChange::Strike, DocStyleChange::style, DocStyleChange::Subscript, DocStyleChange::Superscript, TRUE, DocStyleChange::Typewriter and DocStyleChange::Underline.

operator()()

void RTFDocVisitor::operator() (const DocVerbatim & s)

Declaration at line 49 of file rtfdocvisitor.h, definition at line 319 of file rtfdocvisitor.cpp.

320{
321 if (m_hide) return;
322 DBG_RTF("{\\comment RTFDocVisitor::visit(DocVerbatim)}\n");
323 QCString lang = m_langExt;
324 if (!s.language().isEmpty()) // explicit language setting
325 {
326 lang = s.language();
327 }
328 SrcLangExt langExt = getLanguageFromCodeLang(lang);
329 switch(s.type())
330 {
332 m_t << "{\n";
333 m_t << "\\par\n";
334 m_t << rtf_Style_Reset << getStyle("CodeExample");
335 getCodeParser(lang).parseCode(m_ci,s.context(),s.text(),langExt,
336 Config_getBool(STRIP_CODE_COMMENTS),
337 s.isExample(),s.exampleFile());
338 //m_t << "\\par\n";
339 m_t << "}\n";
340 break;
342 filter(s.text(),TRUE);
343 break;
345 m_t << "{\n";
346 m_t << "{\\f2 ";
347 filter(s.text(),TRUE);
348 m_t << "}";
349 m_t << "}\n";
350 break;
352 m_t << "{\n";
353 m_t << "\\par\n";
354 m_t << rtf_Style_Reset << getStyle("CodeExample");
355 filter(s.text(),TRUE);
356 //m_t << "\\par\n";
357 m_t << "}\n";
358 break;
360 m_t << s.text();
361 break;
367 /* nothing */
368 break;
370 {
371 static int dotindex = 1;
372 QCString fileName(4096, QCString::ExplicitSize);
373
374 fileName.sprintf("%s%d%s",
375 qPrint(Config_getString(RTF_OUTPUT)+"/inline_dotgraph_"),
376 dotindex++,
377 ".dot"
378 );
379 std::ofstream file = Portable::openOutputStream(fileName);
380 if (!file.is_open())
381 {
382 err("Could not open file {} for writing\n",qPrint(fileName));
383 }
384 else
385 {
386 QCString stext = s.text();
387 file.write( stext.data(), stext.length() );
388 file.close();
389 }
390
391 writeDotFile(fileName, s.hasCaption(), s.srcFile(), s.srcLine());
394
395 if (Config_getBool(DOT_CLEANUP)) Dir().remove(fileName.str());
396 }
397 break;
399 {
400 static int mscindex = 1;
401 QCString baseName(4096, QCString::ExplicitSize);
402
403 baseName.sprintf("%s%d%s",
404 qPrint(Config_getString(RTF_OUTPUT)+"/inline_mscgraph_"),
405 mscindex++,
406 ".msc"
407 );
408 std::ofstream file = Portable::openOutputStream(baseName);
409 if (!file.is_open())
410 {
411 err("Could not open file {} for writing\n",qPrint(baseName));
412 }
413 QCString text = "msc {";
414 text+=s.text();
415 text+="}";
416 file.write( text.data(), text.length() );
417 file.close();
418
419 writeMscFile(baseName, s.hasCaption(), s.srcFile(), s.srcLine());
422
423 if (Config_getBool(DOT_CLEANUP)) Dir().remove(baseName.str());
424 }
425 break;
427 {
428 QCString rtfOutput = Config_getString(RTF_OUTPUT);
431 s.engine(),s.srcFile(),s.srcLine(),true);
432
433 writePlantUMLFile(baseName, s.hasCaption());
436 }
437 break;
438 }
440}

References DocVerbatim::Code, Config_getBool, Config_getString, DocVerbatim::context, QCString::data, DBG_RTF, DocVerbatim::DocbookOnly, DocVerbatim::Dot, DocVerbatim::engine, err, DocVerbatim::exampleFile, QCString::ExplicitSize, FALSE, filter, DocVisitor::getCodeParser, getLanguageFromCodeLang, getStyle, DocVerbatim::hasCaption, DocVerbatim::HtmlOnly, includePicturePostRTF, PlantumlManager::instance, QCString::isEmpty, DocVerbatim::isExample, DocVerbatim::JavaDocCode, DocVerbatim::JavaDocLiteral, DocVerbatim::language, DocVerbatim::LatexOnly, QCString::length, m_ci, m_hide, m_langExt, m_lastIsPara, m_t, DocVerbatim::ManOnly, DocVerbatim::Msc, Portable::openOutputStream, CodeParserInterface::parseCode, DocVerbatim::PlantUML, PlantumlManager::PUML_BITMAP, qPrint, Dir::remove, rtf_Style_Reset, DocVerbatim::RtfOnly, QCString::sprintf, DocVerbatim::srcFile, DocVerbatim::srcLine, QCString::str, DocVerbatim::text, TRUE, DocVerbatim::type, DocVerbatim::Verbatim, visitChildren, writeDotFile, writeMscFile, writePlantUMLFile, PlantumlManager::writePlantUMLSource and DocVerbatim::XmlOnly.

operator()()

void RTFDocVisitor::operator() (const DocAnchor & anc)

Declaration at line 50 of file rtfdocvisitor.h, definition at line 442 of file rtfdocvisitor.cpp.

443{
444 if (m_hide) return;
445 DBG_RTF("{\\comment RTFDocVisitor::visit(DocAnchor)}\n");
446 QCString anchor;
447 if (!anc.file().isEmpty())
448 {
449 anchor+=stripPath(anc.file());
450 }
451 if (!anc.file().isEmpty() && !anc.anchor().isEmpty())
452 {
453 anchor+="_";
454 }
455 if (!anc.anchor().isEmpty())
456 {
457 anchor+=anc.anchor();
458 }
459 m_t << "{\\bkmkstart " << rtfFormatBmkStr(anchor) << "}\n";
460 m_t << "{\\bkmkend " << rtfFormatBmkStr(anchor) << "}\n";
462}

References DocAnchor::anchor, DBG_RTF, FALSE, DocAnchor::file, QCString::isEmpty, m_hide, m_lastIsPara, m_t, rtfFormatBmkStr and stripPath.

operator()()

void RTFDocVisitor::operator() (const DocInclude & inc)

Declaration at line 51 of file rtfdocvisitor.h, definition at line 464 of file rtfdocvisitor.cpp.

465{
466 if (m_hide) return;
468 DBG_RTF("{\\comment RTFDocVisitor::visit(DocInclude)}\n");
469 switch(inc.type())
470 {
472 {
473 m_t << "{\n";
474 m_t << "\\par\n";
475 m_t << rtf_Style_Reset << getStyle("CodeExample");
476 FileInfo cfi( inc.file().str() );
477 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
479 inc.text(),
480 langExt,
482 inc.isExample(),
483 inc.exampleFile(),
484 fd.get(), // fileDef,
485 -1, // start line
486 -1, // end line
487 FALSE, // inline fragment
488 nullptr, // memberDef
489 TRUE // show line numbers
490 );
491 m_t << "\\par";
492 m_t << "}\n";
493 }
494 break;
496 m_t << "{\n";
497 m_t << "\\par\n";
498 m_t << rtf_Style_Reset << getStyle("CodeExample");
500 inc.text(),langExt,
502 inc.isExample(),
503 inc.exampleFile(),
504 nullptr, // fileDef
505 -1, // startLine
506 -1, // endLine
507 TRUE, // inlineFragment
508 nullptr, // memberDef
509 FALSE // show line numbers
510 );
511 m_t << "\\par";
512 m_t << "}\n";
513 break;
521 break;
523 m_t << inc.text();
524 break;
526 m_t << "{\n";
527 m_t << "\\par\n";
528 m_t << rtf_Style_Reset << getStyle("CodeExample");
529 filter(inc.text());
530 m_t << "\\par";
531 m_t << "}\n";
532 break;
535 m_t << "{\n";
536 if (!m_lastIsPara) m_t << "\\par\n";
537 m_t << rtf_Style_Reset << getStyle("CodeExample");
539 inc.file(),
540 inc.blockId(),
541 inc.context(),
543 inc.trimLeft(),
545 );
546 m_t << "}";
547 break;
548 }
550}

References DocInclude::blockId, DocInclude::context, createFileDef, DBG_RTF, FileInfo::dirPath, DocInclude::DocbookInclude, DocInclude::DontInclude, DocInclude::DontIncWithLines, DocInclude::exampleFile, DocInclude::extension, FALSE, DocInclude::file, FileInfo::fileName, filter, DocVisitor::getCodeParser, getLanguageFromFileName, getStyle, DocInclude::HtmlInclude, DocInclude::Include, DocInclude::IncWithLines, CodeFragmentManager::instance, DocInclude::isExample, DocInclude::LatexInclude, m_ci, m_hide, m_lastIsPara, m_t, DocInclude::ManInclude, CodeParserInterface::parseCode, CodeFragmentManager::parseCodeFragment, rtf_Style_Reset, DocInclude::RtfInclude, DocInclude::Snippet, DocInclude::SnippetWithLines, QCString::str, DocInclude::stripCodeComments, DocInclude::text, DocInclude::trimLeft, TRUE, DocInclude::type, DocInclude::VerbInclude and DocInclude::XmlInclude.

operator()()

void RTFDocVisitor::operator() (const DocIncOperator & op)

Declaration at line 52 of file rtfdocvisitor.h, definition at line 552 of file rtfdocvisitor.cpp.

553{
554 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
555 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
556 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIncOperator)}\n");
558 if (locLangExt.isEmpty()) locLangExt = m_langExt;
559 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
560 if (op.isFirst())
561 {
562 if (!m_hide)
563 {
564 m_t << "{\n";
565 m_t << "\\par\n";
566 m_t << rtf_Style_Reset << getStyle("CodeExample");
567 }
569 m_hide = TRUE;
570 }
571 if (op.type()!=DocIncOperator::Skip)
572 {
573 m_hide = popHidden();
574 if (!m_hide)
575 {
576 std::unique_ptr<FileDef> fd = nullptr;
577 if (!op.includeFileName().isEmpty())
578 {
579 FileInfo cfi( op.includeFileName().str() );
580 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
581 }
582
583 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
585 op.isExample(),op.exampleFile(),
586 fd.get(), // fileDef
587 op.line(), // startLine
588 -1, // endLine
589 FALSE, // inline fragment
590 nullptr, // memberDef
591 op.showLineNo() // show line numbers
592 );
593 }
596 }
597 if (op.isLast())
598 {
599 m_hide = popHidden();
600 if (!m_hide)
601 {
602 m_t << "\\par";
603 m_t << "}\n";
604 }
606 }
607 else
608 {
609 if (!m_hide) m_t << "\n";
611 }
612}

References DocIncOperator::context, createFileDef, DBG_RTF, FileInfo::dirPath, DocIncOperator::exampleFile, FALSE, FileInfo::fileName, DocVisitor::getCodeParser, getFileNameExtension, getLanguageFromFileName, getStyle, DocIncOperator::includeFileName, QCString::isEmpty, DocIncOperator::isExample, DocIncOperator::isFirst, DocIncOperator::isLast, DocIncOperator::line, m_ci, m_hide, m_langExt, m_lastIsPara, m_t, CodeParserInterface::parseCode, DocVisitor::popHidden, DocVisitor::pushHidden, rtf_Style_Reset, DocIncOperator::showLineNo, DocIncOperator::Skip, QCString::str, DocIncOperator::stripCodeComments, DocIncOperator::text, TRUE and DocIncOperator::type.

operator()()

void RTFDocVisitor::operator() (const DocFormula & f)

Declaration at line 53 of file rtfdocvisitor.h, definition at line 614 of file rtfdocvisitor.cpp.

615{
616 if (m_hide) return;
617 DBG_RTF("{\\comment RTFDocVisitor::visit(DocFormula)}\n");
618 bool bDisplay = !f.isInline();
619 if (bDisplay)
620 {
621 m_t << "\\par";
622 m_t << "{";
623 m_t << "\\pard\\plain";
624 m_t << "\\pard";
625 m_t << "\\qc";
626 }
627 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"" << f.relPath() << f.name() << ".png\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}";
628 if (bDisplay)
629 {
630 m_t << "\\par}";
631 }
633}

References DBG_RTF, FALSE, DocFormula::isInline, m_hide, m_lastIsPara, m_t, DocFormula::name and DocFormula::relPath.

operator()()

void RTFDocVisitor::operator() (const DocIndexEntry & i)

Declaration at line 54 of file rtfdocvisitor.h, definition at line 635 of file rtfdocvisitor.cpp.

636{
637 if (m_hide) return;
638 DBG_RTF("{\\comment RTFDocVisitor::visit(DocIndexEntry)}\n");
639 m_t << "{\\xe \\v " << i.entry() << "}\n";
641}

References DBG_RTF, DocIndexEntry::entry, FALSE, m_hide, m_lastIsPara and m_t.

operator()()

void RTFDocVisitor::operator() (const DocSimpleSectSep &)

Declaration at line 55 of file rtfdocvisitor.h, definition at line 643 of file rtfdocvisitor.cpp.

operator()()

void RTFDocVisitor::operator() (const DocCite & cite)

Declaration at line 56 of file rtfdocvisitor.h, definition at line 647 of file rtfdocvisitor.cpp.

648{
649 if (m_hide) return;
650 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocCite &)}\n");
651 auto opt = cite.option();
652 if (!cite.file().isEmpty())
653 {
654 if (!opt.noCite()) startLink(cite.ref(),cite.file(),cite.anchor());
655
656 filter(cite.getText());
657
658 if (!opt.noCite()) endLink(cite.ref());
659 }
660 else
661 {
662 m_t << "{\\b";
663 if (!opt.noPar()) filter("[");
664 filter(cite.target());
665 if (!opt.noPar()) filter("]");
666 m_t << "}";
667 }
668}

References DocCite::anchor, DBG_RTF, endLink, DocCite::file, filter, DocCite::getText, QCString::isEmpty, m_hide, m_t, DocCite::option, DocCite::ref, startLink and DocCite::target.

operator()()

void RTFDocVisitor::operator() (const DocSeparator & sep)

Declaration at line 57 of file rtfdocvisitor.h, definition at line 1425 of file rtfdocvisitor.cpp.

1426{
1427 m_t << " " << sep.chars() << " ";
1428}

References DocSeparator::chars and m_t.

operator()()

void RTFDocVisitor::operator() (const DocAutoList & l)

Declaration at line 63 of file rtfdocvisitor.h, definition at line 675 of file rtfdocvisitor.cpp.

676{
677 if (m_hide) return;
678 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoList &)}\n");
679 m_t << "{\n";
680 int level = indentLevel();
681 m_listItemInfo[level].isEnum = l.isEnumList();
682 m_listItemInfo[level].isCheck = l.isCheckedList();
683 m_listItemInfo[level].type = '1';
684 m_listItemInfo[level].number = 1;
687 if (!m_lastIsPara) m_t << "\\par";
688 m_t << "}\n";
690 if (!l.isCheckedList() && indentLevel()==0) m_t << "\\par\n";
691}

References DBG_RTF, FALSE, indentLevel, DocAutoList::isCheckedList, DocAutoList::isEnumList, m_hide, m_lastIsPara, m_listItemInfo, m_t, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocAutoListItem & li)

Declaration at line 64 of file rtfdocvisitor.h, definition at line 693 of file rtfdocvisitor.cpp.

694{
695 static int prevLevel = -1;
696 if (m_hide) return;
697 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocAutoListItem &)}\n");
698 int level = indentLevel();
699 if ((level != prevLevel-1) &&
700 (!(level==prevLevel && level != 0 && m_listItemInfo[level].isCheck)) &&
701 (!m_lastIsPara))
702 m_t << "\\par\n";
703 prevLevel= level;
705 if (m_listItemInfo[level].isEnum)
706 {
707 m_t << getStyle("ListEnum") << "\n";
708 m_t << m_listItemInfo[level].number << ".\\tab ";
709 m_listItemInfo[level].number++;
710 }
711 else
712 {
713 switch (li.itemNumber())
714 {
715 case DocAutoList::Unchecked: // unchecked
716 m_t << getListTable(2) << "\n";
717 break;
718 case DocAutoList::Checked_x: // checked with x
719 case DocAutoList::Checked_X: // checked with X
720 m_t << getListTable(3) << "\n";
721 break;
722 default:
723 m_t << getListTable(1) << "\n";
724 break;
725 }
726 }
728 m_lastIsPara=false;
729 visitChildren(li);
731}

References DocAutoList::Checked_X, DocAutoList::Checked_x, DBG_RTF, decIndentLevel, getListTable, getStyle, incIndentLevel, indentLevel, DocAutoListItem::itemNumber, m_hide, m_lastIsPara, m_listItemInfo, m_t, rtf_Style_Reset, DocAutoList::Unchecked and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocPara & p)

Declaration at line 65 of file rtfdocvisitor.h, definition at line 733 of file rtfdocvisitor.cpp.

734{
735 if (m_hide) return;
736 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPara &)}\n");
738 if (!m_lastIsPara &&
739 !p.isLast() && // omit <p> for last paragraph
740 !(p.parent() && // and for parameters & sections
741 std::get_if<DocParamSect>(p.parent())
742 )
743 )
744 {
745 m_t << "\\par\n";
747 }
748}

References DBG_RTF, DocPara::isLast, m_hide, m_lastIsPara, m_t, DocNode::parent, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocRoot & r)

Declaration at line 66 of file rtfdocvisitor.h, definition at line 750 of file rtfdocvisitor.cpp.

751{
752 if (m_hide) return;
753 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRoot &)}\n");
754 if (r.indent()) incIndentLevel();
755 m_t << "{" << rtf_Style["BodyText"].reference() << "\n";
757 if (!m_lastIsPara && !r.singleLine()) m_t << "\\par\n";
758 m_t << "}";
760 if (r.indent()) decIndentLevel();
761}

References DBG_RTF, decIndentLevel, incIndentLevel, DocRoot::indent, m_hide, m_lastIsPara, m_t, rtf_Style, DocRoot::singleLine, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocSimpleSect & s)

Declaration at line 67 of file rtfdocvisitor.h, definition at line 763 of file rtfdocvisitor.cpp.

764{
765 if (m_hide) return;
766 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
767 if (!m_lastIsPara) m_t << "\\par\n";
768 m_t << "{"; // start desc
769 //m_t << "{\\b "; // start bold
770 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
771 switch(s.type())
772 {
774 m_t << theTranslator->trSeeAlso(); break;
776 m_t << theTranslator->trReturns(); break;
778 m_t << theTranslator->trAuthor(TRUE,TRUE); break;
780 m_t << theTranslator->trAuthor(TRUE,FALSE); break;
782 m_t << theTranslator->trVersion(); break;
784 m_t << theTranslator->trSince(); break;
786 m_t << theTranslator->trDate(); break;
788 m_t << theTranslator->trNote(); break;
790 m_t << theTranslator->trWarning(); break;
792 m_t << theTranslator->trPrecondition(); break;
794 m_t << theTranslator->trPostcondition(); break;
796 m_t << theTranslator->trCopyright(); break;
798 m_t << theTranslator->trInvariant(); break;
800 m_t << theTranslator->trRemarks(); break;
802 m_t << theTranslator->trAttention(); break;
804 m_t << theTranslator->trImportant(); break;
805 case DocSimpleSect::User: break;
806 case DocSimpleSect::Rcs: break;
807 case DocSimpleSect::Unknown: break;
808 }
809
812 {
813 m_t << "\\par";
814 m_t << "}"; // end bold
815 m_t << rtf_Style_Reset << getStyle("DescContinue");
816 m_t << "{\\s17 \\sa60 \\sb30\n";
817 }
818 else
819 {
820 if (s.title())
821 {
822 std::visit(*this,*s.title());
823 }
824 m_t << "\\par\n";
825 m_t << "}"; // end bold
826 m_t << rtf_Style_Reset << getStyle("DescContinue");
827 }
830 if (!m_lastIsPara) m_t << "\\par\n";
833 {
834 m_t << "}"; // end DescContinue
835 }
836 m_t << "}"; // end desc
838}

References DocSimpleSect::Attention, DocSimpleSect::Author, DocSimpleSect::Authors, DocSimpleSect::Copyright, DocSimpleSect::Date, DBG_RTF, decIndentLevel, FALSE, getStyle, DocSimpleSect::Important, incIndentLevel, DocSimpleSect::Invar, m_hide, m_lastIsPara, m_t, DocSimpleSect::Note, DocSimpleSect::Post, DocSimpleSect::Pre, DocSimpleSect::Rcs, DocSimpleSect::Remark, DocSimpleSect::Return, rtf_Style, rtf_Style_Reset, DocSimpleSect::See, DocSimpleSect::Since, theTranslator, DocSimpleSect::title, TRUE, DocSimpleSect::type, DocSimpleSect::Unknown, DocSimpleSect::User, DocSimpleSect::Version, visitChildren and DocSimpleSect::Warning.

operator()()

void RTFDocVisitor::operator() (const DocTitle & t)

Declaration at line 68 of file rtfdocvisitor.h, definition at line 840 of file rtfdocvisitor.cpp.

841{
842 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocTitle &)}\n");
843 if (m_hide) return;
845}

References DBG_RTF, m_hide and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocSimpleList & l)

Declaration at line 69 of file rtfdocvisitor.h, definition at line 847 of file rtfdocvisitor.cpp.

848{
849 if (m_hide) return;
850 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleSect &)}\n");
851 m_t << "{\n";
852 m_listItemInfo[indentLevel()].isEnum = false;
853 m_listItemInfo[indentLevel()].isCheck = false;
856 if (!m_lastIsPara) m_t << "\\par\n";
857 m_t << "}\n";
859}

References DBG_RTF, FALSE, indentLevel, m_hide, m_lastIsPara, m_listItemInfo, m_t, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocSimpleListItem & li)

Declaration at line 70 of file rtfdocvisitor.h, definition at line 861 of file rtfdocvisitor.cpp.

862{
863 if (m_hide) return;
864 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSimpleListItem &)}\n");
865 m_t << "\\par" << rtf_Style_Reset << getStyle("ListBullet") << "\n";
868 if (li.paragraph())
869 {
870 std::visit(*this,*li.paragraph());
871 }
873 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSimpleListItem)}\n");
874}

References DBG_RTF, decIndentLevel, FALSE, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, DocSimpleListItem::paragraph and rtf_Style_Reset.

operator()()

void RTFDocVisitor::operator() (const DocSection & s)

Declaration at line 71 of file rtfdocvisitor.h, definition at line 876 of file rtfdocvisitor.cpp.

877{
878 if (m_hide) return;
879 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSection &)}\n");
880 if (!m_lastIsPara) m_t << "\\par\n";
881 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
882 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(s.file())+"_"+s.anchor()) << "}\n";
883 m_t << "{{" // start section
885 QCString heading;
886 int level = std::min(s.level()+2+m_hierarchyLevel,4);
887 if (level <= 0)
888 level = 1;
889 heading.sprintf("Heading%d",level);
890 // set style
891 m_t << rtf_Style[heading.str()].reference() << "\n";
892 // make table of contents entry
893 if (s.title())
894 {
895 std::visit(*this,*s.title());
896 }
897 m_t << "\n\\par" << "}\n";
898 m_t << "{\\tc\\tcl" << level << " \\v ";
899 if (s.title())
900 {
901 std::visit(*this,*s.title());
902 }
903 m_t << "}\n";
906 m_t << "\\par}\n"; // end section
908}

References DocSection::anchor, DBG_RTF, DocSection::file, DocSection::level, m_hide, m_hierarchyLevel, m_lastIsPara, m_t, rtf_Style, rtf_Style_Reset, rtfFormatBmkStr, QCString::sprintf, QCString::str, stripPath, DocSection::title, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlList & s)

Declaration at line 72 of file rtfdocvisitor.h, definition at line 910 of file rtfdocvisitor.cpp.

911{
912 if (m_hide) return;
913 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlList &)}\n");
914 m_t << "{\n";
915 int level = indentLevel();
916 m_listItemInfo[level].isEnum = l.type()==DocHtmlList::Ordered;
917 m_listItemInfo[level].isCheck = false;
918 m_listItemInfo[level].number = 1;
919 m_listItemInfo[level].type = '1';
920 for (const auto &opt : l.attribs())
921 {
922 if (opt.name=="type")
923 {
924 m_listItemInfo[level].type = opt.value[0];
925 }
926 if (opt.name=="start")
927 {
928 bool ok = false;
929 int val = opt.value.toInt(&ok);
930 if (ok) m_listItemInfo[level].number = val;
931 }
932 }
935 m_t << "\\par" << "}\n";
937}

References DocHtmlList::attribs, DBG_RTF, FALSE, indentLevel, m_hide, m_lastIsPara, m_listItemInfo, m_t, DocHtmlList::Ordered, TRUE, DocHtmlList::type and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlListItem & l)

Declaration at line 73 of file rtfdocvisitor.h, definition at line 939 of file rtfdocvisitor.cpp.

940{
941 if (m_hide) return;
942 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlListItem &)}\n");
943 m_t << "\\par\n";
945 int level = indentLevel();
946 if (m_listItemInfo[level].isEnum)
947 {
948 for (const auto &opt : l.attribs())
949 {
950 if (opt.name=="value")
951 {
952 bool ok = false;
953 int val = opt.value.toInt(&ok);
954 if (ok) m_listItemInfo[level].number = val;
955 }
956 }
957 m_t << getStyle("ListEnum") << "\n";
958 switch (m_listItemInfo[level].type)
959 {
960 case '1':
961 m_t << m_listItemInfo[level].number;
962 break;
963 case 'a':
964 m_t << integerToAlpha(m_listItemInfo[level].number,false);
965 break;
966 case 'A':
967 m_t << integerToAlpha(m_listItemInfo[level].number);
968 break;
969 case 'i':
970 m_t << integerToRoman(m_listItemInfo[level].number,false);
971 break;
972 case 'I':
973 m_t << integerToRoman(m_listItemInfo[level].number);
974 break;
975 default:
976 m_t << m_listItemInfo[level].number;
977 break;
978 }
979 m_t << ".\\tab ";
980 m_listItemInfo[level].number++;
981 }
982 else
983 {
984 m_t << getStyle("ListBullet") << "\n";
985 }
990 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocHtmlListItem)}\n");
991}

References DocHtmlListItem::attribs, DBG_RTF, decIndentLevel, FALSE, getStyle, incIndentLevel, indentLevel, integerToAlpha, integerToRoman, m_hide, m_lastIsPara, m_listItemInfo, m_t, rtf_Style_Reset and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlDescList & dl)

Declaration at line 74 of file rtfdocvisitor.h, definition at line 993 of file rtfdocvisitor.cpp.

994{
995 if (m_hide) return;
996 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescList &)}\n");
997 //m_t << "{\n";
998 //m_t << rtf_Style_Reset << getStyle("ListContinue");
999 //m_lastIsPara=FALSE;
1000 visitChildren(dl);
1001 //m_t << "}\n";
1002 //m_t << "\\par\n";
1003 //m_lastIsPara=TRUE;
1004}

References DBG_RTF, m_hide and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlDescTitle & dt)

Declaration at line 75 of file rtfdocvisitor.h, definition at line 1006 of file rtfdocvisitor.cpp.

1007{
1008 if (m_hide) return;
1009 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescTitle &)}\n");
1010 //m_t << "\\par\n";
1011 //m_t << "{\\b ";
1012 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1014 visitChildren(dt);
1015 m_t << "\\par\n";
1016 m_t << "}\n";
1018}

References DBG_RTF, FALSE, m_hide, m_lastIsPara, m_t, rtf_Style, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlDescData & dd)

Declaration at line 76 of file rtfdocvisitor.h, definition at line 1020 of file rtfdocvisitor.cpp.

1021{
1022 if (m_hide) return;
1023 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDescData &)}\n");
1025 m_t << "{" << rtf_Style_Reset << getStyle("DescContinue");
1026 visitChildren(dd);
1027 m_t << "\\par";
1028 m_t << "}\n";
1031}

References DBG_RTF, decIndentLevel, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlTable & t)

Declaration at line 77 of file rtfdocvisitor.h, definition at line 1033 of file rtfdocvisitor.cpp.

1034{
1035 if (m_hide) return;
1036 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlTable &)}\n");
1037 if (!m_lastIsPara) m_t << "\\par\n";
1039 if (t.caption())
1040 {
1041 const DocHtmlCaption &c = std::get<DocHtmlCaption>(*t.caption());
1042 m_t << "\\pard \\qc \\b";
1043 if (!c.file().isEmpty())
1044 {
1045 m_t << "{\\bkmkstart " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1046 m_t << "{\\bkmkend " << rtfFormatBmkStr(stripPath(c.file())+"_"+c.anchor()) << "}\n";
1047 }
1048 m_t << "{Table \\field\\flddirty{\\*\\fldinst { SEQ Table \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1049 std::visit(*this,*t.caption());
1050 }
1051 visitChildren(t);
1052 m_t << "\\pard\\plain\n";
1053 m_t << "\\par\n";
1055}

References DocHtmlCaption::anchor, DocHtmlTable::caption, DBG_RTF, DocHtmlCaption::file, QCString::isEmpty, m_hide, m_lastIsPara, m_t, rtfFormatBmkStr, stripPath, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlCaption & c)

Declaration at line 78 of file rtfdocvisitor.h, definition at line 1057 of file rtfdocvisitor.cpp.

1058{
1059 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCaption &)}\n");
1060 visitChildren(c);
1061 m_t << "}\n\\par\n";
1062}

References DBG_RTF, m_t and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlRow & r)

Declaration at line 79 of file rtfdocvisitor.h, definition at line 1064 of file rtfdocvisitor.cpp.

1065{
1066 if (m_hide) return;
1067 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlRow &)}\n");
1068 size_t columnWidth=r.numCells()>0 ? rtf_pageWidth/r.numCells() : 10;
1069 m_t << "\\trowd \\trgaph108\\trleft-108"
1070 "\\trbrdrt\\brdrs\\brdrw10 "
1071 "\\trbrdrl\\brdrs\\brdrw10 "
1072 "\\trbrdrb\\brdrs\\brdrw10 "
1073 "\\trbrdrr\\brdrs\\brdrw10 "
1074 "\\trbrdrh\\brdrs\\brdrw10 "
1075 "\\trbrdrv\\brdrs\\brdrw10 \n";
1076 for (size_t i=0;i<r.numCells();i++)
1077 {
1078 if (r.isHeading())
1079 {
1080 m_t << "\\clcbpat16"; // set cell shading to light grey (color 16 in the clut)
1081 }
1082 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10 "
1083 "\\clbrdrl\\brdrs\\brdrw10 "
1084 "\\clbrdrb\\brdrs\\brdrw10 "
1085 "\\clbrdrr \\brdrs\\brdrw10 "
1086 "\\cltxlrtb "
1087 "\\cellx" << ((i+1)*columnWidth) << "\n";
1088 }
1089 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1091 visitChildren(r);
1092 m_t << "\n";
1093 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1094 m_t << "{\\row }\n";
1096}

References DBG_RTF, FALSE, DocHtmlRow::isHeading, m_hide, m_lastIsPara, m_t, DocHtmlRow::numCells, rtf_pageWidth and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlCell & c)

Declaration at line 80 of file rtfdocvisitor.h, definition at line 1098 of file rtfdocvisitor.cpp.

1099{
1100 if (m_hide) return;
1101 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlCell &)}\n");
1102 m_t << "{" << align(c);
1104 visitChildren(c);
1105 m_t << "\\cell }";
1107}

References align, DBG_RTF, FALSE, m_hide, m_lastIsPara, m_t and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocInternal & i)

Declaration at line 81 of file rtfdocvisitor.h, definition at line 1109 of file rtfdocvisitor.cpp.

1110{
1111 if (m_hide) return;
1112 visitChildren(i);
1113}

References m_hide and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHRef & href)

Declaration at line 82 of file rtfdocvisitor.h, definition at line 1115 of file rtfdocvisitor.cpp.

1116{
1117 if (m_hide) return;
1118 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHRef &)}\n");
1119 if (Config_getBool(RTF_HYPERLINKS))
1120 {
1121 if (href.url().startsWith("#"))
1122 {
1123 // when starting with # so a local link
1124 QCString cite;
1125 cite = href.file() + "_" + href.url().right(href.url().length()-1);
1126 m_t << "{\\field "
1127 "{\\*\\fldinst "
1128 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(cite) << "\" "
1129 "}{}"
1130 "}"
1131 "{\\fldrslt "
1132 "{\\cs37\\ul\\cf2 ";
1133 }
1134 else
1135 {
1136 m_t << "{\\field "
1137 "{\\*\\fldinst "
1138 "{ HYPERLINK \"" << href.url() << "\" "
1139 "}{}"
1140 "}"
1141 "{\\fldrslt "
1142 "{\\cs37\\ul\\cf2 ";
1143 }
1144 }
1145 else
1146 {
1147 m_t << "{\\f2 ";
1148 }
1150 visitChildren(href);
1151 if (Config_getBool(RTF_HYPERLINKS))
1152 {
1153 m_t << "}"
1154 "}"
1155 "}";
1156 }
1157 else
1158 {
1159 m_t << "}";
1160 }
1162}

References Config_getBool, DBG_RTF, FALSE, DocHRef::file, QCString::length, m_hide, m_lastIsPara, m_t, QCString::right, rtfFormatBmkStr, QCString::startsWith, DocHRef::url and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlSummary & s)

Declaration at line 83 of file rtfdocvisitor.h, definition at line 1164 of file rtfdocvisitor.cpp.

1165{
1166 if (m_hide) return;
1167 m_t << "{\\b ";
1168 visitChildren(s);
1169 m_t << "}\\par ";
1170}

References m_hide, m_t and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlDetails & d)

Declaration at line 84 of file rtfdocvisitor.h, definition at line 1172 of file rtfdocvisitor.cpp.

1173{
1174 if (m_hide) return;
1175 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlDetails &)}\n");
1176 if (!m_lastIsPara) m_t << "\\par\n";
1177 auto summary = d.summary();
1178 if (summary)
1179 {
1180 std::visit(*this,*summary);
1181 m_t << "{"; // start desc
1183 m_t << rtf_Style_Reset << getStyle("DescContinue");
1184 }
1185 visitChildren(d);
1186 if (!m_lastIsPara) m_t << "\\par\n";
1187 if (summary)
1188 {
1190 m_t << "}"; // end desc
1191 }
1193}

References DBG_RTF, decIndentLevel, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, rtf_Style_Reset, DocHtmlDetails::summary, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlHeader & header)

Declaration at line 85 of file rtfdocvisitor.h, definition at line 1195 of file rtfdocvisitor.cpp.

1196{
1197 if (m_hide) return;
1198 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlHeader &)}\n");
1199 m_t << "{" // start section
1201 QCString heading;
1202 int level = std::clamp(header.level()+m_hierarchyLevel,SectionType::MinLevel,SectionType::MaxLevel);
1203 heading.sprintf("Heading%d",level);
1204 // set style
1205 m_t << rtf_Style[heading.str()].reference();
1206 // make open table of contents entry that will be closed in visitPost method
1207 m_t << "{\\tc\\tcl" << level << " ";
1209 visitChildren(header);
1210 // close open table of contents entry
1211 m_t << "} \\par";
1212 m_t << "}\n"; // end section
1214}

References DBG_RTF, FALSE, DocHtmlHeader::level, m_hide, m_hierarchyLevel, m_lastIsPara, m_t, SectionType::MaxLevel, SectionType::MinLevel, rtf_Style, rtf_Style_Reset, QCString::sprintf, QCString::str, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocImage & img)

Declaration at line 86 of file rtfdocvisitor.h, definition at line 1281 of file rtfdocvisitor.cpp.

1282{
1283 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocImage &)}\n");
1285 visitChildren(img);
1287}

References DBG_RTF, DocImage::hasCaption, includePicturePostRTF, includePicturePreRTF, DocImage::isInlineImage, DocImage::name, DocImage::Rtf, DocImage::type and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocDotFile & df)

Declaration at line 87 of file rtfdocvisitor.h, definition at line 1290 of file rtfdocvisitor.cpp.

1291{
1292 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDotFile &)}\n");
1293 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1294 writeDotFile(df);
1295 visitChildren(df);
1297}

References Config_getBool, Config_getString, copyFile, DBG_RTF, DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, includePicturePostRTF, stripPath, visitChildren and writeDotFile.

operator()()

void RTFDocVisitor::operator() (const DocMscFile & df)

Declaration at line 88 of file rtfdocvisitor.h, definition at line 1298 of file rtfdocvisitor.cpp.

1299{
1300 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocMscFile &)}\n");
1301 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1302 writeMscFile(df);
1303 visitChildren(df);
1305}

References Config_getBool, Config_getString, copyFile, DBG_RTF, DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, includePicturePostRTF, stripPath, visitChildren and writeMscFile.

operator()()

void RTFDocVisitor::operator() (const DocDiaFile & df)

Declaration at line 89 of file rtfdocvisitor.h, definition at line 1307 of file rtfdocvisitor.cpp.

1308{
1309 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocDiaFile &)}\n");
1310 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1311 writeDiaFile(df);
1312 visitChildren(df);
1314}

References Config_getBool, Config_getString, copyFile, DBG_RTF, DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, includePicturePostRTF, stripPath, visitChildren and writeDiaFile.

operator()()

void RTFDocVisitor::operator() (const DocPlantUmlFile & df)

Declaration at line 90 of file rtfdocvisitor.h, definition at line 1316 of file rtfdocvisitor.cpp.

1317{
1318 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocPlantUmlFile &)}\n");
1319 if (!Config_getBool(DOT_CLEANUP)) copyFile(df.file(),Config_getString(RTF_OUTPUT)+"/"+stripPath(df.file()));
1320 QCString rtfOutput = Config_getString(RTF_OUTPUT);
1321 std::string inBuf;
1322 readInputFile(df.file(),inBuf);
1324 rtfOutput,QCString(),inBuf.c_str(),PlantumlManager::PUML_BITMAP,
1325 QCString(),df.srcFile(),df.srcLine(),false);
1326 writePlantUMLFile(baseName, df.hasCaption());
1327 visitChildren(df);
1329}

References Config_getBool, Config_getString, copyFile, DBG_RTF, DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, includePicturePostRTF, PlantumlManager::instance, PlantumlManager::PUML_BITMAP, readInputFile, DocDiagramFileBase::srcFile, DocDiagramFileBase::srcLine, stripPath, visitChildren, writePlantUMLFile and PlantumlManager::writePlantUMLSource.

operator()()

void RTFDocVisitor::operator() (const DocLink & lnk)

Declaration at line 91 of file rtfdocvisitor.h, definition at line 1331 of file rtfdocvisitor.cpp.

1332{
1333 if (m_hide) return;
1334 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocLink &)}\n");
1335 startLink(lnk.ref(),lnk.file(),lnk.anchor());
1336 visitChildren(lnk);
1337 endLink(lnk.ref());
1338}

References DocLink::anchor, DBG_RTF, endLink, DocLink::file, m_hide, DocLink::ref, startLink and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocRef & ref)

Declaration at line 92 of file rtfdocvisitor.h, definition at line 1340 of file rtfdocvisitor.cpp.

1341{
1342 if (m_hide) return;
1343 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocRef &)}\n");
1344 // when ref.isSubPage()==TRUE we use ref.file() for HTML and
1345 // ref.anchor() for LaTeX/RTF
1346 if (ref.isSubPage())
1347 {
1348 startLink(ref.ref(),QCString(),ref.anchor());
1349 }
1350 else
1351 {
1352 if (!ref.file().isEmpty()) startLink(ref.ref(),ref.file(),ref.anchor());
1353 }
1354 if (!ref.hasLinkText()) filter(ref.targetTitle());
1355 visitChildren(ref);
1356 if (!ref.file().isEmpty()) endLink(ref.ref());
1357 //m_t << " ";
1358}

References DocRef::anchor, DBG_RTF, endLink, DocRef::file, filter, DocRef::hasLinkText, QCString::isEmpty, DocRef::isSubPage, m_hide, DocRef::ref, startLink, DocRef::targetTitle and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocSecRefItem & ref)

Declaration at line 93 of file rtfdocvisitor.h, definition at line 1361 of file rtfdocvisitor.cpp.

1362{
1363 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefItem &)}\n");
1364 visitChildren(ref);
1365}

References DBG_RTF and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocSecRefList & l)

Declaration at line 94 of file rtfdocvisitor.h, definition at line 1367 of file rtfdocvisitor.cpp.

1368{
1369 if (m_hide) return;
1370 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocSecRefList &)}\n");
1371 m_t << "{\n";
1373 m_t << rtf_Style_Reset << getStyle("LatexTOC") << "\n";
1374 m_t << "\\par\n";
1376 visitChildren(l);
1378 m_t << "\\par";
1379 m_t << "}\n";
1381}

References DBG_RTF, decIndentLevel, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocParamSect & s)

Declaration at line 95 of file rtfdocvisitor.h, definition at line 1383 of file rtfdocvisitor.cpp.

1384{
1385 if (m_hide) return;
1386 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamSect &)}\n");
1387 m_t << "{"; // start param list
1388 if (!m_lastIsPara) m_t << "\\par\n";
1389 //m_t << "{\\b "; // start bold
1390 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1391 switch(s.type())
1392 {
1394 m_t << theTranslator->trParameters(); break;
1396 m_t << theTranslator->trReturnValues(); break;
1398 m_t << theTranslator->trExceptions(); break;
1400 m_t << theTranslator->trTemplateParameters(); break;
1401 default:
1402 ASSERT(0);
1403 }
1404 m_t << "\\par";
1405 m_t << "}\n";
1406 bool useTable = s.type()==DocParamSect::Param ||
1410 if (!useTable)
1411 {
1413 }
1414 m_t << rtf_Style_Reset << getStyle("DescContinue");
1416 visitChildren(s);
1417 //m_t << "\\par\n";
1418 if (!useTable)
1419 {
1421 }
1422 m_t << "}\n";
1423}

References ASSERT, DBG_RTF, decIndentLevel, DocParamSect::Exception, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, DocParamSect::Param, DocParamSect::RetVal, rtf_Style, rtf_Style_Reset, DocParamSect::TemplateParam, theTranslator, TRUE, DocParamSect::type and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocParamList & pl)

Declaration at line 96 of file rtfdocvisitor.h, definition at line 1430 of file rtfdocvisitor.cpp.

1431{
1432 static int columnPos[4][5] =
1433 { { 2, 25, 100, 100, 100 }, // no inout, no type
1434 { 3, 14, 35, 100, 100 }, // inout, no type
1435 { 3, 25, 50, 100, 100 }, // no inout, type
1436 { 4, 14, 35, 55, 100 }, // inout, type
1437 };
1438 int config=0;
1439 if (m_hide) return;
1440 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocParamList &)}\n");
1441
1443 const DocParamSect *sect = std::get_if<DocParamSect>(pl.parent());
1444 if (sect)
1445 {
1446 parentType = sect->type();
1447 }
1448 bool useTable = parentType==DocParamSect::Param ||
1449 parentType==DocParamSect::RetVal ||
1450 parentType==DocParamSect::Exception ||
1451 parentType==DocParamSect::TemplateParam;
1452 if (sect && sect->hasInOutSpecifier()) config+=1;
1453 if (sect && sect->hasTypeSpecifier()) config+=2;
1454 if (useTable)
1455 {
1456 m_t << "\\trowd \\trgaph108\\trleft426\\tblind426"
1457 "\\trbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1458 "\\trbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1459 "\\trbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1460 "\\trbrdrr\\brdrs\\brdrw10\\brdrcf15 "
1461 "\\trbrdrh\\brdrs\\brdrw10\\brdrcf15 "
1462 "\\trbrdrv\\brdrs\\brdrw10\\brdrcf15 "<< "\n";
1463 for (int i=0;i<columnPos[config][0];i++)
1464 {
1465 m_t << "\\clvertalt\\clbrdrt\\brdrs\\brdrw10\\brdrcf15 "
1466 "\\clbrdrl\\brdrs\\brdrw10\\brdrcf15 "
1467 "\\clbrdrb\\brdrs\\brdrw10\\brdrcf15 "
1468 "\\clbrdrr \\brdrs\\brdrw10\\brdrcf15 "
1469 "\\cltxlrtb "
1470 "\\cellx" << (rtf_pageWidth*columnPos[config][i+1]/100) << "\n";
1471 }
1472 m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1473 }
1474
1475 if (sect && sect->hasInOutSpecifier())
1476 {
1477 if (useTable)
1478 {
1479 m_t << "{";
1480 }
1481
1482 // Put in the direction: in/out/in,out if specified.
1484 {
1485 if (pl.direction()==DocParamSect::In)
1486 {
1487 m_t << "in";
1488 }
1489 else if (pl.direction()==DocParamSect::Out)
1490 {
1491 m_t << "out";
1492 }
1493 else if (pl.direction()==DocParamSect::InOut)
1494 {
1495 m_t << "in,out";
1496 }
1497 }
1498
1499 if (useTable)
1500 {
1501 m_t << "\\cell }";
1502 }
1503 }
1504
1505 if (sect && sect->hasTypeSpecifier())
1506 {
1507 if (useTable)
1508 {
1509 m_t << "{";
1510 }
1511 for (const auto &type : pl.paramTypes())
1512 {
1513 std::visit(*this,type);
1514 }
1515 if (useTable)
1516 {
1517 m_t << "\\cell }";
1518 }
1519 }
1520
1521
1522 if (useTable)
1523 {
1524 m_t << "{";
1525 }
1526
1527 m_t << "{\\i ";
1528 bool first=TRUE;
1529 for (const auto &param : pl.parameters())
1530 {
1531 if (!first) m_t << ","; else first=FALSE;
1532 std::visit(*this,param);
1533 }
1534 m_t << "} ";
1535
1536 if (useTable)
1537 {
1538 m_t << "\\cell }{";
1539 }
1541
1542 for (const auto &par : pl.paragraphs())
1543 {
1544 std::visit(*this,par);
1545 }
1546
1547 if (useTable)
1548 {
1549 m_t << "\\cell }\n";
1550 //m_t << "\\pard \\widctlpar\\intbl\\adjustright\n";
1551 m_t << "{\\row }\n";
1552 }
1553 else
1554 {
1555 m_t << "\\par\n";
1556 }
1557
1559}

References DBG_RTF, DocParamList::direction, DocParamSect::Exception, FALSE, DocParamSect::hasInOutSpecifier, DocParamSect::hasTypeSpecifier, DocParamSect::In, DocParamSect::InOut, m_hide, m_lastIsPara, m_t, DocParamSect::Out, DocParamList::paragraphs, DocParamSect::Param, DocParamList::parameters, DocParamList::paramTypes, DocNode::parent, DocParamSect::RetVal, rtf_pageWidth, DocParamSect::TemplateParam, TRUE, DocParamSect::type, DocParamSect::Unknown and DocParamSect::Unspecified.

operator()()

void RTFDocVisitor::operator() (const DocXRefItem & x)

Declaration at line 97 of file rtfdocvisitor.h, definition at line 1561 of file rtfdocvisitor.cpp.

1562{
1563 if (m_hide) return;
1564 if (x.title().isEmpty()) return;
1565 bool anonymousEnum = x.file()=="@";
1566 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocXRefItem &)}\n");
1567 if (!m_lastIsPara)
1568 {
1569 m_t << "\\par\n";
1571 }
1572 m_t << "{"; // start param list
1573 //m_t << "{\\b "; // start bold
1574 m_t << "{" << rtf_Style["Heading5"].reference() << "\n";
1575 if (Config_getBool(RTF_HYPERLINKS) && !anonymousEnum)
1576 {
1577 QCString refName;
1578 if (!x.file().isEmpty())
1579 {
1580 refName+=stripPath(x.file());
1581 }
1582 if (!x.file().isEmpty() && !x.anchor().isEmpty())
1583 {
1584 refName+="_";
1585 }
1586 if (!x.anchor().isEmpty())
1587 {
1588 refName+=x.anchor();
1589 }
1590
1591 m_t << "{\\field "
1592 "{\\*\\fldinst "
1593 "{ HYPERLINK \\\\l \"" << rtfFormatBmkStr(refName) << "\" "
1594 "}{}"
1595 "}"
1596 "{\\fldrslt "
1597 "{\\cs37\\ul\\cf2 ";
1598 filter(x.title());
1599 m_t << "}"
1600 "}"
1601 "}";
1602 }
1603 else
1604 {
1605 filter(x.title());
1606 }
1607 m_t << ":";
1608 m_t << "\\par";
1609 m_t << "}"; // end bold
1611 m_t << rtf_Style_Reset << getStyle("DescContinue");
1613 visitChildren(x);
1614 if (x.title().isEmpty()) return;
1615 DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocXRefItem)}\n");
1616 m_t << "\\par\n";
1618 m_t << "}\n"; // end xref item
1620}

References DocXRefItem::anchor, Config_getBool, DBG_RTF, decIndentLevel, FALSE, DocXRefItem::file, filter, getStyle, incIndentLevel, QCString::isEmpty, m_hide, m_lastIsPara, m_t, rtf_Style, rtf_Style_Reset, rtfFormatBmkStr, stripPath, DocXRefItem::title, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocInternalRef & ref)

Declaration at line 98 of file rtfdocvisitor.h, definition at line 1622 of file rtfdocvisitor.cpp.

1623{
1624 if (m_hide) return;
1625 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocInternalRef &)}\n");
1626 startLink("",ref.file(),ref.anchor());
1627 visitChildren(ref);
1628 endLink("");
1629 m_t << " ";
1630}

References DocInternalRef::anchor, DBG_RTF, endLink, DocInternalRef::file, m_hide, m_t, startLink and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocText & t)

Declaration at line 99 of file rtfdocvisitor.h, definition at line 1632 of file rtfdocvisitor.cpp.

1633{
1634 if (m_hide) return;
1635 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocText &)}\n");
1636 visitChildren(t);
1637}

References DBG_RTF, m_hide and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocHtmlBlockQuote & q)

Declaration at line 100 of file rtfdocvisitor.h, definition at line 1639 of file rtfdocvisitor.cpp.

1640{
1641 if (m_hide) return;
1642 DBG_RTF("{\\comment RTFDocVisitor::operator()(const DocHtmlBlockQuote &)}\n");
1643 if (!m_lastIsPara) m_t << "\\par\n";
1644 m_t << "{"; // start desc
1646 m_t << rtf_Style_Reset << getStyle("DescContinue");
1647 visitChildren(q);
1648 if (!m_lastIsPara) m_t << "\\par\n";
1650 m_t << "}"; // end desc
1652}

References DBG_RTF, decIndentLevel, getStyle, incIndentLevel, m_hide, m_lastIsPara, m_t, rtf_Style_Reset, TRUE and visitChildren.

operator()()

void RTFDocVisitor::operator() (const DocVhdlFlow &)

Declaration at line 101 of file rtfdocvisitor.h, definition at line 1654 of file rtfdocvisitor.cpp.

1655{
1656}

operator()()

void RTFDocVisitor::operator() (const DocParBlock & pb)

Declaration at line 102 of file rtfdocvisitor.h, definition at line 1658 of file rtfdocvisitor.cpp.

1659{
1660 if (m_hide) return;
1661 visitChildren(pb);
1662}

References m_hide and visitChildren.

Private Member Functions

decIndentLevel()

void RTFDocVisitor::decIndentLevel ()

Declaration at line 127 of file rtfdocvisitor.h, definition at line 110 of file rtfdocvisitor.cpp.

Reference m_indentLevel.

Referenced by operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

endLink()

void RTFDocVisitor::endLink (const QCString & ref)

Declaration at line 121 of file rtfdocvisitor.h, definition at line 1730 of file rtfdocvisitor.cpp.

1731{
1732 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1733 {
1734 m_t << "}}}";
1735 }
1736 else
1737 {
1738 m_t << "}";
1739 }
1741}

References Config_getBool, FALSE, QCString::isEmpty, m_lastIsPara and m_t.

Referenced by operator(), operator(), operator(), operator() and operator().

filter()

void RTFDocVisitor::filter (const QCString & str, bool verbatim=FALSE)

Declaration at line 118 of file rtfdocvisitor.h, definition at line 1672 of file rtfdocvisitor.cpp.

1672void RTFDocVisitor::filter(const QCString &str,bool verbatim)
1673{
1674 if (!str.isEmpty())
1675 {
1676 const char *p=str.data();
1677 while (*p)
1678 {
1679 char c=*p++;
1680 switch (c)
1681 {
1682 case '{': m_t << "\\{"; break;
1683 case '}': m_t << "\\}"; break;
1684 case '\\': m_t << "\\\\"; break;
1685 case '\n': if (verbatim)
1686 {
1687 m_t << "\\par\n";
1688 }
1689 else
1690 {
1691 m_t << '\n';
1692 }
1693 break;
1694 default: m_t << c;
1695 }
1696 }
1697 }
1698}

References QCString::data, QCString::isEmpty and m_t.

Referenced by operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

getListTable()

QCString RTFDocVisitor::getListTable (const int id)

Declaration at line 123 of file rtfdocvisitor.h, definition at line 83 of file rtfdocvisitor.cpp.

84{
85 for (int i=0 ; rtf_Table_Default[i].definition ; i++ )
86 {
87 if ((id == rtf_Table_Default[i].id) && (m_indentLevel == rtf_Table_Default[i].lvl))
88 {
89 return rtf_Table_Default[i].place;
90 }
91 }
92 ASSERT(0);
93 return "";
94}

References ASSERT, m_indentLevel and rtf_Table_Default.

Referenced by operator().

getStyle()

QCString RTFDocVisitor::getStyle (const QCString & name)

incIndentLevel()

void RTFDocVisitor::incIndentLevel ()

Declaration at line 126 of file rtfdocvisitor.h, definition at line 101 of file rtfdocvisitor.cpp.

102{
105 {
106 err("Maximum indent level ({}) exceeded while generating RTF output!\n",maxIndentLevels-1);
107 }
108}

References err, m_indentLevel and maxIndentLevels.

Referenced by operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator(), operator() and operator().

includePicturePostRTF()

void RTFDocVisitor::includePicturePostRTF (bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)

Declaration at line 130 of file rtfdocvisitor.h, definition at line 1253 of file rtfdocvisitor.cpp.

1253void RTFDocVisitor::includePicturePostRTF(bool isTypeRTF, bool hasCaption, bool inlineImage)
1254{
1255 if (isTypeRTF)
1256 {
1257 if (m_hide) return;
1258 if (inlineImage)
1259 {
1260 if (hasCaption) m_t << " }";
1261 }
1262 else
1263 {
1264 if (hasCaption)
1265 {
1266 m_t << "}\n";
1267 m_t << "\\par}\n";
1268 }
1269 else
1270 {
1271 m_t << "}\n";
1272 }
1273 }
1274 }
1275 else
1276 {
1277 m_hide = popHidden();
1278 }
1279}

References m_hide, m_t and DocVisitor::popHidden.

Referenced by operator(), operator(), operator(), operator(), operator() and operator().

includePicturePreRTF()

void RTFDocVisitor::includePicturePreRTF (const QCString & name, bool isTypeRTF, bool hasCaption, bool inlineImage=FALSE)

Declaration at line 129 of file rtfdocvisitor.h, definition at line 1216 of file rtfdocvisitor.cpp.

1216void RTFDocVisitor::includePicturePreRTF(const QCString &name, bool isTypeRTF, bool hasCaption, bool inlineImage)
1217{
1218 if (isTypeRTF)
1219 {
1220 if (!inlineImage)
1221 {
1222 m_t << "\\par\n";
1223 m_t << "{\n";
1224 m_t << rtf_Style_Reset << "\n";
1225 if (hasCaption || m_lastIsPara) m_t << "\\par\n";
1226 m_t << "\\pard \\qc ";
1227 }
1228 m_t << "{ \\field\\flddirty {\\*\\fldinst INCLUDEPICTURE \"";
1229 m_t << name;
1230 m_t << "\" \\\\d \\\\*MERGEFORMAT}{\\fldrslt Image}}\n";
1231 if (!inlineImage)
1232 {
1233 m_t << "\\par\n";
1234 if (hasCaption)
1235 {
1236 m_t << "\\pard \\qc \\b";
1237 m_t << "{Image \\field\\flddirty{\\*\\fldinst { SEQ Image \\\\*Arabic }}{\\fldrslt {\\noproof 1}} ";
1238 }
1240 }
1241 else
1242 {
1243 if (hasCaption) m_t << "{\\comment "; // to prevent caption to be shown
1244 }
1245 }
1246 else // other format -> skip
1247 {
1249 m_hide=TRUE;
1250 }
1251}

References m_hide, m_lastIsPara, m_t, DocVisitor::pushHidden, rtf_Style_Reset and TRUE.

Referenced by operator(), writeDiaFile, writeDotFile, writeMscFile and writePlantUMLFile.

indentLevel()

int RTFDocVisitor::indentLevel ()

Declaration at line 125 of file rtfdocvisitor.h, definition at line 96 of file rtfdocvisitor.cpp.

97{
98 return std::min(m_indentLevel,maxIndentLevels-1);
99}

References m_indentLevel and maxIndentLevels.

Referenced by getStyle, operator(), operator(), operator(), operator() and operator().

startLink()

void RTFDocVisitor::startLink (const QCString & ref, const QCString & file, const QCString & anchor)

Declaration at line 119 of file rtfdocvisitor.h, definition at line 1700 of file rtfdocvisitor.cpp.

1700void RTFDocVisitor::startLink(const QCString &ref,const QCString &file,const QCString &anchor)
1701{
1702 if (ref.isEmpty() && Config_getBool(RTF_HYPERLINKS))
1703 {
1704 QCString refName;
1705 if (!file.isEmpty())
1706 {
1707 refName+=stripPath(file);
1708 }
1709 if (!file.isEmpty() && !anchor.isEmpty())
1710 {
1711 refName+='_';
1712 }
1713 if (!anchor.isEmpty())
1714 {
1715 refName+=anchor;
1716 }
1717
1718 m_t << "{\\field {\\*\\fldinst { HYPERLINK \\\\l \"";
1719 m_t << rtfFormatBmkStr(refName);
1720 m_t << "\" }{}";
1721 m_t << "}{\\fldrslt {\\cs37\\ul\\cf2 ";
1722 }
1723 else
1724 {
1725 m_t << "{\\b ";
1726 }
1728}

References Config_getBool, FALSE, QCString::isEmpty, m_lastIsPara, m_t, rtfFormatBmkStr and stripPath.

Referenced by operator(), operator(), operator(), operator() and operator().

visitChildren()

template <class T>
void RTFDocVisitor::visitChildren (const T & t)
inline

writeDiaFile()

void RTFDocVisitor::writeDiaFile (const DocDiaFile & df)

Declaration at line 135 of file rtfdocvisitor.h, definition at line 1770 of file rtfdocvisitor.cpp.

1771{
1772 QCString baseName=makeBaseName(df.file());
1773 QCString outDir = Config_getString(RTF_OUTPUT);
1774 writeDiaGraphFromFile(df.file(),outDir,baseName,DiaOutputFormat::BITMAP,df.srcFile(),df.srcLine());
1775 includePicturePreRTF(baseName + ".png", true, df.hasCaption());
1776}

References BITMAP, Config_getString, DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, includePicturePreRTF, makeBaseName, DocDiagramFileBase::srcFile, DocDiagramFileBase::srcLine and writeDiaGraphFromFile.

Referenced by operator().

writeDotFile()

void RTFDocVisitor::writeDotFile (const QCString & fileName, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 131 of file rtfdocvisitor.h, definition at line 1747 of file rtfdocvisitor.cpp.

1747void RTFDocVisitor::writeDotFile(const QCString &filename, bool hasCaption,
1748 const QCString &srcFile, int srcLine)
1749{
1750 QCString baseName=makeBaseName(filename);
1751 QCString outDir = Config_getString(RTF_OUTPUT);
1752 writeDotGraphFromFile(filename,outDir,baseName,GraphOutputFormat::BITMAP,srcFile,srcLine);
1754 includePicturePreRTF(baseName + "." + imgExt, true, hasCaption);
1755}

References BITMAP, Config_getString, getDotImageExtension, includePicturePreRTF, makeBaseName and writeDotGraphFromFile.

Referenced by operator(), operator() and writeDotFile.

writeDotFile()

void RTFDocVisitor::writeDotFile (const DocDotFile & df)

Declaration at line 132 of file rtfdocvisitor.h, definition at line 1743 of file rtfdocvisitor.cpp.

1744{
1745 writeDotFile(df.file(), df.hasCaption(), df.srcFile(), df.srcLine());
1746}

References DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, DocDiagramFileBase::srcFile, DocDiagramFileBase::srcLine and writeDotFile.

writeMscFile()

void RTFDocVisitor::writeMscFile (const QCString & fileName, bool hasCaption, const QCString & srcFile, int srcLine)

Declaration at line 133 of file rtfdocvisitor.h, definition at line 1761 of file rtfdocvisitor.cpp.

1761void RTFDocVisitor::writeMscFile(const QCString &fileName, bool hasCaption,
1762 const QCString &srcFile, int srcLine)
1763{
1764 QCString baseName=makeBaseName(fileName);
1765 QCString outDir = Config_getString(RTF_OUTPUT);
1766 writeMscGraphFromFile(fileName,outDir,baseName,MscOutputFormat::BITMAP,srcFile,srcLine);
1767 includePicturePreRTF(baseName + ".png", true, hasCaption);
1768}

References BITMAP, Config_getString, includePicturePreRTF, makeBaseName and writeMscGraphFromFile.

Referenced by operator(), operator() and writeMscFile.

writeMscFile()

void RTFDocVisitor::writeMscFile (const DocMscFile & df)

Declaration at line 134 of file rtfdocvisitor.h, definition at line 1757 of file rtfdocvisitor.cpp.

1758{
1759 writeMscFile(df.file(), df.hasCaption(), df.srcFile(), df.srcLine());
1760}

References DocDiagramFileBase::file, DocDiagramFileBase::hasCaption, DocDiagramFileBase::srcFile, DocDiagramFileBase::srcLine and writeMscFile.

writePlantUMLFile()

void RTFDocVisitor::writePlantUMLFile (const QCString & fileName, bool hasCaption)

Declaration at line 136 of file rtfdocvisitor.h, definition at line 1778 of file rtfdocvisitor.cpp.

1778void RTFDocVisitor::writePlantUMLFile(const QCString &fileName, bool hasCaption)
1779{
1780 QCString baseName=makeBaseName(fileName);
1781 QCString outDir = Config_getString(RTF_OUTPUT);
1783 includePicturePreRTF(baseName + ".png", true, hasCaption);
1784}

References Config_getString, PlantumlManager::generatePlantUMLOutput, includePicturePreRTF, PlantumlManager::instance, makeBaseName and PlantumlManager::PUML_BITMAP.

Referenced by operator() and operator().

Private Member Attributes

m_ci

OutputCodeList& RTFDocVisitor::m_ci

Definition at line 143 of file rtfdocvisitor.h.

Referenced by operator(), operator(), operator() and RTFDocVisitor.

m_hide

m_hierarchyLevel

int RTFDocVisitor::m_hierarchyLevel = 0

Definition at line 151 of file rtfdocvisitor.h.

Referenced by operator(), operator() and RTFDocVisitor.

m_indentLevel

int RTFDocVisitor::m_indentLevel = 0

Definition at line 150 of file rtfdocvisitor.h.

Referenced by decIndentLevel, getListTable, incIndentLevel and indentLevel.

m_insidePre

bool RTFDocVisitor::m_insidePre = false

Definition at line 144 of file rtfdocvisitor.h.

144 bool m_insidePre = false;

Referenced by operator() and operator().

m_langExt

QCString RTFDocVisitor::m_langExt

Definition at line 147 of file rtfdocvisitor.h.

Referenced by operator(), operator() and RTFDocVisitor.

m_lastIsPara

m_listItemInfo

RTFListItemInfo RTFDocVisitor::m_listItemInfo[maxIndentLevels]

m_t

Private Static Attributes

maxIndentLevels

const int RTFDocVisitor::maxIndentLevels = 13
static

Definition at line 149 of file rtfdocvisitor.h.

149 static const int maxIndentLevels = 13;

Referenced by incIndentLevel and indentLevel.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.