GrantleeTheme

grantleethememanager.h
1 /*
2  SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-or-later
5 */
6 
7 #ifndef GRANTLEETHEMEMANAGER_H
8 #define GRANTLEETHEMEMANAGER_H
9 
10 #include "grantleetheme.h"
11 #include "grantleetheme_export.h"
12 #include <QObject>
13 #include <QMap>
14 class QActionGroup;
15 class KActionCollection;
16 class KToggleAction;
17 class KActionMenu;
18 
19 namespace GrantleeTheme {
24 class GRANTLEETHEME_EXPORT ThemeManager : public QObject
25 {
26  Q_OBJECT
27 public:
28  explicit ThemeManager(const QString &themeType, const QString &defaultDesktopFileName, KActionCollection *actionCollection = nullptr, const QString &path = QString(), QObject *parent = nullptr);
29  ~ThemeManager();
30 
31  Q_REQUIRED_RESULT QMap<QString, GrantleeTheme::Theme> themes() const;
32 
33  void setActionGroup(QActionGroup *actionGroup);
34 
35  Q_REQUIRED_RESULT KToggleAction *actionForTheme();
36 
37  void setThemeMenu(KActionMenu *menu);
38 
39  Q_REQUIRED_RESULT QStringList displayExtraVariables(const QString &themename) const;
40 
41  Q_REQUIRED_RESULT GrantleeTheme::Theme theme(const QString &themeName);
42 
43  void setDownloadNewStuffConfigFile(const QString &configFileName);
44 
45  Q_REQUIRED_RESULT QString configuredThemeName() const;
46  Q_REQUIRED_RESULT static QString configuredThemeName(const QString &themeType);
47 
48  Q_REQUIRED_RESULT static QString pathFromThemes(const QString &path, const QString &themeName, const QString &defaultDesktopFilename);
49  Q_REQUIRED_RESULT static GrantleeTheme::Theme loadTheme(const QString &themePath, const QString &dirName, const QString &defaultDesktopFilename);
50 
51 Q_SIGNALS:
52  void themesChanged();
53  void grantleeThemeSelected();
54  void updateThemes();
55 
56 private:
57  class Private;
58  Private *const d;
59  Q_PRIVATE_SLOT(d, void directoryChanged())
60 };
61 }
62 #endif // GRANTLEETHEMEMANAGER_H
The ThemeManager class.
The Theme class.
Definition: grantleetheme.h:24
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Jan 23 2021 07:18:48 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.