KIconLoader Class Reference
Iconloader for KDE. More...
#include <kiconloader.h>
Public Member Functions | |
KIconLoader (const QString &appname=QString::null, KStandardDirs *dirs=0) | |
~KIconLoader () | |
void | addAppDir (const QString &appname) |
QPixmap | loadIcon (const QString &name, KIcon::Group group, int size=0, int state=KIcon::DefaultState, QString *path_store=0L, bool canReturnNull=false) const |
QIconSet | loadIconSet (const QString &name, KIcon::Group group, int size, bool canReturnNull) |
QIconSet | loadIconSet (const QString &name, KIcon::Group group, int size=0) |
QString | iconPath (const QString &name, int group_or_size, bool canReturnNull=false) const |
QMovie | loadMovie (const QString &name, KIcon::Group group, int size=0) const |
QString | moviePath (const QString &name, KIcon::Group group, int size=0) const |
QStringList | loadAnimated (const QString &name, KIcon::Group group, int size=0) const |
QStringList | queryIcons (int group_or_size, KIcon::Context context=KIcon::Any) const |
QStringList | queryIconsByContext (int group_or_size, KIcon::Context context=KIcon::Any) const |
QStringList | queryIconsByDir (const QString &iconsDir) const |
int | currentSize (KIcon::Group group) const |
KIconTheme * | theme () const |
KIconEffect * | iconEffect () const |
void | reconfigure (const QString &_appname, KStandardDirs *_dirs) |
bool | alphaBlending (KIcon::Group group) const |
void | addExtraDesktopThemes () |
bool | extraDesktopThemesAdded () const |
void | enableDelayedIconSetLoading (bool enable) |
bool | isDelayedIconSetLoadingEnabled () const |
Static Public Member Functions | |
QPixmap | unknown () |
Related Functions | |
(Note that these are not member functions.) | |
QPixmap | DesktopIcon (const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance()) |
QPixmap | DesktopIcon (const QString &name, KInstance *instance) |
QIconSet | DesktopIconSet (const QString &name, int size=0, KInstance *instance=KGlobal::instance()) |
QPixmap | BarIcon (const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance()) |
QPixmap | BarIcon (const QString &name, KInstance *instance) |
QIconSet | BarIconSet (const QString &name, int size=0, KInstance *instance=KGlobal::instance()) |
QPixmap | SmallIcon (const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance()) |
QPixmap | SmallIcon (const QString &name, KInstance *instance) |
QIconSet | SmallIconSet (const QString &name, int size=0, KInstance *instance=KGlobal::instance()) |
QPixmap | MainBarIcon (const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance()) |
QPixmap | MainBarIcon (const QString &name, KInstance *instance) |
QIconSet | MainBarIconSet (const QString &name, int size=0, KInstance *instance=KGlobal::instance()) |
QPixmap | UserIcon (const QString &name, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance()) |
QPixmap | UserIcon (const QString &name, KInstance *instance) |
QIconSet | UserIconSet (const QString &name, KInstance *instance=KGlobal::instance()) |
int | IconSize (KIcon::Group group, KInstance *instance=KGlobal::instance()) |
Detailed Description
Iconloader for KDE.KIconLoader will load the current icon theme and all its base themes. Icons will be searched in any of these themes. Additionally, it caches icons and applies effects according the the user's preferences.
In KDE, it is encouraged to load icons by "Group". An icon group is a location on the screen where icons are being used. Standard groups are: Desktop, Toolbar, MainToolbar, Small and Panel. Each group has some centrally configured properties bound to it, including the icon size and effects. This makes it possible to offer a consistent icon look in all KDE applications.
The standard groups are defined below.
- KIcon::Desktop: Icons in the iconview of konqueror, kdesktop and similar apps.
- KIcon::Toolbar: Icons in toolbars.
- KIcon::MainToolbar: Icons in the main toolbars.
- KIcon::Small: Various small (typical 16x16) places: titlebars, listviews and menu entries.
- KIcon::Panel: Icons in kicker's panel
The standalone directories contain just one version of an icon. The directories that are searched are: $appdir/pics and $appdir/toolbar. Icons in these directories can be loaded by using the special group "User".
Definition at line 79 of file kiconloader.h.
Constructor & Destructor Documentation
|
Constructs an iconloader.
Definition at line 141 of file kiconloader.cpp. References KIconLoader(). Referenced by KIconLoader(). |
|
Cleanup.
Definition at line 240 of file kiconloader.cpp. |
Member Function Documentation
|
Adds
Definition at line 259 of file kiconloader.cpp. References addAppDir(). Referenced by addAppDir(). |
|
Loads an icon.
It will try very hard to find an icon which is suitable. If no exact match is found, a close match is searched. If neither an exact nor a close match is found, a null pixmap or the "unknown" pixmap is returned, depending on the value of the
Definition at line 544 of file kiconloader.cpp. References KIcon::context, QPixmap::convertFromImage(), QImage::copy(), QPixmap::createHeuristicMask(), endl(), QPixmap::height(), QImage::height(), iconPath(), QString::isEmpty(), QImage::isNull(), QPixmap::isNull(), KIcon::isValid(), QString::latin1(), KIconTheme::linkOverlay(), loadIcon(), KIconTheme::lockOverlay(), QPixmap::mask(), KIcon::path, QString::right(), QImage::scanLine(), QPixmap::setMask(), KIconTheme::shareOverlay(), QImage::smoothScale(), theme(), KIcon::threshold, KIcon::type, QPixmap::width(), QImage::width(), and KIconTheme::zipOverlay(). Referenced by BarIcon(), DesktopIcon(), KWin::icon(), loadIcon(), loadIconSet(), MainBarIcon(), SmallIcon(), and UserIcon(). |
|
Creates an icon set, that will do on-demand loading of the icon. Loading itself is done by calling loadIcon .
Definition at line 1107 of file kiconloader.cpp. References endl(), QIconSet::installIconFactory(), QPixmap::isNull(), loadIcon(), and loadIconSet(). Referenced by BarIconSet(), DesktopIconSet(), loadIconSet(), MainBarIconSet(), SmallIconSet(), and UserIconSet(). |
|
Creates an icon set, that will do on-demand loading of the icon. Loading itself is done by calling loadIcon .
Definition at line 1085 of file kiconloader.cpp. References loadIconSet(). |
|
Returns the path of an icon.
Definition at line 477 of file kiconloader.cpp. References QString::at(), endl(), iconPath(), QString::isEmpty(), KIcon::isValid(), and KIcon::path. Referenced by iconPath(), loadIcon(), loadMovie(), and unknown(). |
|
Loads an animated icon.
Definition at line 846 of file kiconloader.cpp. References QString::findRev(), iconPath(), QString::isEmpty(), QString::left(), loadMovie(), and moviePath(). Referenced by loadMovie(). |
|
Returns the path to an animated icon.
Definition at line 858 of file kiconloader.cpp. References endl(), KIcon::isValid(), moviePath(), and KIcon::path. Referenced by loadMovie(), and moviePath(). |
|
Loads an animated icon as a series of still frames. If you want to load a .mng animation as QMovie instead, please use loadMovie() instead.
Definition at line 910 of file kiconloader.cpp. References endl(), QString::isEmpty(), KIcon::isValid(), QString::left(), QString::length(), loadAnimated(), KIcon::path, and QStringList::sort(). Referenced by loadAnimated(). |
|
Queries all available icons for a specific group, having a specific context.
Definition at line 1030 of file kiconloader.cpp. References endl(), and queryIcons(). Referenced by queryIcons(). |
|
Queries all available icons for a specific context.
Definition at line 990 of file kiconloader.cpp. References endl(), and queryIconsByContext(). Referenced by queryIconsByContext(). |
|
Returns a list of all icons (*.png or *.xpm extension) in the given directory.
Definition at line 979 of file kiconloader.cpp. References QDir::entryList(), and queryIconsByDir(). Referenced by queryIconsByDir(). |
|
Returns the current size of the group.
Definition at line 967 of file kiconloader.cpp. References currentSize(), and endl(). Referenced by currentSize(), and IconSize(). |
|
Returns a pointer to the current theme. Can be used to query available and default sizes for groups.
Definition at line 961 of file kiconloader.cpp. Referenced by loadIcon(). |
|
Returns a pointer to the KIconEffect object used by the icon loader.
Definition at line 1068 of file kiconloader.cpp. |
|
Called by KInstance::newIconLoader to reconfigure the icon loader.
Definition at line 146 of file kiconloader.cpp. References reconfigure(). Referenced by KInstance::newIconLoader(), and reconfigure(). |
|
Returns the unknown icon. An icon that is used when no other icon can be found.
Definition at line 1276 of file kiconloader.cpp. References endl(), KGlobal::iconLoader(), iconPath(), QString::isEmpty(), QPixmap::load(), and QPixmap::resize(). |
|
Checks whether the user wants to blend the icons with the background using the alpha channel information for a given group.
Definition at line 1073 of file kiconloader.cpp. References alphaBlending(), and endl(). Referenced by alphaBlending(). |
|
Adds all the default themes from other desktops at the end of the list of icon themes.
Definition at line 311 of file kiconloader.cpp. References QDir::dirName(), KGlobal::dirs(), QDir::entryList(), QDir::exists(), and KStandardDirs::resourceDirs(). |
|
Returns if the default icon themes of other desktops have been added to the list of icon themes where icons are searched.
Definition at line 362 of file kiconloader.cpp. |
|
Enables on-demand icon loading for QIconSets using QIconFactory. Icons loaded via loadIconSet() will be loaded as soon as they need to be displayed, not earlier. Note that enabling or disabling this only affects loadIconSet() calls after this setting is changed. The default is disabled, as the iconloader object must not be destroyed before all those iconsets are destroyed. (Some broken applications use temporary KIconLoader objects). Every KInstance 's iconloader has this feature enabled.
Definition at line 249 of file kiconloader.cpp. References enableDelayedIconSetLoading(). Referenced by enableDelayedIconSetLoading(). |
|
Checks whether delayed loading for QIconSet is enabled.
Definition at line 254 of file kiconloader.cpp. |
Friends And Related Function Documentation
|
Load a desktop icon.
Definition at line 1181 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIcon(). |
|
Load a desktop icon.
Definition at line 1188 of file kiconloader.cpp. |
|
Load a desktop icon, and apply the necessary effects to get an IconSet.
Definition at line 1193 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIconSet(). |
|
Load a toolbar icon.
Definition at line 1199 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIcon(). |
|
Load a toolbar icon.
Definition at line 1206 of file kiconloader.cpp. |
|
Load a toolbar icon, and apply the necessary effects to get an IconSet.
Definition at line 1211 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIconSet(). |
|
Load a small icon.
Definition at line 1217 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIcon(). |
|
Load a small icon.
Definition at line 1224 of file kiconloader.cpp. |
|
Load a small icon, and apply the necessary effects to get an IconSet.
Definition at line 1229 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIconSet(). |
|
Load a main toolbar icon.
Definition at line 1235 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIcon(). |
|
Load a main toolbar icon.
Definition at line 1242 of file kiconloader.cpp. |
|
Load a main toolbar icon, and apply the effects to get an IconSet.
Definition at line 1247 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIconSet(). |
|
Load a user icon.
Definition at line 1253 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIcon(). |
|
Load a user icon.
Definition at line 1259 of file kiconloader.cpp. |
|
Load a user icon, and apply the effects to get an IconSet.
Definition at line 1264 of file kiconloader.cpp. References KInstance::iconLoader(), and loadIconSet(). |
|
Returns the current icon size for a specific group.
Definition at line 1270 of file kiconloader.cpp. References currentSize(), and KInstance::iconLoader(). |
The documentation for this class was generated from the following files: