KSyntaxHighlighting
repository.cpp
62 // The two function templates below take defs - a map sorted by highlighting name - to be deterministic and independent of translations.
65 Definition findHighestPriorityDefinitionIf(const QMap<QString, Definition> &defs, UnaryPredicate predicate)
80 QVector<Definition> findDefinitionsIf(const QMap<QString, Definition> &defs, UnaryPredicate predicate)
84 std::stable_sort(matches.begin(), matches.end(), [](const Definition &lhs, const Definition &rhs) {
127 return findHighestPriorityDefinitionIf(d->m_defs, anyWildcardMatches(fileNameFromFilePath(fileName)));
155 static auto lowerBoundTheme(const QVector<KSyntaxHighlighting::Theme> &themes, QStringView themeName)
157 return std::lower_bound(themes.begin(), themes.end(), themeName, [](const Theme &lhs, QStringView rhs) {
192 const auto background = theme.editorColor(KSyntaxHighlighting::Theme::EditorColorRole::BackgroundColor);
201 auto selection = theme->editorColor(KSyntaxHighlighting::Theme::EditorColorRole::TextSelection);
210 return defaultTheme((base.lightness() < 128) ? KSyntaxHighlighting::Repository::DarkTheme : KSyntaxHighlighting::Repository::LightTheme);
244 QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, QStringLiteral("katepart5/syntax"), QStandardPaths::LocateDirectory)) {
264 std::sort(m_sortedDefs.begin(), m_sortedDefs.end(), [](const Definition &left, const Definition &right) {
const QColor & color(QPalette::ColorGroup group, QPalette::ColorRole role) const const
LocateDirectory
Definition definitionForMimeType(const QString &mimeType) const
Returns the best matching Definition to the type named mimeType.
Definition: repository.cpp:135
ReadOnly
Base
QVector::iterator begin()
void append(const T &value)
Theme defaultTheme(DefaultTheme t=LightTheme) const
Returns a default theme instance of the given type.
Definition: repository.cpp:172
Files
Theme theme(const QString &themeName) const
Returns the theme called themeName.
Definition: repository.cpp:162
QRgb editorColor(EditorColorRole role) const
Returns the editor color for the requested role.
Definition: theme.cpp:102
T & first()
Definition definitionForName(const QString &defName) const
Returns the Definition named defName.
Definition: repository.cpp:120
QMap::const_iterator cbegin() const const
QVector< Definition > definitions() const
Returns all available Definitions.
Definition: repository.cpp:145
QCborValue fromCbor(QCborStreamReader &reader)
QMap::const_iterator cend() const const
void addCustomSearchPath(const QString &path)
Add a custom search path to the repository.
Definition: repository.cpp:415
Definition: abstracthighlighter.h:20
void clear()
QVector< QString > customSearchPaths() const
Returns the list of custom search paths added to the repository.
Definition: repository.cpp:421
QVector::iterator end()
QVector< Definition > definitionsForFileName(const QString &fileName) const
Returns all Definitions for the file named fileName sorted by priority.
Definition: repository.cpp:130
GenericDataLocation
Definition definitionForFileName(const QString &fileName) const
Returns the best matching Definition for the file named fileName.
Definition: repository.cpp:125
KCOREADDONS_EXPORT Result match(QStringView pattern, QStringView str)
QStringList locateAll(QStandardPaths::StandardLocation type, const QString &fileName, QStandardPaths::LocateOptions options)
Theme themeForPalette(const QPalette &palette) const
Returns the best matching theme for the given palette.
Definition: repository.cpp:185
QVector< Definition > definitionsForMimeType(const QString &mimeType) const
Returns all Definitions to the type named mimeType sorted by priority.
Definition: repository.cpp:140
bool empty() const const
virtual QVariant get(ScriptableExtension *callerPrincipal, quint64 objId, const QString &propName)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:09:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Mar 26 2023 04:09:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.