Skip to main content

The LayoutNavEntry Struct Reference

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

Declaration

struct LayoutNavEntry { ... }

Included Headers

#include <src/layout.h>

Enumerations Index

enumKind { ... }

Friends Index

classLayoutDocManager

Public Constructors Index

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

Private Constructors Index

LayoutNavEntry ()

Public Member Functions Index

std::stringnavToString () const
LayoutNavEntry *parent () const
Kindkind () const
QCStringbaseFile () const
std::stringid () const
QCStringtitle () const
QCStringintro () const
QCStringurl () const
const LayoutNavEntryList &children () const
LayoutNavEntryList &children ()
voidsetVisible (bool v)
boolvisible () const
voidclear ()
voidinsertChild (size_t pos, std::unique_ptr< LayoutNavEntry > &&e)
voidappendChild (std::unique_ptr< LayoutNavEntry > &&e)
voidupdateVisibility (LayoutNavEntry *parent)
LayoutNavEntry *find (LayoutNavEntry::Kind k, const QCString &file=QCString()) const
voidswap (LayoutNavEntry &other)

Private Member Attributes Index

LayoutNavEntry *m_parent
Kindm_kind
boolm_visible
QCStringm_baseFile
QCStringm_title
QCStringm_intro
LayoutNavEntryListm_children

Description

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

Definition at line 155 of file layout.h.

Enumerations

Kind

enum LayoutNavEntry::Kind
Enumeration values
NAV_SPECIFICATIONS

Definition at line 193 of file layout.h.

193 enum Kind {
194#define NSPEC(x,y) x y,
196#undef NSPEC
197 };

Friends

LayoutDocManager

friend class LayoutDocManager

Definition at line 253 of file layout.h.

253 friend class LayoutDocManager;

Reference LayoutDocManager.

Referenced by LayoutDocManager.

Public Constructors

LayoutNavEntry()

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

Definition at line 209 of file layout.h.

210 const QCString &tl,const QCString &intro)

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

Referenced by find, LayoutNavEntry, parent, swap and updateVisibility.

Private Constructors

LayoutNavEntry()

LayoutNavEntry::LayoutNavEntry ()
inline

Definition at line 245 of file layout.h.

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

References m_kind, m_parent, m_visible and None.

Public Member Functions

appendChild()

void LayoutNavEntry::appendChild (std::unique_ptr< LayoutNavEntry > && e)

Declaration at line 225 of file layout.h, definition at line 121 of file layout.cpp.

121void LayoutNavEntry::appendChild(std::unique_ptr<LayoutNavEntry> &&e)
122{
123 e->updateVisibility(this);
124 m_children.push_back(std::move(e));
125}

Reference m_children.

baseFile()

QCString LayoutNavEntry::baseFile ()
inline

Definition at line 214 of file layout.h.

214 QCString baseFile() const { return m_baseFile; }

Reference m_baseFile.

Referenced by url and writeUserGroupStubPage.

children()

const LayoutNavEntryList & LayoutNavEntry::children ()
inline

children()

LayoutNavEntryList & LayoutNavEntry::children ()
inline

Definition at line 220 of file layout.h.

Reference m_children.

clear()

void LayoutNavEntry::clear ()
inline

Definition at line 223 of file layout.h.

223 void clear() { m_children.clear(); }

Reference m_children.

find()

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

Declaration at line 227 of file layout.h, definition at line 133 of file layout.cpp.

134 const QCString &file) const
135{
136 LayoutNavEntry *result=nullptr;
137 for (const auto &entry : m_children)
138 {
139 // depth first search, needed to find the entry furthest from the
140 // root in case an entry is in the tree twice
141 result = entry->find(kind,file);
142 if (result) return result;
143 if (entry->kind()==kind && (file==QCString() || entry->baseFile()==file))
144 {
145 return entry.get();
146 }
147 }
148 return result;
149}

References find, kind, LayoutNavEntry and m_children.

Referenced by find, generateJSNavTree, 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.

id()

std::string LayoutNavEntry::id ()
inline

Definition at line 215 of file layout.h.

215 std::string id() const { return navToString()+":"+m_baseFile.str(); }

References m_baseFile and navToString.

Referenced by findNavEntryRec and mergeNavTreeNodesRec.

insertChild()

void LayoutNavEntry::insertChild (size_t pos, std::unique_ptr< LayoutNavEntry > && e)

Declaration at line 224 of file layout.h, definition at line 127 of file layout.cpp.

127void LayoutNavEntry::insertChild(size_t pos,std::unique_ptr<LayoutNavEntry> &&e)
128{
129 e->updateVisibility(this);
130 m_children.insert(m_children.begin()+pos,std::move(e));
131}

Reference m_children.

Referenced by mergeNavTreeNodesRec.

intro()

kind()

Kind LayoutNavEntry::kind ()
inline

Definition at line 213 of file layout.h.

213 Kind kind() const { return m_kind; }

Reference m_kind.

Referenced by find, navToString and url.

navToString()

std::string LayoutNavEntry::navToString ()
inline

Definition at line 198 of file layout.h.

198 std::string navToString() const
199 {
200 switch (kind())
201 {
202#define NSPEC(x,y) case x: return #x; break;
204#undef NSPEC
205 default: return "unknown"; // to satisfy compiler
206 }
207 }

References kind and NAV_SPECIFICATIONS.

Referenced by id and printNavLayout.

parent()

LayoutNavEntry * LayoutNavEntry::parent ()
inline

Definition at line 212 of file layout.h.

212 LayoutNavEntry *parent() const { return m_parent; }

References LayoutNavEntry and m_parent.

Referenced by LayoutNavEntry, renderQuickLinksAsTabs and updateVisibility.

setVisible()

void LayoutNavEntry::setVisible (bool v)
inline

Definition at line 221 of file layout.h.

221 void setVisible(bool v) { m_visible = v; }

Reference m_visible.

swap()

void LayoutNavEntry::swap (LayoutNavEntry & other)
inline

Definition at line 228 of file layout.h.

228 void swap(LayoutNavEntry &other)
229 {
230 std::swap(m_parent,other.m_parent);
231 std::swap(m_kind,other.m_kind);
232 std::swap(m_visible,other.m_visible);
233 std::swap(m_baseFile,other.m_baseFile);
234 std::swap(m_title,other.m_title);
235 std::swap(m_intro,other.m_intro);
236 std::swap(m_children,other.m_children);
237 // reparent children
238 for (auto &child : m_children)
239 {
240 child->m_parent = this;
241 }
242 }

References LayoutNavEntry, m_baseFile, m_children, m_intro, m_kind, m_parent, m_title and m_visible.

title()

updateVisibility()

void LayoutNavEntry::updateVisibility (LayoutNavEntry * parent)

Declaration at line 226 of file layout.h, definition at line 116 of file layout.cpp.

117{
118 m_visible = m_visible && (parent==nullptr || parent->visible());
119}

References LayoutNavEntry, m_visible and parent.

url()

QCString LayoutNavEntry::url ()

Declaration at line 218 of file layout.h, definition at line 151 of file layout.cpp.

152{
154 if ((kind()!=LayoutNavEntry::User && kind()!=LayoutNavEntry::UserGroup) ||
155 (kind()==LayoutNavEntry::UserGroup && url.startsWith("usergroup")))
156 {
158 }
159 else if (url.startsWith("@ref ") || url.startsWith("\\ref "))
160 {
161 bool found=false;
162 QCString relPath = "";
163 QCString context = QCString();
164 auto parser { createDocParser() };
165 auto dfAst { createRef( *parser.get(), url.mid(5).stripWhiteSpace(), context ) };
166 auto dfAstImpl = dynamic_cast<const DocNodeAST*>(dfAst.get());
167 const DocRef *df = std::get_if<DocRef>(&dfAstImpl->root);
168 if (!df->file().isEmpty() || !df->anchor().isEmpty())
169 {
170 found = true;
171 url=externalRef(relPath,df->ref(),TRUE);
172 if (!df->file().isEmpty())
173 {
174 QCString fn = df->file();
176 url += fn;
177 }
178 if (!df->anchor().isEmpty())
179 {
180 url += "#" + df->anchor();
181 }
182 }
183 if (!found)
184 {
185 msg("explicit link request to '{}' in layout file '{}' could not be resolved\n",url.mid(5),Config_getString(LAYOUT_FILE));
186 }
187 }
188 //printf("LayoutNavEntry::url()=%s\n",qPrint(url));
189 return url;
190}

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

Referenced by url.

visible()

Private Member Attributes

m_baseFile

QCString LayoutNavEntry::m_baseFile

Definition at line 249 of file layout.h.

Referenced by baseFile, id, LayoutNavEntry and swap.

m_children

LayoutNavEntryList LayoutNavEntry::m_children

Definition at line 252 of file layout.h.

Referenced by appendChild, children, children, clear, find, insertChild and swap.

m_intro

QCString LayoutNavEntry::m_intro

Definition at line 251 of file layout.h.

Referenced by intro, LayoutNavEntry and swap.

m_kind

Kind LayoutNavEntry::m_kind

Definition at line 247 of file layout.h.

Referenced by kind, LayoutNavEntry, LayoutNavEntry and swap.

m_parent

LayoutNavEntry* LayoutNavEntry::m_parent

Definition at line 246 of file layout.h.

Referenced by LayoutNavEntry, LayoutNavEntry, parent and swap.

m_title

QCString LayoutNavEntry::m_title

Definition at line 250 of file layout.h.

Referenced by LayoutNavEntry, swap and title.

m_visible

bool LayoutNavEntry::m_visible

Definition at line 248 of file layout.h.

Referenced by LayoutNavEntry, LayoutNavEntry, setVisible, swap, updateVisibility and visible.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.