Doxygen
Loading...
Searching...
No Matches
layout.h File Reference
#include <memory>
#include <vector>
#include <utility>
#include "types.h"
#include "construct.h"
+ Include dependency graph for layout.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  LayoutDocEntry
 Base class representing a piece of a documentation page. More...
 
struct  LayoutDocEntrySimple
 Represents of a piece of a documentation page without configurable parts. More...
 
struct  LayoutDocEntrySection
 
struct  LayoutDocEntryMemberDecl
 Represents of a member declaration list with configurable title and subtitle. More...
 
struct  LayoutDocEntryMemberDef
 Represents of a member definition list with configurable title. More...
 
struct  LayoutNavEntry
 Base class for the layout of a navigation item at the top of the HTML pages. More...
 
class  LayoutDocManager
 Singleton providing access to the (user configurable) layout of the documentation. More...
 

Macros

#define ENTRY_SPECIFICATIONS
 
#define ESPEC(x)
 
#define ESPEC(x)
 
#define NAV_SPECIFICATIONS
 
#define NSPEC(x, y)
 
#define NSPEC(x, y)
 
#define PART_SPECIFICATIONS
 
#define PSPEC(x, y)
 
#define PSPEC(x, y)
 

Typedefs

using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>
 
using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>
 
using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >
 

Functions

void writeDefaultLayoutFile (const QCString &fileName)
 
void printLayout ()
 

Macro Definition Documentation

◆ ENTRY_SPECIFICATIONS

#define ENTRY_SPECIFICATIONS
Value:
/* Generic items for all pages */ \
ESPEC(MemberGroups) \
ESPEC(MemberDeclStart) ESPEC(MemberDeclEnd) ESPEC(MemberDecl) \
ESPEC(MemberDefStart) ESPEC(MemberDefEnd) ESPEC(MemberDef) \
ESPEC(BriefDesc) ESPEC(DetailedDesc) \
ESPEC(AuthorSection) \
/* Class specific items */ \
ESPEC(ClassIncludes) ESPEC(ClassInlineClasses) \
ESPEC(ClassInheritanceGraph) ESPEC(ClassNestedClasses) \
ESPEC(ClassCollaborationGraph) ESPEC(ClassAllMembersLink) \
ESPEC(ClassUsedFiles) \
/* Concept specific items */ \
ESPEC(ConceptDefinition) \
/* Namespace specific items */ \
ESPEC(NamespaceNestedNamespaces) ESPEC(NamespaceNestedConstantGroups) \
ESPEC(NamespaceClasses) ESPEC(NamespaceConcepts) ESPEC(NamespaceInterfaces) ESPEC(NamespaceStructs) ESPEC(NamespaceExceptions) \
ESPEC(NamespaceInlineClasses) \
/* File specific items */ \
ESPEC(FileClasses) ESPEC(FileConcepts) ESPEC(FileInterfaces) ESPEC(FileStructs) ESPEC(FileExceptions) ESPEC(FileConstantGroups) ESPEC(FileNamespaces) \
ESPEC(FileIncludes) ESPEC(FileIncludeGraph) \
ESPEC(FileIncludedByGraph) ESPEC(FileSourceLink) \
ESPEC(FileInlineClasses) \
/* C++20 Modules */ \
ESPEC(ModuleExports) ESPEC(ModuleClasses) ESPEC(ModuleConcepts) ESPEC(ModuleUsedFiles) \
/* Group specific items */ \
ESPEC(GroupClasses) ESPEC(GroupConcepts) ESPEC(GroupModules) ESPEC(GroupInlineClasses) ESPEC(GroupNamespaces) \
ESPEC(GroupDirs) ESPEC(GroupNestedGroups) ESPEC(GroupFiles) \
ESPEC(GroupGraph) ESPEC(GroupPageDocs) \
/* Directory specific items */ \
ESPEC(DirSubDirs) ESPEC(DirFiles) ESPEC(DirGraph)
A model of a class/file/namespace member symbol.
Definition memberdef.h:48
#define ESPEC(x)
Definition layout.h:68

Definition at line 35 of file layout.h.

35#define ENTRY_SPECIFICATIONS \
36 /* Generic items for all pages */ \
37 ESPEC(MemberGroups) \
38 ESPEC(MemberDeclStart) ESPEC(MemberDeclEnd) ESPEC(MemberDecl) \
39 ESPEC(MemberDefStart) ESPEC(MemberDefEnd) ESPEC(MemberDef) \
40 ESPEC(BriefDesc) ESPEC(DetailedDesc) \
41 ESPEC(AuthorSection) \
42 /* Class specific items */ \
43 ESPEC(ClassIncludes) ESPEC(ClassInlineClasses) \
44 ESPEC(ClassInheritanceGraph) ESPEC(ClassNestedClasses) \
45 ESPEC(ClassCollaborationGraph) ESPEC(ClassAllMembersLink) \
46 ESPEC(ClassUsedFiles) \
47 /* Concept specific items */ \
48 ESPEC(ConceptDefinition) \
49 /* Namespace specific items */ \
50 ESPEC(NamespaceNestedNamespaces) ESPEC(NamespaceNestedConstantGroups) \
51 ESPEC(NamespaceClasses) ESPEC(NamespaceConcepts) ESPEC(NamespaceInterfaces) ESPEC(NamespaceStructs) ESPEC(NamespaceExceptions) \
52 ESPEC(NamespaceInlineClasses) \
53 /* File specific items */ \
54 ESPEC(FileClasses) ESPEC(FileConcepts) ESPEC(FileInterfaces) ESPEC(FileStructs) ESPEC(FileExceptions) ESPEC(FileConstantGroups) ESPEC(FileNamespaces) \
55 ESPEC(FileIncludes) ESPEC(FileIncludeGraph) \
56 ESPEC(FileIncludedByGraph) ESPEC(FileSourceLink) \
57 ESPEC(FileInlineClasses) \
58 /* C++20 Modules */ \
59 ESPEC(ModuleExports) ESPEC(ModuleClasses) ESPEC(ModuleConcepts) ESPEC(ModuleUsedFiles) \
60 /* Group specific items */ \
61 ESPEC(GroupClasses) ESPEC(GroupConcepts) ESPEC(GroupModules) ESPEC(GroupInlineClasses) ESPEC(GroupNamespaces) \
62 ESPEC(GroupDirs) ESPEC(GroupNestedGroups) ESPEC(GroupFiles) \
63 ESPEC(GroupGraph) ESPEC(GroupPageDocs) \
64 /* Directory specific items */ \
65 ESPEC(DirSubDirs) ESPEC(DirFiles) ESPEC(DirGraph)

◆ ESPEC [1/2]

#define ESPEC ( x)
Value:
x,

Definition at line 68 of file layout.h.

◆ ESPEC [2/2]

#define ESPEC ( x)
Value:
case x: return #x; break;

Definition at line 68 of file layout.h.

◆ NAV_SPECIFICATIONS

#define NAV_SPECIFICATIONS

Definition at line 157 of file layout.h.

157#define NAV_SPECIFICATIONS \
158 NSPEC(None, = -1) \
159 NSPEC(MainPage,) \
160 NSPEC(Pages,) \
161 NSPEC(Modules,) \
162 NSPEC(ModuleList,) \
163 NSPEC(ModuleMembers,) \
164 NSPEC(Topics,) \
165 NSPEC(Namespaces,) \
166 NSPEC(NamespaceList,) \
167 NSPEC(NamespaceMembers,) \
168 NSPEC(Concepts,) \
169 NSPEC(Classes,) \
170 NSPEC(ClassList,) \
171 NSPEC(ClassIndex,) \
172 NSPEC(ClassHierarchy,) \
173 NSPEC(ClassMembers,) \
174 NSPEC(Interfaces,) \
175 NSPEC(InterfaceList,) \
176 NSPEC(InterfaceIndex,) \
177 NSPEC(InterfaceHierarchy,) \
178 NSPEC(Structs,) \
179 NSPEC(StructList,) \
180 NSPEC(StructIndex,) \
181 NSPEC(Exceptions,) \
182 NSPEC(ExceptionList,) \
183 NSPEC(ExceptionIndex,) \
184 NSPEC(ExceptionHierarchy,) \
185 NSPEC(Files,) \
186 NSPEC(FileList,) \
187 NSPEC(FileGlobals,) \
188 NSPEC(Examples,) \
189 NSPEC(User,) \
190 NSPEC(UserGroup,)

◆ NSPEC [1/2]

#define NSPEC ( x,
y )
Value:
x y,

Definition at line 194 of file layout.h.

◆ NSPEC [2/2]

#define NSPEC ( x,
y )
Value:
case x: return #x; break;

Definition at line 194 of file layout.h.

◆ PART_SPECIFICATIONS

#define PART_SPECIFICATIONS
Value:
PSPEC(Undefined, = -1) \
PSPEC(Class,) PSPEC(Concept,) PSPEC(Namespace,) PSPEC(File,) PSPEC(Group,) PSPEC(Directory,) PSPEC(Module,) \
PSPEC(NrParts,)
#define PSPEC(x, y)
Definition layout.h:267

Definition at line 256 of file layout.h.

256#define PART_SPECIFICATIONS \
257 PSPEC(Undefined, = -1) \
258 PSPEC(Class,) PSPEC(Concept,) PSPEC(Namespace,) PSPEC(File,) PSPEC(Group,) PSPEC(Directory,) PSPEC(Module,) \
259 PSPEC(NrParts,)

◆ PSPEC [1/2]

#define PSPEC ( x,
y )
Value:
x y,

Definition at line 267 of file layout.h.

◆ PSPEC [2/2]

#define PSPEC ( x,
y )
Value:
case x: return #x; break;

Definition at line 267 of file layout.h.

Typedef Documentation

◆ LayoutDocEntryList

using LayoutDocEntryList = std::vector<LayoutDocEntryPtr>

Definition at line 148 of file layout.h.

◆ LayoutDocEntryPtr

using LayoutDocEntryPtr = std::unique_ptr<LayoutDocEntry>

Definition at line 147 of file layout.h.

◆ LayoutNavEntryList

using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >

Definition at line 152 of file layout.h.

Function Documentation

◆ printLayout()

void printLayout ( )

Definition at line 1820 of file layout.cpp.

1821{
1822 bool extraIndent = false;
1823
1824 auto &mgr = LayoutDocManager::instance();
1825 Debug::print(Debug::Layout,0,"Layout version {}.{}\n",mgr.majorVersion(),mgr.minorVersion());
1826
1827 Debug::print(Debug::Layout,0,"Part: Navigation index\n");
1828 for (const auto &e : mgr.rootNavEntry()->children())
1829 {
1830 printNavLayout(e.get(),2);
1831 }
1832
1833 for (int i = 0; i < LayoutDocManager::NrParts; i++)
1834 {
1836 for (const auto &lde : mgr.docEntries(static_cast<LayoutDocManager::LayoutPart>(i)))
1837 {
1838 if (const LayoutDocEntrySimple *ldes = dynamic_cast<const LayoutDocEntrySimple*>(lde.get()))
1839 {
1840 if (lde->kind() == LayoutDocEntry::MemberDeclEnd || lde->kind() == LayoutDocEntry::MemberDefEnd) extraIndent = false;
1841 Debug::print(Debug::Layout,0," {}kind: {}, visible={}\n",
1842 extraIndent? " " : "",lde->entryToString(), ldes->visible());
1843 if (lde->kind() == LayoutDocEntry::MemberDeclStart || lde->kind() == LayoutDocEntry::MemberDefStart) extraIndent = true;
1844 }
1845 else if (const LayoutDocEntryMemberDecl *lmdecl = dynamic_cast<const LayoutDocEntryMemberDecl*>(lde.get()))
1846 {
1847 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1848 extraIndent? " " : "",lde->entryToString(),lmdecl->visible(),lmdecl->type.to_string());
1849 }
1850 else if (const LayoutDocEntryMemberDef *lmdef = dynamic_cast<const LayoutDocEntryMemberDef*>(lde.get()))
1851 {
1852 Debug::print(Debug::Layout,0," {}complex kind: {}, visible={}, type: {}\n",
1853 extraIndent? " " : "",lde->entryToString(),lmdef->visible(),lmdef->type.to_string());
1854 }
1855 else
1856 {
1857 // should not happen
1858 Debug::print(Debug::Layout,0," {}not handled kind: {}\n",extraIndent? " " : "",lde->entryToString());
1859 }
1860 }
1861 }
1862}
@ Layout
Definition debug.h:50
static void print(DebugMask mask, int prio, fmt::format_string< Args... > fmt, Args &&... args)
Definition debug.h:76
static std::string partToString(int k)
Definition layout.h:273
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1435
static void printNavLayout(LayoutNavEntry *root, int indent)
Definition layout.cpp:1805
Represents of a member declaration list with configurable title and subtitle.
Definition layout.h:112
Represents of a member definition list with configurable title.
Definition layout.h:132
Represents of a piece of a documentation page without configurable parts.
Definition layout.h:89

References LayoutDocManager::instance(), Debug::Layout, LayoutDocManager::partToString(), Debug::print(), and printNavLayout().

Referenced by LayoutDocManager::LayoutParser, and parseInput().

◆ writeDefaultLayoutFile()

void writeDefaultLayoutFile ( const QCString & fileName)

Definition at line 1732 of file layout.cpp.

1733{
1734 std::ofstream f;
1735 if (openOutputFile(fileName,f))
1736 {
1737 TextStream t(&f);
1738 QCString layout_default = ResourceMgr::instance().getAsString("layout_default.xml");
1739 t << substitute(layout_default,"$doxygenversion",getDoxygenVersion());
1740 }
1741 else
1742 {
1743 err("Failed to open file {} for writing!\n",fileName);
1744 return;
1745 }
1746 f.close();
1747}
This is an alternative implementation of QCString.
Definition qcstring.h:101
static ResourceMgr & instance()
Returns the one and only instance of this class.
QCString getAsString(const QCString &name) const
Gets the resource data as a C string.
Text streaming class that buffers data.
Definition textstream.h:36
#define err(fmt,...)
Definition message.h:127
QCString substitute(const QCString &s, const QCString &src, const QCString &dst)
substitute all occurrences of src in s by dst
Definition qcstring.cpp:477
bool openOutputFile(const QCString &outFile, std::ofstream &f)
Definition util.cpp:6720

References err, ResourceMgr::getAsString(), ResourceMgr::instance(), openOutputFile(), and substitute().

Referenced by LayoutDocManager::LayoutParser, and readConfiguration().