TextUtils::TextUtilsBlockCMarkSupport Class

The TextUtilsBlockCMarkSupport class Author: Laurent Montel <montel@kde.org>. More...

Header: #include <TextUtils/TextUtilsBlockCMarkSupport>
CMake: find_package(KF6TextUtils REQUIRED)
target_link_libraries(mytarget PRIVATE KF6::TextUtils)

Public Functions

TextUtilsBlockCMarkSupport()
virtual ~TextUtilsBlockCMarkSupport()
bool allowInsertText() const
QString convertMessageText(const QString &str, const QByteArray &uuid, const QString &searchText, int &numberOfTextSearched, int hightLightStringIndex)
void setAllowInsertText(bool newAllowInsertText)

Static Public Members

QString convertTextWithUrl(const QString &str)
int findNewLineOrEndLine(const QString &str, const QString &regionMarker, int startFrom)
int findNonEscaped(const QString &str, const QString &regionMarker, int startFrom)
bool isEscaped(const QString &str, int pos)
QString markdownToRichTextCMark(const QString &markDown)

Protected Functions

virtual QString addHighlighter(const QString &str, const QString &language, const QString &searchText, const QByteArray &uuid, int &blockCodeIndex, int &numberOfTextSearched, int hightLightStringIndex) = 0

Detailed Description

Member Function Documentation

TextUtilsBlockCMarkSupport::TextUtilsBlockCMarkSupport()

Constructor for TextUtilsBlockCMarkSupport

[virtual noexcept] TextUtilsBlockCMarkSupport::~TextUtilsBlockCMarkSupport()

Virtual destructor for TextUtilsBlockCMarkSupport

[pure virtual protected] QString TextUtilsBlockCMarkSupport::addHighlighter(const QString &str, const QString &language, const QString &searchText, const QByteArray &uuid, int &blockCodeIndex, int &numberOfTextSearched, int hightLightStringIndex)

bool TextUtilsBlockCMarkSupport::allowInsertText() const

allowInsertText Returns

See also setAllowInsertText().

QString TextUtilsBlockCMarkSupport::convertMessageText(const QString &str, const QByteArray &uuid, const QString &searchText, int &numberOfTextSearched, int hightLightStringIndex)

Converts message text with markdown support str The text to convert uuid The unique identifier for the message searchText The text to search for highlighting numberOfTextSearched The number of text matches found hightLightStringIndex The index of the highlight Returns The converted text with markdown formatting

[static] QString TextUtilsBlockCMarkSupport::convertTextWithUrl(const QString &str)

Converts text with URLs to markup str The text containing URLs Returns The text with URLs converted to markup

[static] int TextUtilsBlockCMarkSupport::findNewLineOrEndLine(const QString &str, const QString &regionMarker, int startFrom)

Finds the next newline or end of line str The string to search in regionMarker The marker to look for startFrom The position to start searching from Returns The position of the newline or end of line

[static] int TextUtilsBlockCMarkSupport::findNonEscaped(const QString &str, const QString &regionMarker, int startFrom)

Finds a non-escaped occurrence of a region marker str The string to search in regionMarker The marker to find startFrom The position to start searching from Returns The position of the marker, or -1 if not found

[static] bool TextUtilsBlockCMarkSupport::isEscaped(const QString &str, int pos)

Checks if a character at a position is escaped str The string containing the character pos The position of the character Returns True if the character is escaped, false otherwise

[static] QString TextUtilsBlockCMarkSupport::markdownToRichTextCMark(const QString &markDown)

Converts markdown with CommonMark format to rich text markDown The markdown text to convert Returns The rich text representation

void TextUtilsBlockCMarkSupport::setAllowInsertText(bool newAllowInsertText)

setAllowInsertText newAllowInsertText

See also allowInsertText().