Skip to main content

The PageDefImpl Class Reference

Declaration

class PageDefImpl { ... }

Base class

classDefinitionMixin<Base>

Public Constructors Index

PageDefImpl (const QCString &f, int l, const QCString &n, const QCString &d, const QCString &t)

Public Destructor Index

~PageDefImpl () override

Public Member Functions Index

voidsetFileName (const QCString &name) override
voidsetLocalToc (const LocalToc &tl) override
voidsetShowLineNo (bool) override
DefTypedefinitionType () const override
CodeSymbolTypecodeSymbolType () const override
boolisLinkableInProject () const override
boolisLinkable () const override
QCStringgetOutputFileBase () const override
QCStringanchor () const override
voidfindSectionsInDocumentation () override
QCStringtitle () const override
const GroupDef *getGroupDef () const override
const PageLinkedRefMap &getSubPages () const override
voidaddInnerCompound (Definition *d) override
boolvisibleInIndex () const override
booldocumentedPage () const override
boolhasSubPages () const override
boolhasParentPage () const override
boolhasTitle () const override
LocalToclocalToc () const override
voidsetPageScope (Definition *d) override
Definition *getPageScope () const override
QCStringdisplayName (bool=TRUE) const override
boolshowLineNo () const override
voidsetTitle (const QCString &title) override
voidwriteDocumentation (OutputList &ol) override
voidwriteTagFile (TextStream &) override
voidsetNestingLevel (int l) override
voidwritePageDocumentation (OutputList &ol) const override
voidaddSectionsToIndex () override
voidwritePageNavigation (OutputList &ol) const override

Private Member Attributes Index

QCStringm_fileName
QCStringm_title
PageLinkedRefMapm_subPages
Definition *m_pageScope
intm_nestingLevel
LocalTocm_localToc
boolm_showLineNo

Definition at line 31 of file pagedef.cpp.

Public Constructors

PageDefImpl()

PageDefImpl::PageDefImpl (const QCString & f, int l, const QCString & n, const QCString & d, const QCString & t)

Public Destructor

~PageDefImpl()

PageDefImpl::~PageDefImpl ()

Definition at line 35 of file pagedef.cpp.

Public Member Functions

addInnerCompound()

void PageDefImpl::addInnerCompound (Definition * d)
virtual

Definition at line 51 of file pagedef.cpp.

128{
130 {
131 PageDef *pd = toPageDef(def);
132 if (pd)
133 {
134 m_subPages.add(pd->name(),pd);
135 pd->setOuterScope(this);
136 if (this==Doxygen::mainPage.get())
137 {
139 }
140 else
141 {
143 }
144 }
145 }
146}

References Definition::definitionType, m_nestingLevel, m_subPages, Doxygen::mainPage, Definition::name, PageDef::setNestingLevel, DefinitionMutable::setOuterScope, toPageDef and Definition::TypePage.

addSectionsToIndex()

void PageDefImpl::addSectionsToIndex ()
virtual

Definition at line 67 of file pagedef.cpp.

149{
150 const SectionRefs &sectionRefs = getSectionRefs();
151 if (sectionRefs.empty()) return;
152 //printf("PageDefImpl::addSectionsToIndex()\n");
153 int level=1;
154 for (auto it = sectionRefs.begin(); it!=sectionRefs.end(); ++it)
155 {
156 const SectionInfo *si = *it;
157 SectionType type = si->type();
158 if (type.isSection())
159 {
160 //printf(" level=%d title=%s\n",level,qPrint(si->title));
161 int nextLevel = type.level();
162 if (nextLevel>level)
163 {
164 for (int i=level;i<nextLevel;i++)
165 {
166 Doxygen::indexList->incContentsDepth();
167 }
168 }
169 else if (nextLevel<level)
170 {
171 for (int i=nextLevel;i<level;i++)
172 {
173 Doxygen::indexList->decContentsDepth();
174 }
175 }
176 QCString title = si->title();
177 if (title.isEmpty()) title = si->label();
178 title = parseCommentAsText(this,nullptr,title,si->fileName(),si->lineNr());
179 QCString titleAsHtml = parseCommentAsHtml(this,nullptr,si->title(),si->fileName(),si->lineNr());
180 // determine if there is a next level inside this item, but be aware of the anchor and table section references.
181 auto it_next = std::next(it);
182 bool isDir = (it_next!=sectionRefs.end()) ? ((*it_next)->type().isSection() && (*it_next)->type().level() > nextLevel) : false;
183 Doxygen::indexList->addContentsItem(isDir, // isDir
184 title, // name
185 getReference(), // ref
186 getOutputFileBase(), // file
187 si->label(), // anchor
188 false, // separateIndex
189 true, // addToNavIndex
190 nullptr, // def
191 titleAsHtml); // nameAsHtml
192 level = nextLevel;
193 }
194 }
195 while (level>1)
196 {
197 Doxygen::indexList->decContentsDepth();
198 level--;
199 }
200}

References SectionRefs::begin, SectionRefs::empty, SectionRefs::end, SectionInfo::fileName, getOutputFileBase, DefinitionMixin< PageDef >::getReference, DefinitionMixin< PageDef >::getSectionRefs, Doxygen::indexList, SectionType::isSection, SectionInfo::label, SectionType::level, SectionInfo::lineNr, parseCommentAsHtml, parseCommentAsText, title, SectionInfo::title and SectionInfo::type.

anchor()

QCString PageDefImpl::anchor ()
inline virtual

Returns the anchor within a page where this item can be found

Definition at line 46 of file pagedef.cpp.

46 QCString anchor() const override { return QCString(); }

codeSymbolType()

CodeSymbolType PageDefImpl::codeSymbolType ()
inline virtual

Used for syntax highlighting symbol class

Definition at line 42 of file pagedef.cpp.

Reference Default.

definitionType()

DefType PageDefImpl::definitionType ()
inline virtual

Use this for dynamic inspection of the type of the derived class

Definition at line 41 of file pagedef.cpp.

41 DefType definitionType() const override { return TypePage; }

Reference Definition::TypePage.

displayName()

QCString PageDefImpl::displayName (bool includeScope=TRUE)
inline virtual

Returns the name of the definition as it appears in the output

Definition at line 60 of file pagedef.cpp.

60 QCString displayName(bool=TRUE) const override { return hasTitle() ? m_title : DefinitionMixin::name(); }

References hasTitle, m_title, DefinitionMixin< Base >::name and TRUE.

documentedPage()

bool PageDefImpl::documentedPage ()
virtual

Definition at line 53 of file pagedef.cpp.

446{
447 return // not part of a group
448 !getGroupDef() &&
449 // not an externally defined page
450 !isReference();
451}

References getGroupDef and DefinitionMixin< PageDef >::isReference.

findSectionsInDocumentation()

getGroupDef()

const GroupDef * PageDefImpl::getGroupDef ()
virtual

Definition at line 49 of file pagedef.cpp.

110{
111 return !partOfGroups().empty() ? partOfGroups().front() : nullptr;
112}

Reference DefinitionMixin< PageDef >::partOfGroups.

Referenced by documentedPage, getOutputFileBase and visibleInIndex.

getOutputFileBase()

QCString PageDefImpl::getOutputFileBase ()
virtual

Returns the base file name (without extension) of this definition. as it is referenced to/written to disk.

Definition at line 45 of file pagedef.cpp.

115{
116 if (getGroupDef())
118 else
119 return m_fileName;
120}

References getGroupDef, Definition::getOutputFileBase and m_fileName.

Referenced by addSectionsToIndex, writeDocumentation and writeTagFile.

getPageScope()

Definition * PageDefImpl::getPageScope ()
inline virtual

Definition at line 59 of file pagedef.cpp.

59 Definition *getPageScope() const override { return m_pageScope; }

Reference m_pageScope.

getSubPages()

const PageLinkedRefMap & PageDefImpl::getSubPages ()
inline virtual

Definition at line 50 of file pagedef.cpp.

50 const PageLinkedRefMap &getSubPages() const override { return m_subPages; }

Reference m_subPages.

hasParentPage()

bool PageDefImpl::hasParentPage ()
virtual

hasSubPages()

bool PageDefImpl::hasSubPages ()
virtual

Definition at line 54 of file pagedef.cpp.

454{
455 return !m_subPages.empty();
456}

Reference m_subPages.

Referenced by writePageDocumentation.

hasTitle()

bool PageDefImpl::hasTitle ()
virtual

Definition at line 56 of file pagedef.cpp.

479{
480 return !m_title.isEmpty() && m_title.lower()!="notitle";
481}

Reference m_title.

Referenced by displayName and writeDocumentation.

isLinkable()

bool PageDefImpl::isLinkable ()
inline virtual

Returns TRUE iff it is possible to link to this item. This can be a link to another project imported via a tag file.

Definition at line 44 of file pagedef.cpp.

44 bool isLinkable() const override { return isLinkableInProject() || isReference(); }

References isLinkableInProject and DefinitionMixin< PageDef >::isReference.

isLinkableInProject()

bool PageDefImpl::isLinkableInProject ()
inline virtual

Returns TRUE iff it is possible to link to this item within this project.

Definition at line 43 of file pagedef.cpp.

43 bool isLinkableInProject() const override { return /*hasDocumentation() &&*/ !isReference(); }

Reference DefinitionMixin< PageDef >::isReference.

Referenced by isLinkable.

localToc()

LocalToc PageDefImpl::localToc ()
inline virtual

Definition at line 57 of file pagedef.cpp.

57 LocalToc localToc() const override { return m_localToc; }

Reference m_localToc.

setFileName()

void PageDefImpl::setFileName (const QCString & name)
virtual

Definition at line 38 of file pagedef.cpp.

123{
125}

References m_fileName and DefinitionMixin< PageDef >::name.

setLocalToc()

void PageDefImpl::setLocalToc (const LocalToc & tl)
virtual

Definition at line 39 of file pagedef.cpp.

464{
465 m_localToc = lt;
466}

Reference m_localToc.

setNestingLevel()

void PageDefImpl::setNestingLevel (int l)
virtual

Definition at line 65 of file pagedef.cpp.

459{
461}

Reference m_nestingLevel.

setPageScope()

void PageDefImpl::setPageScope (Definition * d)
inline virtual

Definition at line 58 of file pagedef.cpp.

58 void setPageScope(Definition *d) override { m_pageScope = d; }

Reference m_pageScope.

setShowLineNo()

void PageDefImpl::setShowLineNo (bool b)
virtual

Definition at line 40 of file pagedef.cpp.

469{
470 m_showLineNo = b;
471}

Reference m_showLineNo.

setTitle()

void PageDefImpl::setTitle (const QCString & title)
virtual

Definition at line 62 of file pagedef.cpp.

484{
485 m_title = title;
486}

References m_title and title.

showLineNo()

bool PageDefImpl::showLineNo ()
virtual

Definition at line 61 of file pagedef.cpp.

474{
475 return m_showLineNo;
476}

Reference m_showLineNo.

title()

QCString PageDefImpl::title ()
inline virtual

Definition at line 48 of file pagedef.cpp.

48 QCString title() const override { return m_title; }

Reference m_title.

Referenced by addSectionsToIndex, setTitle, writeDocumentation and writeTagFile.

visibleInIndex()

bool PageDefImpl::visibleInIndex ()
virtual

Definition at line 52 of file pagedef.cpp.

437{
438 bool externalPages = Config_getBool(EXTERNAL_PAGES);
439 return // not part of a group
440 !getGroupDef() &&
441 // not an externally defined page
442 (!isReference() || externalPages);
443}

References Config_getBool, getGroupDef and DefinitionMixin< PageDef >::isReference.

writeDocumentation()

void PageDefImpl::writeDocumentation (OutputList & ol)
virtual

Definition at line 63 of file pagedef.cpp.

239{
240 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
241 int hierarchyLevel = -1; // Pages start at the root
242 PageDef *pd = this;
243 while (pd->hasParentPage())
244 {
245 pd = (PageDef *)pd->getOuterScope();
246 ++hierarchyLevel;
247 }
248
249 //outputList->disable(OutputType::Man);
250 QCString pageName,manPageName;
251 pageName = escapeCharsInString(name(),FALSE,TRUE);
252 manPageName = escapeCharsInString(name(),TRUE,TRUE);
253
254 //printf("PageDefImpl::writeDocumentation: %s\n",getOutputFileBase().data());
255
257 //1.{
258
260 //2.{
262 startFile(ol,getOutputFileBase(),manPageName,title(),HighlightedItem::Pages,!generateTreeView,
263 QCString() /* altSidebarName */, hierarchyLevel);
264 ol.enableAll();
266 startFile(ol,getOutputFileBase(),pageName,title(),HighlightedItem::Pages,!generateTreeView,
267 QCString() /* altSidebarName */, hierarchyLevel);
269 //2.}
270
271 if (!generateTreeView)
272 {
273 if (getOuterScope()!=Doxygen::globalScope && !Config_getBool(DISABLE_INDEX))
274 {
276 if (outerScope)
277 {
278 outerScope->writeNavigationPath(ol);
279 }
280 }
281 ol.endQuickIndices();
282 }
284
285 // save old generator state and write title only to Man generator
287 //2.{
289 ol.startTitleHead(manPageName);
290 ol.endTitleHead(manPageName, manPageName);
291 if (si)
292 {
293 ol.writeString(" - ");
294
295 if (si->title() != manPageName)
296 {
297 ol.generateDoc(docFile(),getStartBodyLine(),this,nullptr,si->title(),true,false,
298 QCString(),true,false,Config_getBool(MARKDOWN_SUPPORT),false);
299 ol.endSection(si->label(),si->type());
300 }
301 }
303 //2.}
304
306 //2.{
309 if (this == Doxygen::mainPage.get() && !hasTitle())
310 title = theTranslator->trMainPage();
311 else
312 title = m_title;
313
314 if (!title.isEmpty() && !name().isEmpty() && si!=nullptr)
315 {
316 ol.startPageDoc(si->title());
319 ol.generateDoc(docFile(),getStartBodyLine(),this,nullptr,title,true,false,
320 QCString(),true,false,Config_getBool(MARKDOWN_SUPPORT),false);
323 }
324 else
325 {
326 ol.startPageDoc("");
327 }
329 //2.}
330
331 bool pageWithSections = hasSections();
332 ol.startContents();
333 if ((m_localToc.isHtmlEnabled() || m_localToc.isLatexEnabled() || m_localToc.isDocbookEnabled())
334 && pageWithSections)
335 {
337 }
338
340 ol.endContents();
341 ol.endPageDoc();
342
343 if (generateTreeView && getOuterScope()!=Doxygen::globalScope && !Config_getBool(DISABLE_INDEX))
344 {
346 }
347 else
348 {
349 if (generateTreeView && Config_getBool(PAGE_OUTLINE_PANEL) && pageWithSections)
350 {
353 ol.writeString("</div><!-- doc-content -->\n");
355 ol.writeString("</div><!-- container -->\n");
357 endFile(ol,true);
358 }
359 else
360 {
361 endFile(ol,false,true);
362 }
363 }
364
366 //1.}
367}

References Config_getBool, OutputList::disable, OutputList::disableAllBut, DefinitionMixin< PageDef >::docFile, OutputList::enableAll, OutputList::endContents, endFile, endFileWithNavPath, OutputList::endHeaderSection, OutputList::endPageDoc, OutputList::endQuickIndices, OutputList::endSection, OutputList::endTitleHead, escapeCharsInString, FALSE, LinkedMap< T, Hash, KeyEqual, Map >::find, OutputList::generateDoc, Definition::getOuterScope, DefinitionMixin< PageDef >::getOuterScope, getOutputFileBase, DefinitionMixin< PageDef >::getStartBodyLine, Doxygen::globalScope, PageDef::hasParentPage, DefinitionMixin< PageDef >::hasSections, hasTitle, Html, SectionManager::instance, SectionInfo::label, m_localToc, m_title, Doxygen::mainPage, Man, DefinitionMixin< PageDef >::name, Pages, OutputList::popGeneratorState, OutputList::pushGeneratorState, OutputList::startContents, startFile, OutputList::startHeaderSection, OutputList::startPageDoc, OutputList::startTitleHead, theTranslator, title, SectionInfo::title, Definition::toDefinitionMutable, TRUE, SectionInfo::type, DefinitionMutable::writeNavigationPath, writePageDocumentation, writePageNavigation, OutputList::writeString and DefinitionMixin< PageDef >::writeToc.

writePageDocumentation()

void PageDefImpl::writePageDocumentation (OutputList & ol)
virtual

Definition at line 66 of file pagedef.cpp.

370{
371 ol.startTextBlock();
374 {
377 ol.writeString(" - ");
379 }
381 ol.generateDoc(
382 docFile(), // fileName
383 docLine(), // startLine
384 this, // context
385 nullptr, // memberdef
386 docStr, // docStr
387 true, // index words
388 false, // not an example
389 QCString(), // exampleName
390 false, // singleLine
391 false, // linkFromIndex
392 TRUE // markdown support
393 );
394 ol.enableAll();
396 ol.generateDoc(
397 docFile(), // fileName
398 docLine(), // startLine
399 this, // context
400 nullptr, // memberdef
401 docStr, // docStr
402 false, // index words
403 false, // not an example
404 QCString(), // exampleName
405 false, // singleLine
406 false, // linkFromIndex
407 TRUE // markdown support
408 );
410 ol.endTextBlock();
411
412 if (hasSubPages())
413 {
414 // for printed documentation we write subpages as section's of the
415 // parent page.
417 ol.disableAll();
421
422 for (const auto &subPage : m_subPages)
423 {
424 ol.writePageLink(subPage->getOutputFileBase(), FALSE);
425 }
426
428 }
429}

References DefinitionMixin< PageDef >::briefDescription, OutputList::disable, OutputList::disableAll, OutputList::disableAllBut, Docbook, DefinitionMixin< PageDef >::docFile, DefinitionMixin< PageDef >::docLine, DefinitionMixin< PageDef >::documentation, OutputList::enable, OutputList::enableAll, OutputList::endTextBlock, FALSE, OutputList::generateDoc, DefinitionMixin< PageDef >::hasBriefDescription, hasSubPages, Html, DefinitionMixin< PageDef >::inbodyDocumentation, SectionManager::instance, QCString::isEmpty, Latex, m_subPages, Man, DefinitionMixin< PageDef >::name, OutputList::popGeneratorState, OutputList::pushGeneratorState, RTF, OutputList::startTextBlock, TRUE, OutputList::writePageLink and OutputList::writeString.

Referenced by writeDocumentation.

writePageNavigation()

void PageDefImpl::writePageNavigation (OutputList & ol)
virtual

Definition at line 68 of file pagedef.cpp.

Reference OutputList::writePageOutline.

Referenced by writeDocumentation.

writeTagFile()

void PageDefImpl::writeTagFile (TextStream & tagFile)
virtual

Definition at line 64 of file pagedef.cpp.

209{
210 bool found = name()=="citelist";
212 {
213 if (rl->listName()==name())
214 {
215 found=TRUE;
216 break;
217 }
218 }
219 if (!found) // not one of the generated related pages
220 {
223 tagFile << " <compound kind=\"page\">\n";
224 tagFile << " <name>" << name() << "</name>\n";
225 tagFile << " <title>" << convertToXML(title()) << "</title>\n";
226 tagFile << " <filename>" << fn << "</filename>\n";
227 for (const auto &subPage : m_subPages)
228 {
229 QCString sfn = subPage->getOutputFileBase();
231 tagFile << " <subpage>" << sfn << "</subpage>\n";
232 }
234 tagFile << " </compound>\n";
235 }
236}

References addHtmlExtensionIfMissing, convertToXML, getOutputFileBase, RefListManager::instance, m_subPages, DefinitionMixin< PageDef >::name, title, TRUE and DefinitionMixin< PageDef >::writeDocAnchorsToTagFile.

Private Member Attributes

m_fileName

QCString PageDefImpl::m_fileName

Definition at line 71 of file pagedef.cpp.

Referenced by getOutputFileBase, PageDefImpl and setFileName.

m_localToc

LocalToc PageDefImpl::m_localToc

Definition at line 76 of file pagedef.cpp.

Referenced by localToc, setLocalToc and writeDocumentation.

m_nestingLevel

int PageDefImpl::m_nestingLevel

Definition at line 75 of file pagedef.cpp.

Referenced by addInnerCompound, PageDefImpl and setNestingLevel.

m_pageScope

Definition* PageDefImpl::m_pageScope

Definition at line 74 of file pagedef.cpp.

Referenced by getPageScope, PageDefImpl and setPageScope.

m_showLineNo

bool PageDefImpl::m_showLineNo

Definition at line 77 of file pagedef.cpp.

Referenced by PageDefImpl, setShowLineNo and showLineNo.

m_subPages

PageLinkedRefMap PageDefImpl::m_subPages

Definition at line 73 of file pagedef.cpp.

73 PageLinkedRefMap m_subPages; // list of pages in the group

Referenced by addInnerCompound, getSubPages, hasSubPages, writePageDocumentation and writeTagFile.

m_title

QCString PageDefImpl::m_title

Definition at line 72 of file pagedef.cpp.

Referenced by displayName, hasTitle, PageDefImpl, setTitle, title and writeDocumentation.


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


Generated via doxygen2docusaurus by Doxygen 1.14.0.