LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IIconThemeManager Class Referenceabstract

Interface for accessing LeechCraft-wide icons manager. More...

#include "iiconthememanager.h"

Public Member Functions

virtual QIcon GetIcon (const QString &on, const QString &off=QString())=0
 Returns the current theme's icon for the given on and off states. More...
 
virtual void UpdateIconset (const QList< QAction * > &actions)=0
 Updates the icons of the given actions. More...
 
virtual void ManageWidget (QWidget *widget)=0
 Watches the given widget recursively and its child actions. More...
 
virtual void RegisterChangeHandler (const std::function< void()> &function)=0
 Registers the theme change handler. More...
 
virtual QIcon GetPluginIcon ()=0
 
virtual QIcon GetPluginIcon (const QString &name)=0
 

Protected Member Functions

virtual ~IIconThemeManager ()
 

Detailed Description

Interface for accessing LeechCraft-wide icons manager.

The icon theme manager provides access to actions icon sets managed globally in LeechCraft.

The icons are identified by their Freedesktop.org-like name, and they should be contained at least in the KDE's Oxygen icon theme.

Icons may be retrieved via the GetIcon() method, and actions (QAction subclasses) can be automatically set with a proper icon by setting their ActionIcon dynamic property to the name of the desired icon. This way they will also be automatically updated if the iconset changes.

Please note that the ActionIcon property should be set before QAction (or its parent) widget is exposed to the rest oF LeechCraft (for example, a menu embedded into a ITabWidget-implementing tab, or an ITabWidget added to LeechCrat windows). Otherwise, UpdateIconset() should be called on the actions for them to be registered.

Definition at line 38 of file iiconthememanager.h.

Constructor & Destructor Documentation

◆ ~IIconThemeManager()

virtual IIconThemeManager::~IIconThemeManager ( )
inlineprotectedvirtual

Definition at line 41 of file iiconthememanager.h.

Member Function Documentation

◆ GetIcon()

virtual QIcon IIconThemeManager::GetIcon ( const QString &  on,
const QString &  off = QString() 
)
pure virtual

Returns the current theme's icon for the given on and off states.

The name should match the Freedesktop.org's icons naming scheme and be contained at least in the KDE's Oxygen iconset.

Parameters
[in]onThe name of the icon in the "on" state.
[in]offThe name of the icon in the "off" state, if any.
Returns
The QIcon object created from image files which could be obtained via GetIconPath().
See also
GetIconPath

◆ GetPluginIcon() [1/2]

virtual QIcon IIconThemeManager::GetPluginIcon ( )
pure virtual

◆ GetPluginIcon() [2/2]

virtual QIcon IIconThemeManager::GetPluginIcon ( const QString &  name)
pure virtual

◆ ManageWidget()

virtual void IIconThemeManager::ManageWidget ( QWidget *  widget)
pure virtual

Watches the given widget recursively and its child actions.

This function merely installs the event filter on the given widget to watch for new actions or action changes.

Parameters
[in]widgetThe widget to manage.

◆ RegisterChangeHandler()

virtual void IIconThemeManager::RegisterChangeHandler ( const std::function< void()> &  function)
pure virtual

Registers the theme change handler.

The given function will be invoked after each icon theme change.

Parameters
[in]functionThe function to invoke after theme change.

◆ UpdateIconset()

virtual void IIconThemeManager::UpdateIconset ( const QList< QAction * > &  actions)
pure virtual

Updates the icons of the given actions.

This function sets or updates the icons of actions according to the current iconset. This function also registers the actions so that they are automatically updated when the iconset changes, analogously to ManageWidget().

Parameters
[in]actionsThe list of actions to update.
See also
ManageWidget()

The documentation for this class was generated from the following file: