KIconThemes

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 <[email protected]>
5  SPDX-FileCopyrightText: 2000 Antonio Larrosa <[email protected]>
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 <QString>
16 #include <QStringList>
17 #include <QList>
18 
19 #include "kiconloader.h"
20 
21 class QAction;
22 
31 class KICONTHEMES_EXPORT KIconTheme
32 {
33 public:
42  explicit KIconTheme(const QString &name, const QString &appName = QString(), const QString &basePathHint = QString());
43  ~KIconTheme();
44 
45  KIconTheme(const KIconTheme &) = delete;
46  KIconTheme &operator=(const KIconTheme &) = delete;
47 
52  QString name() const;
53 
59  QString internalName() const;
60 
66  QString description() const;
67 
73  QString example() const;
74 
79  QString screenshot() const;
80 
85  QString dir() const;
86 
91  QStringList inherits() const;
92 
97  bool isValid() const;
98 
103  bool isHidden() const;
104 
110  int depth() const;
111 
117  int defaultSize(KIconLoader::Group group) const;
118 
124  QList<int> querySizes(KIconLoader::Group group) const;
125 
132  QStringList queryIcons(int size, KIconLoader::Context context = KIconLoader::Any) const;
133 
140  QStringList queryIconsByContext(int size, KIconLoader::Context context = KIconLoader::Any) const;
141 
152  QString iconPath(const QString &name, int size, KIconLoader::MatchType match) const;
153 
166  // TODO KF6 merge iconPath() with and without "scale" and move that argument after "size"
167  QString iconPath(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const;
168 
181  QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match) const;
182 
196  // TODO KF6 merge iconPathByName() with and without "scale" and move that argument after "size"
197  QString iconPathByName(const QString &name, int size, KIconLoader::MatchType match, qreal scale) const;
198 
202  bool hasContext(KIconLoader::Context context) const;
203 
211  bool followsColorScheme() const;
212 
217  static QStringList list();
218 
223  static QString current();
224 
243  static void forceThemeForTests(const QString &themeName);
244 
248  static void reconfigure();
249 
254  static QString defaultThemeName();
255 
256 #if KICONTHEMES_ENABLE_DEPRECATED_SINCE(5, 64)
257 
268  enum ContextMenus { TextEditor,
269  ReadOnlyText
270  }; // TODO KF6 remove
271 
277  KICONTHEMES_DEPRECATED_VERSION(5, 64, "No longer necessary")
278  static void assignIconsToContextMenu(ContextMenus type, QList<QAction *> actions); // TODO KF6 remove
279 #endif
280 
281 private:
282  class KIconThemePrivate;
283  KIconThemePrivate *const d;
284 };
285 
286 #endif
ContextMenus
Defines the context menus that assignIconsToContextMenus is aware of.
Definition: kicontheme.h:268
Some icon with unknown purpose.
Definition: kiconloader.h:75
MatchType
The type of a match.
Definition: kiconloader.h:108
Context
Defines the context of the icon.
Definition: kiconloader.h:74
Group
The group of the icon.
Definition: kiconloader.h:117
QCA_EXPORT QString appName()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 14 2020 22:41:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.