Akonadi Search

akonadisearchsyntaxhighlighter.h
1/*
2 SPDX-FileCopyrightText: 2014-2024 Laurent Montel <montel@kde.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8#include <QRegularExpression>
9#include <QSyntaxHighlighter>
10namespace Akonadi
11{
12namespace Search
13{
14class Rule
15{
16public:
17 Rule() = default;
18 Rule(const QRegularExpression &r, const QTextCharFormat &f)
19 : pattern(r)
20 , format(f)
21 {
22 }
23 QRegularExpression pattern;
24 QTextCharFormat format;
25};
26
27class AkonadiSearchSyntaxHighlighter : public QSyntaxHighlighter
28{
30public:
31 explicit AkonadiSearchSyntaxHighlighter(QTextDocument *doc);
32 ~AkonadiSearchSyntaxHighlighter() override;
33
34 void highlightBlock(const QString &text) override;
35
36protected:
37 void init();
38 QList<Rule> m_rules;
39};
40}
41}
Q_OBJECTQ_OBJECT
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:52 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.