GrantleeTheme::ThemeManager Class

The ThemeManager class. Author: Laurent montel <montel@kde.org>. More...

Header: #include <GrantleeTheme/ThemeManager>
CMake: find_package(KPim6 REQUIRED COMPONENTS GrantleeTheme)
target_link_libraries(mytarget PRIVATE KPim6::GrantleeTheme)

Public Functions

ThemeManager(const QString &themeType, const QString &defaultDesktopFileName, KActionCollection *actionCollection = nullptr, const QString &path = QString(), const QString &configFileName = QString(), QObject *parent = nullptr)
virtual ~ThemeManager() override
KToggleAction *actionForTheme()
QString configuredThemeName() const
QStringList displayExtraVariables(const QString &themename) const
void setActionGroup(QActionGroup *actionGroup)
void setThemeMenu(KActionMenu *menu)
GrantleeTheme::Theme theme(const QString &themeName)
QMap<QString, GrantleeTheme::Theme> themes() const

Signals

Static Public Members

QString configuredThemeName(const QString &themeType)
GrantleeTheme::Theme loadTheme(const QString &themePath, const QString &dirName, const QString &defaultDesktopFilename)
QString pathFromThemes(const QString &path, const QString &themeName, const QString &defaultDesktopFilename)

Detailed Description

Member Function Documentation

[explicit] ThemeManager::ThemeManager(const QString &themeType, const QString &defaultDesktopFileName, KActionCollection *actionCollection = nullptr, const QString &path = QString(), const QString &configFileName = QString(), QObject *parent = nullptr)

Constructs a ThemeManager for the specified theme type. themeType The type of theme to manage defaultDesktopFileName The default desktop filename for the theme actionCollection Optional KActionCollection for managing theme actions path Optional custom path to theme directories configFileName Optional custom configuration file name parent Optional parent QObject

[override virtual noexcept] ThemeManager::~ThemeManager()

Destroys the ThemeManager.

KToggleAction *ThemeManager::actionForTheme()

Returns the action for the current theme selection. Returns A KToggleAction for selecting themes

QString ThemeManager::configuredThemeName() const

Returns the name of the currently configured theme. Returns The configured theme name

[static] QString ThemeManager::configuredThemeName(const QString &themeType)

Returns the name of the currently configured theme for the specified type. themeType The theme type Returns The configured theme name for the given type

QStringList ThemeManager::displayExtraVariables(const QString &themename) const

Displays extra variables for the specified theme. themename The name of the theme Returns A list of extra variable names for the theme

[signal] void ThemeManager::grantleeThemeSelected()

Emitted when a theme is selected by the user.

[static] GrantleeTheme::Theme ThemeManager::loadTheme(const QString &themePath, const QString &dirName, const QString &defaultDesktopFilename)

Loads a theme from the specified path. themePath The path to the theme directory dirName The directory name within the theme defaultDesktopFilename The default desktop filename to load Returns The loaded Theme object

[static] QString ThemeManager::pathFromThemes(const QString &path, const QString &themeName, const QString &defaultDesktopFilename)

Finds the path to a theme resource. path The base path to search themeName The name of the theme defaultDesktopFilename The default desktop filename to look for Returns The full path to the theme resource

void ThemeManager::setActionGroup(QActionGroup *actionGroup)

Sets the action group for theme selection actions. actionGroup The action group to use

void ThemeManager::setThemeMenu(KActionMenu *menu)

Sets the menu for theme selection actions. menu The action menu to use for theme selection

GrantleeTheme::Theme ThemeManager::theme(const QString &themeName)

Returns the theme object with the specified name. themeName The name of the theme Returns The Theme object

QMap<QString, GrantleeTheme::Theme> ThemeManager::themes() const

Returns a map of all available themes. Returns A QMap mapping theme names to Theme objects

[signal] void ThemeManager::themesChanged()

Emitted when the list of available themes has changed.

[signal] void ThemeManager::updateThemes()

Emitted when themes should be updated.