Doxygen
Loading...
Searching...
No Matches
LayoutNavEntry Struct Reference

Base class for the layout of a navigation item at the top of the HTML pages. More...

#include <src/layout.h>

+ Collaboration diagram for LayoutNavEntry:

Public Types

enum  Kind { NAV_SPECIFICATIONS }
 

Public Member Functions

std::string navToString ()
 
 LayoutNavEntry (LayoutNavEntry *parent, Kind k, bool vs, const QCString &bf, const QCString &tl, const QCString &intro)
 
LayoutNavEntryparent () const
 
Kind kind () const
 
QCString baseFile () const
 
QCString title () const
 
QCString intro () const
 
QCString url () const
 
void setVisible (bool v)
 
bool visible ()
 
void clear ()
 
void addChild (std::unique_ptr< LayoutNavEntry > &&e)
 
void prependChild (std::unique_ptr< LayoutNavEntry > &&e)
 
const LayoutNavEntryListchildren () const
 
LayoutNavEntryfind (LayoutNavEntry::Kind k, const QCString &file=QCString()) const
 

Private Member Functions

 LayoutNavEntry ()
 

Private Attributes

LayoutNavEntrym_parent
 
Kind m_kind
 
bool m_visible
 
QCString m_baseFile
 
QCString m_title
 
QCString m_intro
 
LayoutNavEntryList m_children
 

Friends

class LayoutDocManager
 

Detailed Description

Base class for the layout of a navigation item at the top of the HTML pages.

Definition at line 139 of file layout.h.

Member Enumeration Documentation

◆ Kind

Enumerator
NAV_SPECIFICATIONS 

Definition at line 177 of file layout.h.

177 {
178#define NSPEC(x,y) x y,
180#undef NSPEC
181 };
@ NAV_SPECIFICATIONS
Definition layout.h:179

Constructor & Destructor Documentation

◆ LayoutNavEntry() [1/2]

LayoutNavEntry::LayoutNavEntry ( LayoutNavEntry * parent,
Kind k,
bool vs,
const QCString & bf,
const QCString & tl,
const QCString & intro )
inline

Definition at line 193 of file layout.h.

195 : m_parent(parent), m_kind(k), m_visible(vs), m_baseFile(bf), m_title(tl), m_intro(intro) {}
QCString m_intro
Definition layout.h:219
bool m_visible
Definition layout.h:216
LayoutNavEntry * parent() const
Definition layout.h:196
QCString m_baseFile
Definition layout.h:217
Kind m_kind
Definition layout.h:215
QCString intro() const
Definition layout.h:200
LayoutNavEntry * m_parent
Definition layout.h:214
QCString m_title
Definition layout.h:218

References intro(), LayoutNavEntry(), m_baseFile, m_intro, m_kind, m_parent, m_title, m_visible, and parent().

Referenced by find(), LayoutNavEntry(), and parent().

◆ LayoutNavEntry() [2/2]

LayoutNavEntry::LayoutNavEntry ( )
inlineprivate

Definition at line 213 of file layout.h.

213: m_parent(nullptr), m_kind(None), m_visible(true) {}

References m_kind, m_parent, and m_visible.

Member Function Documentation

◆ addChild()

void LayoutNavEntry::addChild ( std::unique_ptr< LayoutNavEntry > && e)
inline

Definition at line 205 of file layout.h.

206 { m_children.push_back(std::move(e)); }
LayoutNavEntryList m_children
Definition layout.h:220

References m_children.

◆ baseFile()

QCString LayoutNavEntry::baseFile ( ) const
inline

Definition at line 198 of file layout.h.

198{ return m_baseFile; }

References m_baseFile.

Referenced by url(), and writeUserGroupStubPage().

◆ children()

◆ clear()

void LayoutNavEntry::clear ( )
inline

Definition at line 204 of file layout.h.

204{ m_children.clear(); }

References m_children.

◆ find()

LayoutNavEntry * LayoutNavEntry::find ( LayoutNavEntry::Kind k,
const QCString & file = QCString() ) const

Definition at line 122 of file layout.cpp.

124{
125 LayoutNavEntry *result=nullptr;
126 for (const auto &entry : m_children)
127 {
128 // depth first search, needed to find the entry furthest from the
129 // root in case an entry is in the tree twice
130 result = entry->find(kind,file);
131 if (result) return result;
132 if (entry->kind()==kind && (file==QCString() || entry->baseFile()==file))
133 {
134 return entry.get();
135 }
136 }
137 return result;
138}
LayoutNavEntry * find(LayoutNavEntry::Kind k, const QCString &file=QCString()) const
Definition layout.cpp:122
Kind kind() const
Definition layout.h:197
LayoutNavEntry(LayoutNavEntry *parent, Kind k, bool vs, const QCString &bf, const QCString &tl, const QCString &intro)
Definition layout.h:193

References find(), kind(), LayoutNavEntry(), and m_children.

Referenced by find(), generateJSNavTree(), LayoutParser::startTop(), writeAlphabeticalExceptionIndex(), writeAlphabeticalIndex(), writeAlphabeticalInterfaceIndex(), writeAlphabeticalStructIndex(), writeAnnotatedIndexGeneric(), writeClassMemberIndex(), writeClassMemberIndexFiltered(), writeConceptIndex(), writeDefaultQuickLinks(), writeExampleIndex(), writeFileIndex(), writeFileMemberIndex(), writeFileMemberIndexFiltered(), writeGraphicalClassHierarchy(), writeGraphicalExceptionHierarchy(), writeGraphicalInterfaceHierarchy(), writeHierarchicalExceptionIndex(), writeHierarchicalIndex(), writeHierarchicalInterfaceIndex(), writeIndex(), writeModuleIndex(), writeModuleMemberIndex(), writeModuleMemberIndexFiltered(), writeNamespaceIndex(), writeNamespaceMemberIndex(), writeNamespaceMemberIndexFiltered(), writePageIndex(), writePages(), and writeTopicIndex().

◆ intro()

◆ kind()

Kind LayoutNavEntry::kind ( ) const
inline

Definition at line 197 of file layout.h.

197{ return m_kind; }

References m_kind.

Referenced by find(), navToString(), and url().

◆ navToString()

std::string LayoutNavEntry::navToString ( )
inline

Definition at line 182 of file layout.h.

183 {
184 switch (kind())
185 {
186#define NSPEC(x,y) case x: return #x; break;
188#undef NSPEC
189 default: return "unknown"; // to satisfy compiler
190 }
191 }

References kind(), and NAV_SPECIFICATIONS.

Referenced by printNavLayout().

◆ parent()

LayoutNavEntry * LayoutNavEntry::parent ( ) const
inline

Definition at line 196 of file layout.h.

196{ return m_parent; }

References LayoutNavEntry(), and m_parent.

Referenced by LayoutNavEntry(), and renderQuickLinksAsTabs().

◆ prependChild()

void LayoutNavEntry::prependChild ( std::unique_ptr< LayoutNavEntry > && e)
inline

Definition at line 207 of file layout.h.

208 { m_children.insert(m_children.begin(),std::move(e)); }

References m_children.

◆ setVisible()

void LayoutNavEntry::setVisible ( bool v)
inline

Definition at line 202 of file layout.h.

202{ m_visible = v; }

References m_visible.

◆ title()

◆ url()

QCString LayoutNavEntry::url ( ) const

Definition at line 140 of file layout.cpp.

141{
142 QCString url = baseFile().stripWhiteSpace();
143 if ((kind()!=LayoutNavEntry::User && kind()!=LayoutNavEntry::UserGroup) ||
144 (kind()==LayoutNavEntry::UserGroup && url.startsWith("usergroup")))
145 {
147 }
148 else if (url.startsWith("@ref ") || url.startsWith("\\ref "))
149 {
150 bool found=false;
151 QCString relPath = "";
152 QCString context = QCString();
153 auto parser { createDocParser() };
154 auto dfAst { createRef( *parser.get(), url.mid(5).stripWhiteSpace(), context ) };
155 auto dfAstImpl = dynamic_cast<const DocNodeAST*>(dfAst.get());
156 const DocRef *df = std::get_if<DocRef>(&dfAstImpl->root);
157 if (!df->file().isEmpty() || !df->anchor().isEmpty())
158 {
159 found = true;
160 url=externalRef(relPath,df->ref(),TRUE);
161 if (!df->file().isEmpty())
162 {
163 QCString fn = df->file();
165 url += fn;
166 }
167 if (!df->anchor().isEmpty())
168 {
169 url += "#" + df->anchor();
170 }
171 }
172 if (!found)
173 {
174 msg("explicit link request to '%s' in layout file '%s' could not be resolved\n",qPrint(url.mid(5)),qPrint(Config_getString(LAYOUT_FILE)));
175 }
176 }
177 //printf("LayoutNavEntry::url()=%s\n",qPrint(url));
178 return url;
179}
QCString anchor() const
Definition docnode.h:765
QCString file() const
Definition docnode.h:762
QCString ref() const
Definition docnode.h:764
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:245
#define Config_getString(name)
Definition config.h:32
IDocParserPtr createDocParser()
factory function to create a parser
Definition docparser.cpp:54
IDocNodeASTPtr createRef(IDocParser &parserIntf, const QCString &target, const QCString &context, const QCString &srcFile, int srcLine)
void msg(const char *fmt,...)
Definition message.cpp:98
const char * qPrint(const char *s)
Definition qcstring.h:661
#define TRUE
Definition qcstring.h:37
QCString url() const
Definition layout.cpp:140
QCString baseFile() const
Definition layout.h:198
QCString externalRef(const QCString &relPath, const QCString &ref, bool href)
Definition util.cpp:6065
bool found
Definition util.cpp:984
void addHtmlExtensionIfMissing(QCString &fName)
Definition util.cpp:5243

References addHtmlExtensionIfMissing(), DocRef::anchor(), baseFile(), Config_getString, createDocParser(), createRef(), externalRef(), DocRef::file(), found, QCString::isEmpty(), kind(), msg(), qPrint(), DocRef::ref(), QCString::stripWhiteSpace(), TRUE, and url().

Referenced by url().

◆ visible()

Friends And Related Symbol Documentation

◆ LayoutDocManager

friend class LayoutDocManager
friend

Definition at line 221 of file layout.h.

References LayoutDocManager.

Referenced by LayoutDocManager.

Member Data Documentation

◆ m_baseFile

QCString LayoutNavEntry::m_baseFile
private

Definition at line 217 of file layout.h.

Referenced by baseFile(), and LayoutNavEntry().

◆ m_children

LayoutNavEntryList LayoutNavEntry::m_children
private

Definition at line 220 of file layout.h.

Referenced by addChild(), children(), clear(), find(), and prependChild().

◆ m_intro

QCString LayoutNavEntry::m_intro
private

Definition at line 219 of file layout.h.

Referenced by intro(), and LayoutNavEntry().

◆ m_kind

Kind LayoutNavEntry::m_kind
private

Definition at line 215 of file layout.h.

Referenced by kind(), LayoutNavEntry(), and LayoutNavEntry().

◆ m_parent

LayoutNavEntry* LayoutNavEntry::m_parent
private

Definition at line 214 of file layout.h.

Referenced by LayoutNavEntry(), LayoutNavEntry(), and parent().

◆ m_title

QCString LayoutNavEntry::m_title
private

Definition at line 218 of file layout.h.

Referenced by LayoutNavEntry(), and title().

◆ m_visible

bool LayoutNavEntry::m_visible
private

Definition at line 216 of file layout.h.

Referenced by LayoutNavEntry(), LayoutNavEntry(), setVisible(), and visible().


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