File indexing completed on 2024-05-12 15:50:05
0001 /* 0002 SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org> 0003 0004 SPDX-License-Identifier: MIT 0005 */ 0006 0007 #ifndef KSYNTAXHIGHLIGHTING_REPOSITORY_P_H 0008 #define KSYNTAXHIGHLIGHTING_REPOSITORY_P_H 0009 0010 #include <QHash> 0011 #include <QVector> 0012 0013 QT_BEGIN_NAMESPACE 0014 class QString; 0015 QT_END_NAMESPACE 0016 0017 namespace KSyntaxHighlighting 0018 { 0019 class Definition; 0020 class Repository; 0021 class Theme; 0022 0023 class RepositoryPrivate 0024 { 0025 public: 0026 RepositoryPrivate() = default; 0027 0028 static RepositoryPrivate *get(Repository *repo); 0029 0030 void load(Repository *repo); 0031 void loadSyntaxFolder(Repository *repo, const QString &path); 0032 bool loadSyntaxFolderFromIndex(Repository *repo, const QString &path); 0033 0034 void addDefinition(const Definition &def); 0035 0036 void loadThemeFolder(const QString &path); 0037 void addTheme(const Theme &theme); 0038 0039 quint16 foldingRegionId(const QString &defName, const QString &foldName); 0040 quint16 nextFormatId(); 0041 0042 QVector<QString> m_customSearchPaths; 0043 0044 // sorted map to have deterministic iteration order for e.g. definitionsForFileName 0045 QMap<QString, Definition> m_defs; 0046 0047 // this vector is sorted by translated sections/names 0048 QVector<Definition> m_sortedDefs; 0049 0050 QVector<Theme> m_themes; 0051 0052 QHash<QPair<QString, QString>, quint16> m_foldingRegionIds; 0053 quint16 m_foldingRegionId = 0; 0054 quint16 m_formatId = 0; 0055 }; 0056 } 0057 0058 #endif