KIconLoader Class Reference
Iconloader for KDE. More...
#include <kiconloader.h>
Public Member Functions | |
KIconLoader (const QString &appname=QString::null, KStandardDirs *dirs=0) | |
Constructs an iconloader. | |
~KIconLoader () | |
Cleanup. | |
void | addAppDir (const QString &appname) |
Adds appname to the list of application specific directories. | |
QPixmap | loadIcon (const QString &name, KIcon::Group group, int size=0, int state=KIcon::DefaultState, QString *path_store=0L, bool canReturnNull=false) const |
Loads an icon. | |
QIconSet | loadIconSet (const QString &name, KIcon::Group group, int size, bool canReturnNull) |
Creates an icon set, that will do on-demand loading of the icon. | |
QIconSet | loadIconSet (const QString &name, KIcon::Group group, int size=0) |
Creates an icon set, that will do on-demand loading of the icon. | |
QString | iconPath (const QString &name, int group_or_size, bool canReturnNull=false) const |
Returns the path of an icon. | |
QMovie | loadMovie (const QString &name, KIcon::Group group, int size=0) const |
Loads an animated icon. | |
QString | moviePath (const QString &name, KIcon::Group group, int size=0) const |
Returns the path to an animated icon. | |
QStringList | loadAnimated (const QString &name, KIcon::Group group, int size=0) const |
Loads an animated icon. | |
QStringList | queryIcons (int group_or_size, KIcon::Context context=KIcon::Any) const |
Queries all available icons for a specific group, having a specific context. | |
QStringList | queryIconsByContext (int group_or_size, KIcon::Context context=KIcon::Any) const |
Queries all available icons for a specific context. | |
QStringList | queryIconsByDir (const QString &iconsDir) const |
Returns a list of all icons (*.png or *.xpm extension) in the given directory. | |
int | currentSize (KIcon::Group group) const |
Returns the current size of the group. | |
KIconTheme * | theme () const |
Returns a pointer to the current theme. | |
KIconEffect * | iconEffect () const |
Returns a pointer to the KIconEffect object used by the icon loader. | |
void | reconfigure (const QString &_appname, KStandardDirs *_dirs) |
Called by KInstance::newIconLoader to reconfigure the icon loader. | |
bool | alphaBlending (KIcon::Group group) const |
Returns if the user wants to use blend the icons with the background using the alpha channel information for a given group. | |
void | addExtraDesktopThemes () |
Adds all the default themes from other desktops at the end of the list of icon themes. | |
bool | extraDesktopThemesAdded () const |
Returns if the default icon themes of other desktops have been added to the list of icon themes where icons are searched. | |
void | enableDelayedIconSetLoading (bool enable) |
Enables on-demand icon loading for QIconSets using QIconFactory. | |
bool | isDelayedIconSetLoadingEnabled () const |
Static Public Member Functions | |
QPixmap | unknown () |
Returns the unknown icon. |
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 140 of file kiconloader.cpp. |
|
Cleanup.
Definition at line 239 of file kiconloader.cpp. |
Member Function Documentation
|
Adds
Definition at line 258 of file kiconloader.cpp. References KStandardDirs::kde_default(). |
|
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 558 of file kiconloader.cpp. References KIcon::Any, KIcon::context, QPixmap::convertFromImage(), QPixmap::convertToImage(), QImage::copy(), QPixmap::createHeuristicMask(), KIcon::DefaultState, QPixmapCache::find(), KIcon::Fixed, QString::fromLatin1(), QImage::height(), QPixmap::height(), KIcon::HiddenOverlay, iconPath(), QPixmapCache::insert(), QString::isEmpty(), QImage::isNull(), QPixmap::isNull(), KIcon::isValid(), KStdAccel::key(), KIcon::LastState, QString::latin1(), KIconTheme::linkOverlay(), KIcon::LinkOverlay, QPixmap::load(), KIconTheme::lockOverlay(), KIcon::LockOverlay, QPixmap::mask(), KStdAction::name(), QString::number(), KIconEffect::overlay(), KIcon::path, QString::right(), KIcon::Scalable, QImage::scanLine(), QPixmap::setMask(), KIconTheme::shareOverlay(), KIcon::ShareOverlay, QImage::smoothScale(), KGlobal::staticQString(), theme(), KIcon::Threshold, KIcon::threshold, KIcon::type, QImage::width(), QPixmap::width(), KIconTheme::zipOverlay(), and KIcon::ZipOverlay. Referenced by KWin::icon(), and loadIconSet(). |
|
Creates an icon set, that will do on-demand loading of the icon. Loading itself is done by calling loadIcon .
Definition at line 1112 of file kiconloader.cpp. References KIcon::DefaultState, QIconSet::installIconFactory(), QPixmap::isNull(), loadIcon(), and KStdAction::name(). Referenced by loadIconSet(). |
|
Creates an icon set, that will do on-demand loading of the icon. Loading itself is done by calling loadIcon .
Definition at line 1090 of file kiconloader.cpp. References loadIconSet(), and KStdAction::name(). |
|
Returns the path of an icon.
Definition at line 491 of file kiconloader.cpp. References QString::at(), QString::isEmpty(), KIcon::isValid(), KStdAction::name(), KIcon::path, and KGlobal::staticQString(). Referenced by loadIcon(), loadMovie(), and unknown(). |
|
Loads an animated icon.
Definition at line 865 of file kiconloader.cpp. References QString::findRev(), iconPath(), QString::isEmpty(), QString::left(), moviePath(), and KStdAction::name(). |
|
Returns the path to an animated icon.
Definition at line 877 of file kiconloader.cpp. References KIcon::isValid(), KIcon::MatchBest, KIcon::MatchExact, KStdAction::name(), and KIcon::path. Referenced by loadMovie(). |
|
Loads an animated icon. In the future, this will be replaced by a routine which loads an MNG animation and returns a QMovie.
Definition at line 915 of file kiconloader.cpp. References QFile::decodeName(), QFile::encodeName(), QString::isEmpty(), KIcon::isValid(), QString::left(), QString::length(), KStdAction::name(), KIcon::path, and QStringList::sort(). |
|
Queries all available icons for a specific group, having a specific context.
Definition at line 1035 of file kiconloader.cpp. References KStdAction::name(). |
|
Queries all available icons for a specific context.
Definition at line 995 of file kiconloader.cpp. References KStdAction::name(). |
|
Returns a list of all icons (*.png or *.xpm extension) in the given directory.
Definition at line 984 of file kiconloader.cpp. References QDir::entryList(). |
|
Returns the current size of the group.
Definition at line 972 of file kiconloader.cpp. |
|
Returns a pointer to the current theme. Can be used to query available and default sizes for groups.
Definition at line 966 of file kiconloader.cpp. Referenced by loadIcon(). |
|
Returns a pointer to the KIconEffect object used by the icon loader.
Definition at line 1073 of file kiconloader.cpp. |
|
Called by KInstance::newIconLoader to reconfigure the icon loader.
Definition at line 145 of file kiconloader.cpp. Referenced by KInstance::newIconLoader(). |
|
Returns the unknown icon. An icon that is used when no other icon can be found.
Definition at line 1275 of file kiconloader.cpp. References QPixmapCache::find(), KGlobal::iconLoader(), iconPath(), QPixmapCache::insert(), QString::isEmpty(), QPixmap::load(), and QPixmap::resize(). |
|
Returns if the user wants to use blend the icons with the background using the alpha channel information for a given group.
Definition at line 1078 of file kiconloader.cpp. |
|
Adds all the default themes from other desktops at the end of the list of icon themes.
Definition at line 310 of file kiconloader.cpp. References QDir::dirName(), KGlobal::dirs(), QFile::encodeName(), QDir::entryList(), KStandardDirs::exists(), 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 361 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 248 of file kiconloader.cpp. Referenced by KInstance::iconLoader(). |
|
Definition at line 253 of file kiconloader.cpp. |
The documentation for this class was generated from the following files: