KuitSetup
#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) |
Detailed Description
Class for modifying KUIT markup in a given domain.
Not directly constructed, but obtained through Kuit::setupForDomain
.
Definition at line 101 of file kuitsetup.h.
Constructor & Destructor Documentation
◆ ~KuitSetup()
KuitSetup::~KuitSetup | ( | ) |
Destructor.
Definition at line 1090 of file kuitsetup.cpp.
Member Function Documentation
◆ setFormatForMarker()
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
-
marker the UI marker format the visual format
Definition at line 1110 of file kuitsetup.cpp.
◆ setTagClass()
void KuitSetup::setTagClass | ( | const QString & | tagName, |
Kuit::TagClass | aClass ) |
Set the KUIT class of the tag.
- Parameters
-
tagName the name of the tag aClass the KUIT tag class
Definition at line 1105 of file kuitsetup.cpp.
◆ setTagPattern()
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
-
tagName the name of the tag attribNames the names of the attributes (empty names are ignored) format the target visual format pattern the pattern string leadingNewlines the 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 1095 of file kuitsetup.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:05:34 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.