Kuit Namespace

Global constants and functions related to KUIT markup. More...

Header: #include <Kuit>
CMake: find_package(KF6 REQUIRED COMPONENTS I18n)
target_link_libraries(mytarget PRIVATE KF6::I18n)

Types

enum TagClass { PhraseTag, StructTag }
TagFormatter
enum VisualFormat { UndefinedFormat, PlainText, RichText, TermText }

Functions

QString escape(const QString &text)
KuitSetup &setupForDomain(const QByteArray &domain)

Detailed Description

Type Documentation

enum Kuit::TagClass

Classification of KUIT tags.

ConstantValueDescription
Kuit::PhraseTag0Tags wrapping text inserted into running text.
Kuit::StructTag1Tags splitting text into paragraph-level blocks

Kuit::TagFormatter

Functions accepted by tag formatting functions.

languages the target languages (by decreasing priority)

tagName the wrapping tag name

attributes the attribute name-value pairs in the tag

text the wrapped text

tagPath the ordered list of ancestor tag names, parent first

format the target visual format

Returns formatted text

enum Kuit::VisualFormat

Visual formats into which KUIT markup can be resolved.

ConstantValueDescription
Kuit::UndefinedFormat0format not defined. This value can be explicitly set (e.g. through KLocalizedString::withFormat) to indicate that the format should be decided by another mechanism (e.g. context UI marker).
Kuit::PlainText10Plain Text
Kuit::RichText20Qt rich text (HTML subset).
Kuit::TermText30Terminal escape sequences.

Function Documentation

QString Kuit::escape(const QString &text)

Convert &, ", ', <, > characters into XML entities &amp;, &lt;, &gt;, &apos;, &quot;, respectively.

KuitSetup &Kuit::setupForDomain(const QByteArray &domain)

Get hold of the KUIT setup object for a given domain.

domain the translation domain

Returns pointer to KUIT setup object