KSyntaxHighlighting

kquicksyntaxhighlighter.h
1/*
2 SPDX-FileCopyrightText: 2018 Eike Hein <hein@kde.org>
3 SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
4
5 SPDX-License-Identifier: MIT
6*/
7
8#ifndef KQUICKSYNTAXHIGHLIGHTER_H
9#define KQUICKSYNTAXHIGHLIGHTER_H
10
11#include <KSyntaxHighlighting/Definition>
12#include <KSyntaxHighlighting/Theme>
13
14#include <QObject>
15#include <QVariant>
16
17namespace KSyntaxHighlighting
18{
19class Repository;
20class SyntaxHighlighter;
21}
22
23class KQuickSyntaxHighlighter : public QObject
24{
26
27 Q_PROPERTY(QObject *textEdit READ textEdit WRITE setTextEdit NOTIFY textEditChanged)
28 Q_PROPERTY(QVariant definition READ definition WRITE setDefinition NOTIFY definitionChanged)
29 Q_PROPERTY(QVariant theme READ theme WRITE setTheme NOTIFY themeChanged)
30 Q_PROPERTY(KSyntaxHighlighting::Repository *repository READ repository WRITE setRepository NOTIFY repositoryChanged)
31
32public:
33 explicit KQuickSyntaxHighlighter(QObject *parent = nullptr);
34 ~KQuickSyntaxHighlighter() override;
35
36 QObject *textEdit() const;
37 void setTextEdit(QObject *textEdit);
38
39 QVariant definition() const;
40 void setDefinition(const QVariant &definition);
41
42 QVariant theme() const;
43 void setTheme(const QVariant &theme);
44
45 KSyntaxHighlighting::Repository *repository() const;
46 void setRepository(KSyntaxHighlighting::Repository *repository);
47
49 void textEditChanged() const;
50 void definitionChanged() const;
51 void themeChanged();
52 void repositoryChanged();
53
54private:
55 KSyntaxHighlighting::Repository *unwrappedRepository() const;
56
57 QObject *m_textEdit;
60 KSyntaxHighlighting::Repository *m_repository = nullptr;
61 KSyntaxHighlighting::SyntaxHighlighter *m_highlighter = nullptr;
62};
63
64#endif // KQUICKSYNTAXHIGHLIGHTER_H
Represents a syntax definition.
Definition definition.h:83
Syntax highlighting repository.
Definition repository.h:122
A QSyntaxHighlighter implementation for use with QTextDocument.
Color theme definition used for highlighting.
Definition theme.h:65
Syntax highlighting engine for Kate syntax definitions.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SIGNALSQ_SIGNALS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:17:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.