1 | /* |
2 | SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> |
3 | |
4 | SPDX-License-Identifier: MIT |
5 | */ |
6 | |
7 | #ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_P_H |
8 | #define KSYNTAXHIGHLIGHTING_REPOSITORY_P_H |
9 | |
10 | #include <QHash> |
11 | #include <QList> |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | class QString; |
15 | QT_END_NAMESPACE |
16 | |
17 | namespace KSyntaxHighlighting |
18 | { |
19 | class Definition; |
20 | class Repository; |
21 | class Theme; |
22 | |
23 | class RepositoryPrivate |
24 | { |
25 | public: |
26 | RepositoryPrivate() = default; |
27 | |
28 | static RepositoryPrivate *get(Repository *repo); |
29 | |
30 | void load(Repository *repo); |
31 | void loadSyntaxFolder(Repository *repo, const QString &path); |
32 | bool loadSyntaxFolderFromIndex(Repository *repo, const QString &path); |
33 | |
34 | void addDefinition(const Definition &def); |
35 | |
36 | void loadThemeFolder(const QString &path); |
37 | void addTheme(const Theme &theme); |
38 | |
39 | int foldingRegionId(const QString &defName, const QString &foldName); |
40 | int nextFormatId(); |
41 | |
42 | QList<QString> m_customSearchPaths; |
43 | |
44 | // sorted map to have deterministic iteration order for e.g. definitionsForFileName |
45 | QMap<QString, Definition> m_defs; |
46 | |
47 | // this vector is sorted by translated sections/names |
48 | QList<Definition> m_sortedDefs; |
49 | |
50 | QList<Theme> m_themes; |
51 | |
52 | QHash<QPair<QString, QString>, int> m_foldingRegionIds; |
53 | int m_foldingRegionId = 0; |
54 | int m_formatId = 0; |
55 | }; |
56 | } |
57 | |
58 | #endif |
59 | |