7#include "akonadisearchsyntaxhighlighter.h"
10AkonadiSearchSyntaxHighlighter::AkonadiSearchSyntaxHighlighter(
QTextDocument *doc)
16AkonadiSearchSyntaxHighlighter::~AkonadiSearchSyntaxHighlighter() =
default;
18void AkonadiSearchSyntaxHighlighter::highlightBlock(
const QString &text)
20 for (
const Rule &rule : std::as_const(m_rules)) {
22 while (matchIterator.
hasNext()) {
29void AkonadiSearchSyntaxHighlighter::init()
36 testType << QStringLiteral(
"C\\d+");
40 testType << QStringLiteral(
"\\bF");
42 testType << QStringLiteral(
"\\bT");
44 testType << QStringLiteral(
"\\bCC");
46 testType << QStringLiteral(
"\\bBC");
48 testType << QStringLiteral(
"\\bO");
50 testType << QStringLiteral(
"\\bRT");
52 testType << QStringLiteral(
"\\bRF");
54 testType << QStringLiteral(
"\\bLI");
56 testType << QStringLiteral(
"\\bXL");
58 testType << QStringLiteral(
"\\bXML");
60 testType << QStringLiteral(
"\\bXSF");
62 testType << QStringLiteral(
"\\bBO");
66 testType << QStringLiteral(
"\\bNA");
68 testType << QStringLiteral(
"\\bNI");
71 testType << QStringLiteral(
"\\bO");
72 testType << QStringLiteral(
"\\bPS");
73 testType << QStringLiteral(
"\\bS");
74 testType << QStringLiteral(
"\\bL");
75 for (
const QString &s : std::as_const(testType)) {
77 m_rules.
append(Rule(regex, testFormat));
81#include "moc_akonadisearchsyntaxhighlighter.cpp"
Akonadi search infrastructure.
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
void append(QList< T > &&value)
bool hasNext() const const
QRegularExpressionMatch next()
void setFontWeight(int weight)
void setForeground(const QBrush &brush)