Ki18n
|
#include <kuitmarkup.h>
Public Member Functions | |
~KUITSetup () | |
void | setTagPattern (const QString &tagName, const QStringList &attrNames, KUIT::VisualFormat format, const KLocalizedString &pattern) |
void | setTagPattern (const QString &tagName, const QStringList &attrNames, KUIT::VisualFormat format, const KUIT::TagFormatter formatter) |
void | setTagClass (const QString &tagName, KUIT::TagClass aClass) |
void | setFormatForMarker (const QString &marker, KUIT::VisualFormat format) |
Class for modifying KUIT markup in a given catalog.
Not directly constructed, but obtained through KUIT::setupForCatalog
.
KUITSetup::~KUITSetup | ( | ) |
Destructor.
void KUITSetup::setTagPattern | ( | const QString & | tagName, |
const QStringList & | attrNames, | ||
KUIT::VisualFormat | format, | ||
const KLocalizedString & | pattern | ||
) |
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.
tagName | the name of the tag |
attrNames | the names of the attributes |
format | the target visual format |
pattern | the pattern string |
void KUITSetup::setTagPattern | ( | const QString & | tagName, |
const QStringList & | attrNames, | ||
KUIT::VisualFormat | format, | ||
const KUIT::TagFormatter | formatter | ||
) |
Set the formatting function for a tag with attributes combination.
This is like setTagPattern
with a string pattern, except that a function instead of simple string substitution is used to format the text.
tagName | the name of the tag |
attrNames | the names of the attributes |
format | the target visual format |
formatter | the formatting function |
void KUITSetup::setTagClass | ( | const QString & | tagName, |
KUIT::TagClass | aClass | ||
) |
void KUITSetup::setFormatForMarker | ( | const QString & | marker, |
KUIT::VisualFormat | format | ||
) |
Set the default visual format for 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.
Setting KUIT::UndefinedFormat
as format
means to fall back to default format for the given UI marker.
marker | the UI marker |
format | the visual format |