KTextEditor

katesyntaxmanager.h
1/*
2 SPDX-FileCopyrightText: 2001, 2002 Joseph Wenninger <jowenn@kde.org>
3 SPDX-FileCopyrightText: 2001 Christoph Cullmann <cullmann@kde.org>
4 SPDX-FileCopyrightText: 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#ifndef KATE_SYNTAX_MANAGER_H
10#define KATE_SYNTAX_MANAGER_H
11
12#include <KSyntaxHighlighting/Definition>
13#include <KSyntaxHighlighting/Repository>
14#include <KSyntaxHighlighting/Theme>
15
16#include <QObject>
17
18#include <memory>
19#include <unordered_map>
20
21class KateHighlighting;
22
23class KateHlManager : public QObject
24{
26
27public:
28 KateHlManager() = default;
29
30 static KateHlManager *self();
31
32 KateHighlighting *getHl(int n);
33 int nameFind(const QString &name) const;
34
35 void reload();
36
38 void changed();
39
40 //
41 // methods to get the default style count + names
42 //
43public:
44 /**
45 * Get the mode list
46 * @return mode list
47 */
49 {
50 return m_repository.definitions();
51 }
52
53 /**
54 * Get repository.
55 * @return repository
56 */
58 {
59 return m_repository;
60 }
61
62 /**
63 * Get repository (const).
64 * @return repository
65 */
66 const KSyntaxHighlighting::Repository &repository() const
67 {
68 return m_repository;
69 }
70
71 /**
72 * Sorted list of KSyntaxHighlighting themes.
73 * @return list sorted by translated names for e.g. menus/...
74 */
75 QList<KSyntaxHighlighting::Theme> sortedThemes() const;
76
77private:
78 /**
79 * Syntax highlighting definitions.
80 */
82
83 /**
84 * All loaded highlightings.
85 */
86 std::unordered_map<QString, std::unique_ptr<KateHighlighting>> m_hlDict;
87};
88#endif
Q_INVOKABLE QList< KSyntaxHighlighting::Definition > definitions() const
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:56 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.