Skip to main content

The FTVHelp Class Reference

A class that generates a dynamic tree view side panel. More...

Declaration

class FTVHelp { ... }

Included Headers

#include <src/ftvhelp.h>

Base class

classIndexIntf

Abstract interface for index generators. More...

Public Constructors Index

FTVHelp (bool LTI)

Public Destructor Index

~FTVHelp ()

Public Member Functions Index

voidinitialize ()
voidfinalize ()
voidincContentsDepth ()
voiddecContentsDepth ()
voidaddContentsItem (bool isDir, const QCString &name, const QCString &ref, const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex, const Definition *def, const QCString &nameAsHtml=QCString())
voidaddIndexItem (const Definition *, const MemberDef *, const QCString &, const QCString &)
voidaddIndexFile (const QCString &)
voidaddImageFile (const QCString &)
voidaddStyleSheetFile (const QCString &)
voidgenerateTreeView ()
voidgenerateTreeViewInline (TextStream &t)
voidgenerateTreeViewScripts ()

Private Member Attributes Index

std::unique_ptr< Private >p

Description

A class that generates a dynamic tree view side panel.

Definition at line 40 of file ftvhelp.h.

Public Constructors

FTVHelp()

FTVHelp::FTVHelp (bool TLI)

Constructs an ftv help object. The object has to be initialized before it can be used.

Declaration at line 43 of file ftvhelp.h, definition at line 120 of file ftvhelp.cpp.

120FTVHelp::FTVHelp(bool TLI) : p(std::make_unique<Private>(TLI)) {}

Reference p.

Referenced by ~FTVHelp.

Public Destructor

~FTVHelp()

FTVHelp::~FTVHelp ()

Definition at line 44 of file ftvhelp.h.

Reference FTVHelp.

Public Member Functions

addContentsItem()

void FTVHelp::addContentsItem (bool isDir, const QCString & name, const QCString & ref, const QCString & file, const QCString & anchor, bool separateIndex, bool addToNavIndex, const Definition * def, const QCString & nameAsHtml=QCString())
virtual

Add a list item to the contents file.

Parameters
isDir

TRUE if the item is a directory, FALSE if it is a text

name

the name of the item.

nameAsHtml

the name of the item in HTML format.

ref

the URL of to the item.

file

the file containing the definition of the item

anchor

the anchor within the file.

separateIndex

put the entries in a separate index file

addToNavIndex

add this entry to the quick navigation index

def

Definition corresponding to this entry

Declaration at line 51 of file ftvhelp.h, definition at line 186 of file ftvhelp.cpp.

187 const QCString &name,
188 const QCString &ref,
189 const QCString &file,
190 const QCString &anchor,
191 bool separateIndex,
192 bool addToNavIndex,
193 const Definition *def,
194 const QCString &nameAsHtml
195 )
196{
197 //printf("%p: p->indent=%d addContentsItem(%d,%s,%s,%s,%s)\n",(void*)this,p->indent,isDir,qPrint(name),qPrint(ref),qPrint(file),qPrint(anchor));
198 auto &nl = p->indentNodes[p->indent];
199 if (!nl.empty())
200 {
201 nl.back()->isLast=FALSE;
202 }
203 auto newNode = std::make_shared<FTVNode>(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def,nameAsHtml);
204 nl.push_back(newNode);
205 newNode->index = static_cast<int>(nl.size()-1);
206 if (p->indent>0)
207 {
208 auto &pnl = p->indentNodes[p->indent-1];
209 if (!pnl.empty())
210 {
211 newNode->parent = pnl.back();
212 }
213 }
214}

References FALSE and p.

Referenced by writeClassTree, writeClassTreeForList, writeClassTreeInsideNamespaceElement, writeClassTreeToOutput, writeConceptList, writeConceptRootList, writeConceptTreeInsideNamespaceElement, writeDirHierarchy, writeDirTreeNode, writeGroupTreeNode, writeModuleTreeNode, writeNamespaceTreeElement and writePages.

addImageFile()

void FTVHelp::addImageFile (const QCString &)
inline virtual

Definition at line 62 of file ftvhelp.h.

62 void addImageFile(const QCString &) {}

addIndexFile()

void FTVHelp::addIndexFile (const QCString &)
inline virtual

Definition at line 61 of file ftvhelp.h.

61 void addIndexFile(const QCString &) {}

addIndexItem()

void FTVHelp::addIndexItem (const Definition *, const MemberDef *, const QCString &, const QCString &)
inline virtual

Definition at line 60 of file ftvhelp.h.

60 void addIndexItem(const Definition *,const MemberDef *,const QCString &,const QCString &) {}

addStyleSheetFile()

void FTVHelp::addStyleSheetFile (const QCString &)
inline virtual

Definition at line 63 of file ftvhelp.h.

63 void addStyleSheetFile(const QCString &) {}

decContentsDepth()

void FTVHelp::decContentsDepth ()
virtual

Decrease the level of the contents hierarchy. This will end the current sublist.

See Also

incContentsDepth()

Declaration at line 50 of file ftvhelp.h, definition at line 154 of file ftvhelp.cpp.

155{
156 //printf("%p: decContentsDepth() indent=%d\n",this,p->indent);
157 ASSERT(p->indent>0);
158 if (p->indent>0)
159 {
160 p->indent--;
161 auto &nl = p->indentNodes[p->indent];
162 if (!nl.empty())
163 {
164 auto &parent = nl.back();
165 auto &children = p->indentNodes[p->indent+1];
166 for (const auto &child : children)
167 {
168 parent->children.push_back(child);
169 }
170 children.clear();
171 }
172 }
173}

References ASSERT, p and parent.

Referenced by writeClassTree, writeClassTreeInsideNamespaceElement, writeClassTreeToOutput, writeConceptTreeInsideNamespaceElement, writeDirTreeNode, writeGroupTreeNode, writeNamespaceTreeElement and writePages.

finalize()

void FTVHelp::finalize ()
virtual

Finalizes the FTV help. This will finish and close the contents file (index.js).

See Also

initialize()

Declaration at line 48 of file ftvhelp.h, definition at line 134 of file ftvhelp.cpp.

135{
137}

Reference generateTreeView.

generateTreeView()

void FTVHelp::generateTreeView ()

Declaration at line 64 of file ftvhelp.h, definition at line 934 of file ftvhelp.cpp.

Reference generateTreeViewScripts.

Referenced by finalize.

generateTreeViewInline()

void FTVHelp::generateTreeViewInline (TextStream & t)

Declaration at line 65 of file ftvhelp.h, definition at line 873 of file ftvhelp.cpp.

874{
875 int preferredNumEntries = Config_getInt(HTML_INDEX_NUM_ENTRIES);
876 t << "<div class=\"directory\">\n";
877 int d=1, depth=1;
878 for (const auto &n : p->indentNodes[0])
879 {
880 if (!n->children.empty())
881 {
882 d = n->computeTreeDepth(2);
883 if (d>depth) depth=d;
884 }
885 }
886 int preferredDepth = depth;
887 // write level selector
888 if (depth>1)
889 {
890 t << "<div class=\"levels\">[";
891 t << theTranslator->trDetailLevel();
892 t << " ";
893 for (int i=1;i<=depth;i++)
894 {
895 t << "<span onclick=\"javascript:dynsection.toggleLevel(" << i << ");\">" << i << "</span>";
896 }
897 t << "]</div>";
898
899 if (preferredNumEntries>0)
900 {
901 preferredDepth=1;
902 for (int i=1;i<=depth;i++)
903 {
904 int num=0;
905 for (const auto &n : p->indentNodes[0])
906 {
907 num+=n->numNodesAtLevel(0,i);
908 }
909 if (num<=preferredNumEntries)
910 {
911 preferredDepth=i;
912 }
913 else
914 {
915 break;
916 }
917 }
918 }
919 }
920 //printf("preferred depth=%d\n",preferredDepth);
921
922 if (!p->indentNodes[0].empty())
923 {
924 t << "<table class=\"directory\">\n";
925 int index=0;
926 p->generateTree(t,p->indentNodes[0],0,preferredDepth,index);
927 t << "</table>\n";
928 }
929
930 t << "</div><!-- directory -->\n";
931}

References Config_getInt, p and theTranslator.

Referenced by writeAnnotatedIndexGeneric, writeConceptIndex, writeFileIndex, writeHierarchicalExceptionIndex, writeHierarchicalIndex, writeHierarchicalInterfaceIndex, writeModuleIndex, writeNamespaceIndex, writePageIndex and writeTopicIndex.

generateTreeViewScripts()

void FTVHelp::generateTreeViewScripts ()

Declaration at line 66 of file ftvhelp.h, definition at line 864 of file ftvhelp.cpp.

865{
866 QCString htmlOutput = Config_getString(HTML_OUTPUT);
867
868 // generate navtree.js & navtreeindex.js
869 generateJSNavTree(p->indentNodes[0]);
870}

References Config_getString, generateJSNavTree and p.

Referenced by generateTreeView.

incContentsDepth()

void FTVHelp::incContentsDepth ()
virtual

Increase the level of the contents hierarchy. This will start a new sublist in contents file.

See Also

decContentsDepth()

Declaration at line 49 of file ftvhelp.h, definition at line 143 of file ftvhelp.cpp.

144{
145 //printf("%p: incContentsDepth() indent=%d\n",this,p->indent);
146 p->indent++;
147 p->indentNodes.resize(p->indent+1);
148}

Reference p.

Referenced by writeClassTree, writeClassTreeInsideNamespaceElement, writeClassTreeToOutput, writeConceptTreeInsideNamespaceElement, writeDirTreeNode, writeGroupTreeNode, writeNamespaceTreeElement and writePages.

initialize()

void FTVHelp::initialize ()
virtual

This will create a folder tree view table of contents file (tree.js).

See Also

finalize()

Declaration at line 47 of file ftvhelp.h, definition at line 126 of file ftvhelp.cpp.

127{
128}

Private Member Attributes

p

std::unique_ptr<Private> FTVHelp::p

Definition at line 69 of file ftvhelp.h.

69 std::unique_ptr<Private> p;

Referenced by addContentsItem, decContentsDepth, FTVHelp, generateTreeViewInline, generateTreeViewScripts and incContentsDepth.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.