KIconThemes 5.109.0
kicontheme.h
1/* vi: ts=8 sts=4 sw=4
2
3 This file is part of the KDE project, module kdecore.
4 SPDX-FileCopyrightText: 2000 Geert Jansen <jansen@kde.org>
5 SPDX-FileCopyrightText: 2000 Antonio Larrosa <larrosa@kde.org>
6
7 SPDX-License-Identifier: LGPL-2.0-only
8*/
9
10#ifndef KICONTHEME_H
11#define KICONTHEME_H
12
13#include <kiconthemes_export.h>
14
15#include <QList>
16#include <QString>
17#include <QStringList>
18
19#include <memory>
20
21#include "kiconloader.h"
22
23class QAction;
24
33class KICONTHEMES_EXPORT KIconTheme
34{
35public:
44 explicit KIconTheme(const QString &name, const QString &appName = QString(), const QString &basePathHint = QString());
45 ~KIconTheme();
46
47 KIconTheme(const KIconTheme &) = delete;
48 KIconTheme &operator=(const KIconTheme &) = delete;
49
54 QString name() const;
55
61 QString internalName() const;
62
68 QString description() const;
69
75 QString example() const;
76
81 QString screenshot() const;
82
87 QString dir() const;
88
93 QStringList inherits() const;
94
99 bool isValid() const;
100
105 bool isHidden() const;
106
112 int depth() const;
113
119 int defaultSize(KIconLoader::Group group) const;
120
126 QList<int> querySizes(KIconLoader::Group group) const;
127
134 QStringList queryIcons(int size, KIconLoader::Context context = KIconLoader::Any) const;
135
142 QStringList queryIconsByContext(int size, KIconLoader::Context context = KIconLoader::Any) const;
143
154 QString iconPath(const QString &name, int size, KIconLoader::MatchType match) const;
155
168 // TODO KF6 merge iconPath() with and without "scale" and move that argument after "size"
169 QString iconPath(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const;
170
183 QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match) const;
184
198 // TODO KF6 merge iconPathByName() with and without "scale" and move that argument after "size"
199 QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const;
200
204 bool hasContext(KIconLoader::Context context) const;
205
213 bool followsColorScheme() const;
214
219 static QStringList list();
220
225 static QString current();
226
245 static void forceThemeForTests(const QString &themeName);
246
250 static void reconfigure();
251
256 static QString defaultThemeName();
257
258#if KICONTHEMES_ENABLE_DEPRECATED_SINCE(5, 64)
270 enum ContextMenus {
271 TextEditor,
272 ReadOnlyText,
273 }; // TODO KF6 remove
274
280 KICONTHEMES_DEPRECATED_VERSION(5, 64, "No longer necessary")
281 static void assignIconsToContextMenu(ContextMenus type, QList<QAction *> actions); // TODO KF6 remove
282#endif
283
284private:
285 std::unique_ptr<class KIconThemePrivate> const d;
286};
287
288#endif
Group
The group of the icon.
Definition kiconloader.h:125
Context
Defines the context of the icon.
Definition kiconloader.h:81
@ Any
Some icon with unknown purpose.
Definition kiconloader.h:82
MatchType
The type of a match.
Definition kiconloader.h:116