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
contentblock.h
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef QDOC_IR_CONTENTBLOCK_H
5#define QDOC_IR_CONTENTBLOCK_H
6
7#include <QJsonObject>
8#include <QList>
9#include <QString>
10
11#include <optional>
12
13QT_BEGIN_NAMESPACE
14
15namespace IR {
16
34
35enum class LinkOrigin : unsigned char {
38};
39
48
50{
52 QString text; //!< Text content
53 QString href; //!< Link target or image source
54 QString title; //!< Link tooltip or image alt text
55 QList<InlineContent> children; //!< Nested inline content
56 QJsonObject attributes; //!< Type-specific metadata
57
62 std::optional<LinkData> link;
63
64 [[nodiscard]] QJsonObject toJson() const;
65 [[nodiscard]] QString plainText() const;
66};
67
95
97{
99 QJsonObject attributes; //!< Type-specific metadata
100 QList<InlineContent> inlineContent; //!< Rich inline content
101 QList<ContentBlock> children; //!< Nested blocks
102
103 [[nodiscard]] QJsonObject toJson() const;
104 [[nodiscard]] QString plainText() const;
105};
106
107} // namespace IR
108
109QT_END_NAMESPACE
110
111#endif // QDOC_IR_CONTENTBLOCK_H
Assembles IR Documents from pre-extracted metadata.
Definition builder.h:15
Builder()=default
Document buildPageIR(PageMetadata pm) const
Definition builder.cpp:175
Status
Specifies the status of the QQmlIncubator.
NodeType
Definition genustypes.h:150
Definition builder.cpp:14
static QList< ContentBlock > buildThreadSafetyAdmonition(const CppReferenceData::ThreadSafetyInfo &ts, const QString &typeWord)
Definition builder.cpp:86
static InlineContent makeResolvedLink(const QString &name, const QString &href)
Definition builder.cpp:53
LinkState
LinkOrigin
static void appendExceptionList(QList< InlineContent > &inlines, const QString &prefix, const QString &topicName, const QList< CppReferenceData::ThreadSafetyExceptionEntry > &exceptions)
Definition builder.cpp:63
BlockType
static InlineContent makeTopicLink(const QString &topicName)
Definition builder.cpp:43
static InlineContent makeTextInline(const QString &text)
Definition builder.cpp:35
static void gatherBodyTocEntries(const QList< ContentBlock > &blocks, QList< NavigationInfo::TocEntry > &out)
Definition builder.cpp:16
InlineType
Combined button and popup list for selecting options.
@ Active
Definition status.h:14
QString cmakeComponent
Definition document.h:60
QString logicalModuleVersion
Definition document.h:57
QList< MemberEntry > members
Definition document.h:77
QJsonObject toJson() const
Converts the CollectionInfo to a QJsonObject for template rendering.
Definition document.cpp:99
QString qtVariable
Definition document.h:58
QList< MemberEntry > classes
Definition document.h:76
QString cmakePackage
Definition document.h:59
QString logicalModuleName
Definition document.h:56
QList< MemberEntry > namespaces
Definition document.h:75
QString cmakeTargetItem
Definition document.h:61
Represents a structural block element in documentation.
QJsonObject toJson() const
Converts the ContentBlock to a QJsonObject for template rendering.
QList< InlineContent > inlineContent
Rich inline content.
QJsonObject attributes
Type-specific metadata.
QString plainText() const
Returns the concatenated plain text of this block's content, recursively.
QList< ContentBlock > children
Nested blocks.
QList< ThreadSafetyExceptionEntry > reentrantExceptions
Definition document.h:113
QList< ThreadSafetyExceptionEntry > nonReentrantExceptions
Definition document.h:115
QList< ThreadSafetyExceptionEntry > threadSafeExceptions
Definition document.h:114
QList< SignatureSpan > templateDeclSpans
Definition document.h:134
std::optional< ThreadSafetyInfo > threadSafety
Definition document.h:150
QList< ContentBlock > threadSafetyAdmonition
Definition document.h:151
QList< ComparisonEntry > comparisonEntries
Definition document.h:148
QString cmakeTargetLinkLibraries
Definition document.h:125
QList< DerivedClassEntry > derivedClasses
Definition document.h:131
QStringList ancestorNames
Definition document.h:145
QString fullNamespaceModuleName
Definition document.h:142
QString cmakeFindPackage
Definition document.h:124
std::optional< QmlNativeTypeLink > qmlNativeType
Definition document.h:129
QString obsoleteMembersUrl
Definition document.h:156
QString fullNamespaceHref
Definition document.h:141
QList< GroupEntry > groups
Definition document.h:153
QString selfComparisonCategory
Definition document.h:147
QList< BaseClassEntry > baseClasses
Definition document.h:130
QJsonObject toJson() const
Converts CppReferenceInfo to a QJsonObject for template rendering.
Definition document.cpp:139
Intermediate representation for a documentation topic.
Definition document.h:197
QList< ContentBlock > body
Definition document.h:213
QString fullTitle
Definition document.h:206
QString membersPageUrl
Definition document.h:233
QList< SectionIR > summarySections
Definition document.h:217
std::optional< QmlTypeInfo > qmlTypeInfo
Definition document.h:221
QString url
Definition document.h:207
QList< SectionIR > detailSections
Definition document.h:218
std::optional< NavigationInfo > navigationInfo
Definition document.h:230
Access access
Definition document.h:202
QString title
Definition document.h:205
QString brief
Definition document.h:210
std::optional< CppReferenceInfo > cppReferenceInfo
Definition document.h:227
Status status
Definition document.h:201
QJsonObject contentJson
Definition document.h:214
NodeType nodeType
Definition document.h:199
QString deprecatedSince
Definition document.h:209
std::optional< CollectionInfo > collectionInfo
Definition document.h:224
QJsonObject toJson() const
Converts the Document to a QJsonObject for template rendering.
Definition document.cpp:356
QString since
Definition document.h:208
Genus genus
Definition document.h:200
Represents inline content within a documentation block.
QJsonObject attributes
Type-specific metadata.
QString href
Link target or image source.
QJsonObject toJson() const
Converts the InlineContent to a QJsonObject for template rendering.
QString text
Text content.
QList< InlineContent > children
Nested inline content.
std::optional< LinkData > link
QString title
Link tooltip or image alt text.
QString plainText() const
Returns the concatenated plain text of this inline element and all its children, recursively.
std::optional< LinkEntry > nextLink
Definition document.h:188
QList< TocEntry > tocEntries
Definition document.h:190
QList< BreadcrumbEntry > breadcrumbs
Definition document.h:186
std::optional< LinkEntry > startLink
Definition document.h:189
std::optional< LinkEntry > previousLink
Definition document.h:187
QJsonObject toJson() const
Converts NavigationInfo to a QJsonObject for template rendering.
Definition document.cpp:291
std::optional< InheritsInfo > inherits
Definition document.h:37
QJsonObject toJson() const
Converts the QmlTypeInfo to a QJsonObject for template rendering.
Definition document.cpp:38
std::optional< NativeTypeInfo > nativeType
Definition document.h:49
QList< InheritedByEntry > inheritedBy
Definition document.h:43
QString importStatement
Definition document.h:28