GrantleeTheme

grantleethememanager.h
1 /*
2  Copyright (c) 2013-2020 Laurent Montel <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef GRANTLEETHEMEMANAGER_H
20 #define GRANTLEETHEMEMANAGER_H
21 
22 #include "grantleetheme.h"
23 #include "grantleetheme_export.h"
24 #include <QObject>
25 #include <QMap>
26 class QActionGroup;
27 class KActionCollection;
28 class KToggleAction;
29 class KActionMenu;
30 
31 namespace GrantleeTheme {
36 class GRANTLEETHEME_EXPORT ThemeManager : public QObject
37 {
38  Q_OBJECT
39 public:
40  explicit ThemeManager(const QString &themeType, const QString &defaultDesktopFileName, KActionCollection *actionCollection = nullptr, const QString &path = QString(), QObject *parent = nullptr);
41  ~ThemeManager();
42 
43  Q_REQUIRED_RESULT QMap<QString, GrantleeTheme::Theme> themes() const;
44 
45  void setActionGroup(QActionGroup *actionGroup);
46 
47  Q_REQUIRED_RESULT KToggleAction *actionForTheme();
48 
49  void setThemeMenu(KActionMenu *menu);
50 
51  Q_REQUIRED_RESULT QStringList displayExtraVariables(const QString &themename) const;
52 
53  Q_REQUIRED_RESULT GrantleeTheme::Theme theme(const QString &themeName);
54 
55  void setDownloadNewStuffConfigFile(const QString &configFileName);
56 
57  Q_REQUIRED_RESULT QString configuredThemeName() const;
58  Q_REQUIRED_RESULT static QString configuredThemeName(const QString &themeType);
59 
60  Q_REQUIRED_RESULT static QString pathFromThemes(const QString &path, const QString &themeName, const QString &defaultDesktopFilename);
61  Q_REQUIRED_RESULT static GrantleeTheme::Theme loadTheme(const QString &themePath, const QString &dirName, const QString &defaultDesktopFilename);
62 
63 Q_SIGNALS:
64  void themesChanged();
65  void grantleeThemeSelected();
66  void updateThemes();
67 
68 private:
69  class Private;
70  Private *const d;
71  Q_PRIVATE_SLOT(d, void directoryChanged())
72 };
73 }
74 #endif // GRANTLEETHEMEMANAGER_H
The ThemeManager class.
The Theme class.
Definition: grantleetheme.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jun 6 2020 23:12:00 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.