Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
IR::NavigationInfo Struct Reference

#include <document.h>

Collaboration diagram for IR::NavigationInfo:

Classes

struct  BreadcrumbEntry
struct  LinkEntry
struct  TocEntry

Public Types

enum class  CrumbState { Link , Current , Unresolved }

Public Member Functions

QJsonObject toJson () const
 Converts NavigationInfo to a QJsonObject for template rendering.

Public Attributes

QList< BreadcrumbEntrybreadcrumbs
std::optional< LinkEntrypreviousLink
std::optional< LinkEntrynextLink
std::optional< LinkEntrystartLink
QList< TocEntrytocEntries
int tocDepth { -1 }

Detailed Description

Definition at line 161 of file document.h.

Member Enumeration Documentation

◆ CrumbState

enum class IR::NavigationInfo::CrumbState
strong
Enumerator
Link 
Current 
Unresolved 

Definition at line 163 of file document.h.

Member Function Documentation

◆ toJson()

QJsonObject IR::NavigationInfo::toJson ( ) const
nodiscard

Converts NavigationInfo to a QJsonObject for template rendering.

The breadcrumbs and tocEntries arrays are always emitted (empty when none exist) so templates can iterate without guards. Each breadcrumb carries a state discriminator (link, current, or unresolved) so templates can distinguish a resolvable link, the current page, and an unresolvable ancestor without conflating them through an empty href. Sequential link objects (prevLink, nextLink, startLink) are conditionally emitted only when set. The tocDepth integer is always emitted ({-1} means unlimited depth).

Definition at line 291 of file document.cpp.

Member Data Documentation

◆ breadcrumbs

QList<BreadcrumbEntry> IR::NavigationInfo::breadcrumbs

Definition at line 186 of file document.h.

◆ nextLink

std::optional<LinkEntry> IR::NavigationInfo::nextLink

Definition at line 188 of file document.h.

◆ previousLink

std::optional<LinkEntry> IR::NavigationInfo::previousLink

Definition at line 187 of file document.h.

◆ startLink

std::optional<LinkEntry> IR::NavigationInfo::startLink

Definition at line 189 of file document.h.

◆ tocDepth

int IR::NavigationInfo::tocDepth { -1 }

Definition at line 191 of file document.h.

Referenced by IR::Builder::buildPageIR().

◆ tocEntries

QList<TocEntry> IR::NavigationInfo::tocEntries

Definition at line 190 of file document.h.


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