GrantleeTheme

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

KDE's Doxygen guidelines are available online.