Doxygen
Loading...
Searching...
No Matches
FTVHelp::Private Struct Reference

Public Member Functions

 Private (bool TLI)
 
void generateTree (TextStream &t, const FTVNodes &nl, int level, int maxLevel, int &index)
 
void generateLink (TextStream &t, const FTVNodePtr &n)
 

Public Attributes

std::vector< FTVNodesindentNodes
 
int indent = 0
 
bool topLevelIndex
 

Detailed Description

Definition at line 104 of file ftvhelp.cpp.

Constructor & Destructor Documentation

◆ Private()

FTVHelp::Private::Private ( bool TLI)
inline

Definition at line 106 of file ftvhelp.cpp.

106: topLevelIndex(TLI) { indentNodes.resize(1); }
std::vector< FTVNodes > indentNodes
Definition ftvhelp.cpp:107

References indentNodes, and topLevelIndex.

Member Function Documentation

◆ generateLink()

void FTVHelp::Private::generateLink ( TextStream & t,
const FTVNodePtr & n )

Definition at line 277 of file ftvhelp.cpp.

278{
279 //printf("FTVHelp::generateLink(ref=%s,file=%s,anchor=%s\n",
280 // qPrint(n->ref),qPrint(n->file),qPrint(n->anchor));
281 bool setTarget = FALSE;
282 if (n->file.isEmpty()) // no link
283 {
284 t << "<b>" << convertToHtml(n->name) << "</b>";
285 }
286 else // link into other frame
287 {
288 if (!n->ref.isEmpty()) // link to entity imported via tag file
289 {
290 t << "<a class=\"elRef\" ";
291 QCString result = externalLinkTarget();
292 if (result != "") setTarget = TRUE;
293 t << result;
294 }
295 else // local link
296 {
297 t << "<a class=\"el\" ";
298 }
299 t << "href=\"";
300 t << externalRef("",n->ref,TRUE);
301 t << node2URL(n);
302 if (!setTarget)
303 {
304 if (topLevelIndex)
305 t << "\" target=\"basefrm\">";
306 else
307 t << "\" target=\"_self\">";
308 }
309 else
310 {
311 t << "\">";
312 }
313 t << convertToHtml(n->name);
314 t << "</a>";
315 if (!n->ref.isEmpty())
316 {
317 t << "&#160;[external]";
318 }
319 }
320}
static QCString node2URL(const FTVNodePtr &n, bool overruleFile=FALSE, bool srcLink=FALSE)
Definition ftvhelp.cpp:213
#define TRUE
Definition qcstring.h:37
#define FALSE
Definition qcstring.h:34
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition util.cpp:6065
QCString convertToHtml(const QCString &s, bool keepEntities)
Definition util.cpp:4317
QCString externalLinkTarget(const bool parent)
Definition util.cpp:6021

References convertToHtml(), externalLinkTarget(), externalRef(), FALSE, node2URL(), topLevelIndex, and TRUE.

◆ generateTree()

void FTVHelp::Private::generateTree ( TextStream & t,
const FTVNodes & nl,
int level,
int maxLevel,
int & index )

Definition at line 366 of file ftvhelp.cpp.

367{
368 for (const auto &n : nl)
369 {
370 t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\"";
371 if ((index&1)==0) // even row
372 t << " class=\"even\"";
373 else
374 t << " class=\"odd\"";
375 if (level>=maxLevel) // item invisible by default
376 t << " style=\"display:none;\"";
377 else // item visible by default
378 index++;
379 t << "><td class=\"entry\">";
380 bool nodeOpened = level+1<maxLevel;
381 generateIndent(t,n,nodeOpened);
382 if (n->isDir)
383 {
384 if (n->def && n->def->definitionType()==Definition::TypeGroup)
385 {
386 // no icon
387 }
388 else if (n->def && n->def->definitionType()==Definition::TypePage)
389 {
390 // no icon
391 }
392 else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
393 {
394 if ((n->def->getLanguage() == SrcLangExt::Slice) || (n->def->getLanguage() == SrcLangExt::Fortran))
395 {
396 t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
397 }
398 else if ((n->def->getLanguage() == SrcLangExt::Java) || (n->def->getLanguage() == SrcLangExt::VHDL))
399 {
400 t << "<span class=\"icona\"><span class=\"icon\">P</span></span>";
401 }
402 else
403 {
404 t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
405 }
406 }
407 else if (n->def && n->def->definitionType()==Definition::TypeModule)
408 {
409 t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
410 }
411 else if (n->def && n->def->definitionType()==Definition::TypeClass)
412 {
413 char icon=compoundIcon(toClassDef(n->def));
414 t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
415 }
416 else
417 {
418 t << "<span id=\"img_" << generateIndentLabel(n,0)
419 << "\" class=\"iconf"
420 << (nodeOpened?"open":"closed")
421 << "\" onclick=\"dynsection.toggleFolder('" << generateIndentLabel(n,0)
422 << "')\">&#160;</span>";
423 }
424 generateLink(t,n);
425 t << "</td><td class=\"desc\">";
426 if (n->def)
427 {
428 generateBriefDoc(t,n->def);
429 }
430 t << "</td></tr>\n";
431 folderId++;
432 generateTree(t,n->children,level+1,maxLevel,index);
433 }
434 else // leaf node
435 {
436 const FileDef *srcRef=nullptr;
437 if (n->def && n->def->definitionType()==Definition::TypeFile &&
438 (toFileDef(n->def))->generateSourceFile())
439 {
440 srcRef = toFileDef(n->def);
441 }
442 if (srcRef)
443 {
444 QCString fn=srcRef->getSourceFileBase();
446 t << "<a href=\"" << fn << "\">";
447 }
448 if (n->def && n->def->definitionType()==Definition::TypeGroup)
449 {
450 // no icon
451 }
452 else if (n->def && n->def->definitionType()==Definition::TypePage)
453 {
454 // no icon
455 }
456 else if (n->def && n->def->definitionType()==Definition::TypeNamespace)
457 {
458 if ((n->def->getLanguage() == SrcLangExt::Slice) || (n->def->getLanguage() == SrcLangExt::Fortran))
459 {
460 t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
461 }
462 else if ((n->def->getLanguage() == SrcLangExt::Java) || (n->def->getLanguage() == SrcLangExt::VHDL))
463 {
464 t << "<span class=\"icona\"><span class=\"icon\">P</span></span>";
465 }
466 else
467 {
468 t << "<span class=\"icona\"><span class=\"icon\">N</span></span>";
469 }
470 }
471 else if (n->def && n->def->definitionType()==Definition::TypeModule)
472 {
473 t << "<span class=\"icona\"><span class=\"icon\">M</span></span>";
474 }
475 else if (n->def && n->def->definitionType()==Definition::TypeClass)
476 {
477 char icon=compoundIcon(toClassDef(n->def));
478 t << "<span class=\"icona\"><span class=\"icon\">" << icon << "</span></span>";
479 }
480 else if (n->def && n->def->definitionType()==Definition::TypeConcept)
481 {
482 t << "<span class=\"icona\"><span class=\"icon\">R</span></span>";
483 }
484 else if (n->def && n->def->definitionType()==Definition::TypeDir)
485 {
486 t << "<span class=\"iconfclosed\"></span>";
487 }
488 else
489 {
490 t << "<span class=\"icondoc\"></span>";
491 }
492 if (srcRef)
493 {
494 t << "</a>";
495 }
496 generateLink(t,n);
497 t << "</td><td class=\"desc\">";
498 if (n->def)
499 {
500 generateBriefDoc(t,n->def);
501 }
502 t << "</td></tr>\n";
503 }
504 }
505}
virtual QCString getSourceFileBase() const =0
ClassDef * toClassDef(Definition *d)
FileDef * toFileDef(Definition *d)
Definition filedef.cpp:1892
static int folderId
Definition ftvhelp.cpp:43
static void generateBriefDoc(TextStream &t, const Definition *def)
Definition ftvhelp.cpp:322
static char compoundIcon(const ClassDef *cd)
Definition ftvhelp.cpp:345
static void generateIndent(TextStream &t, const FTVNodePtr &n, bool opened)
Definition ftvhelp.cpp:257
static QCString generateIndentLabel(const FTVNodePtr &n, int level)
Definition ftvhelp.cpp:245
void generateTree(TextStream &t, const FTVNodes &nl, int level, int maxLevel, int &index)
Definition ftvhelp.cpp:366
void generateLink(TextStream &t, const FTVNodePtr &n)
Definition ftvhelp.cpp:277
@ Fortran
Definition types.h:53
@ Slice
Definition types.h:59
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

References addHtmlExtensionIfMissing(), compoundIcon(), folderId, Fortran, generateBriefDoc(), generateIndent(), generateIndentLabel(), generateLink(), Definition::getSourceFileBase(), Java, Slice, toClassDef(), toFileDef(), Definition::TypeClass, Definition::TypeConcept, Definition::TypeDir, Definition::TypeFile, Definition::TypeGroup, Definition::TypeModule, Definition::TypeNamespace, Definition::TypePage, and VHDL.

Member Data Documentation

◆ indent

int FTVHelp::Private::indent = 0

Definition at line 108 of file ftvhelp.cpp.

◆ indentNodes

std::vector<FTVNodes> FTVHelp::Private::indentNodes

Definition at line 107 of file ftvhelp.cpp.

Referenced by Private().

◆ topLevelIndex

bool FTVHelp::Private::topLevelIndex

Definition at line 109 of file ftvhelp.cpp.

Referenced by generateLink(), and Private().


The documentation for this struct was generated from the following file: