KuitSetup

KuitSetup Class Reference

#include <KuitSetup>

Public Member Functions

 ~KuitSetup ()
 
void setFormatForMarker (const QString &marker, Kuit::VisualFormat format)
 
void setTagClass (const QString &tagName, Kuit::TagClass aClass)
 
void setTagPattern (const QString &tagName, const QStringList &attribNames, Kuit::VisualFormat format, const KLocalizedString &pattern, Kuit::TagFormatter formatter=nullptr, int leadingNewlines=0)
 

Friends

KuitSetupKuit::setupForDomain (const QByteArray &domain)
 

Detailed Description

Class for modifying KUIT markup in a given domain.

Not directly constructed, but obtained through Kuit::setupForDomain.

Definition at line 103 of file kuitmarkup.h.

Constructor & Destructor Documentation

KuitSetup::~KuitSetup ( )

Destructor.

Definition at line 1095 of file kuitmarkup.cpp.

Member Function Documentation

void KuitSetup::setFormatForMarker ( const QString marker,
Kuit::VisualFormat  format 
)

Set the default visual format for a given UI marker.

Giving "@<major>" for marker means to set the format only for standalone @<major> marker, while "@<major>:" (with trailing colon) means to set the same format for all @<major>:<minor> combinations.

Defined UI marker major/minor combinations are listed in the section uimark_ctxt. If an UI marker combination outside of the defined is given as marker, it will be ignored.

Setting Kuit::UndefinedFormat as format means to fall back to default format for the given UI marker.

Parameters
markerthe UI marker
formatthe visual format

Definition at line 1116 of file kuitmarkup.cpp.

void KuitSetup::setTagClass ( const QString tagName,
Kuit::TagClass  aClass 
)

Set the KUIT class of the tag.

Parameters
tagNamethe name of the tag
aClassthe KUIT tag class

Definition at line 1111 of file kuitmarkup.cpp.

void KuitSetup::setTagPattern ( const QString tagName,
const QStringList attribNames,
Kuit::VisualFormat  format,
const KLocalizedString pattern,
Kuit::TagFormatter  formatter = nullptr,
int  leadingNewlines = 0 
)

Set the formatting string for a tag with attributes combination.

If a new tag name is given, this effectively defines a new tag. The same holds for attribute names.

The pattern string pattern should contain placeholders for inserting the text and the attribute values. %1 will be replaced with the wrapped text, and %2 and upwards with attribute values in the order given by attrNames. Non markup-aware translation call with context (ki18nc) should be used to create the pattern string.

In addition to the pattern, a formatting function of the type TagFormatter can be given. This function receives the full markup parsing context, so that it can do whatever is necessary with the wrapped text. The result of this function is then substituted into the pattern. You can also give an empty pattern (as KLocalizedString()) together with the formatting function, in which case the function is assumed to do everything and no substitution is performed.

Parameters
tagNamethe name of the tag
attribNamesthe names of the attributes (empty names are ignored)
formatthe target visual format
patternthe pattern string
leadingNewlinesthe number of new lines (\n) to be maintained between any preceding text and the text wrapped with this tag (for formats where it matters)

Definition at line 1100 of file kuitmarkup.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 30 2020 23:01:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.