GrantleeTheme

grantleethememanager.h
1/*
2 SPDX-FileCopyrightText: 2013-2024 Laurent Montel <montel@kde.org>
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
16class QActionGroup;
18class KToggleAction;
19class KActionMenu;
20
21namespace GrantleeTheme
22{
23class ThemeManagerPrivate;
24
25/**
26 * @brief The ThemeManager class
27 * @author Laurent montel <montel@kde.org>
28 */
29class GRANTLEETHEME_EXPORT ThemeManager : public QObject
30{
31 Q_OBJECT
32public:
33 explicit ThemeManager(const QString &themeType,
34 const QString &defaultDesktopFileName,
35 KActionCollection *actionCollection = nullptr,
36 const QString &path = QString(),
37 const QString &configFileName = QString(),
38 QObject *parent = nullptr);
39 ~ThemeManager() override;
40
41 [[nodiscard]] QMap<QString, GrantleeTheme::Theme> themes() const;
42
43 void setActionGroup(QActionGroup *actionGroup);
44
45 [[nodiscard]] KToggleAction *actionForTheme();
46
47 void setThemeMenu(KActionMenu *menu);
48
49 [[nodiscard]] QStringList displayExtraVariables(const QString &themename) const;
50
51 [[nodiscard]] GrantleeTheme::Theme theme(const QString &themeName);
52
53 [[nodiscard]] QString configuredThemeName() const;
54 [[nodiscard]] static QString configuredThemeName(const QString &themeType);
55
56 [[nodiscard]] static QString pathFromThemes(const QString &path, const QString &themeName, const QString &defaultDesktopFilename);
57 [[nodiscard]] static GrantleeTheme::Theme loadTheme(const QString &themePath, const QString &dirName, const QString &defaultDesktopFilename);
58
59Q_SIGNALS:
60 void themesChanged();
61 void grantleeThemeSelected();
62 void updateThemes();
63
64private:
65 friend class ThemeManagerPrivate;
66 std::unique_ptr<ThemeManagerPrivate> const d;
67 Q_PRIVATE_SLOT(d, void directoryChanged())
68};
69}
The Theme class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:12:59 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.