kiconloader.h
/* vi: ts=8 sts=4 sw=4
*
* This file is part of the KDE project, module kdecore.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
* Antonio Larrosa <larrosa@kde.org>
*
* This is free software; it comes under the GNU Library General
* Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms.
*/
#ifndef __KIconLoader_h_Included__
#define __KIconLoader_h_Included__
#include <qstring.h>
#include <qpixmap.h>
#include <qiconset.h>
// Grmbl, X headers.....
#ifdef Status
#define KIconLoaderXStatus Status
#undef Status
#endif
#include <qmovie.h>
#ifdef KIconLoaderXStatus
#define Status int
#undef KIconLoaderXStatus
#endif
#include <kglobal.h>
#include <kinstance.h>
#include <kicontheme.h>
struct KIconGroup;
class KIconThemeNode;
class KConfig;
struct KIconLoaderPrivate;
class KStandardDirs;
class KIconEffect;
class KDECORE_EXPORT KIconLoader
{
public:
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, bool immediateExistenceCheck);
// KDE4 merge as (const QString&,KIcon::Group,int=0,bool=false,bool=true);
QIconSet loadIconSet(const QString& name, KIcon::Group group, int size,
bool canReturnNull);
// KDE4 merge as (const QString&,KIcon::Group,int=0,bool=false,bool=true);
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;
bool hasContext( KIcon::Context context ) 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 );
static QPixmap unknown();
bool alphaBlending( KIcon::Group group ) const;
void addExtraDesktopThemes();
bool extraDesktopThemesAdded() const;
void enableDelayedIconSetLoading( bool enable );
bool isDelayedIconSetLoadingEnabled() const;
private:
void init( const QString& _appname, KStandardDirs *_dirs );
KIcon findMatchingIcon(const QString& name, int size) const;
QImage *loadOverlay(const QString& name, int size) const;
void addAppThemes(const QString& appname);
void addBaseThemes(KIconThemeNode *node, const QString &appname);
QString unknownIconPath( int size ) const;
QString removeIconExtension(const QString &name) const;
QString removeIconExtensionInternal(const QString &name) const;
QIconSet loadIconSetNonDelayed( const QString& name, KIcon::Group group,
int size, bool canReturnNull );
// @internal the data object
KIconLoaderPrivate *d;
};
KDECORE_EXPORT QPixmap DesktopIcon(const QString& name, int size=0,
int state=KIcon::DefaultState,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap DesktopIcon(const QString& name, KInstance *instance);
KDECORE_EXPORT QIconSet DesktopIconSet(const QString& name, int size=0,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap BarIcon(const QString& name, int size=0, int state=KIcon::DefaultState,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap BarIcon(const QString& name, KInstance *instance);
KDECORE_EXPORT QIconSet BarIconSet(const QString& name, int size=0,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap SmallIcon(const QString& name, int size=0,
int state=KIcon::DefaultState,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap SmallIcon(const QString& name, KInstance *instance);
KDECORE_EXPORT QIconSet SmallIconSet(const QString& name, int size=0,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap MainBarIcon(const QString& name, int size=0,
int state=KIcon::DefaultState,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap MainBarIcon(const QString& name, KInstance *instance);
KDECORE_EXPORT QIconSet MainBarIconSet(const QString& name, int size=0,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap UserIcon(const QString& name, int state=KIcon::DefaultState,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT QPixmap UserIcon(const QString& name, KInstance *instance);
KDECORE_EXPORT QIconSet UserIconSet(const QString& name,
KInstance *instance=KGlobal::instance());
KDECORE_EXPORT int IconSize(KIcon::Group group, KInstance *instance=KGlobal::instance());
#endif // __KIconLoader_h_Included__
KIconLoader::MainBarIconSet
QIconSet MainBarIconSet(const QString &name, int size=0, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1354
KIcon::Any
Some icon with unknown purpose.
Definition: kicontheme.h:49
KIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:87
KIconLoader::BarIconSet
QIconSet BarIconSet(const QString &name, int size=0, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1318
KIconLoader::BarIcon
QPixmap BarIcon(const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1306
KStandardDirs
Site-independent access to standard KDE directories.
Definition: kstandarddirs.h:125
KIcon
One icon as found by KIconTheme.
Definition: kicontheme.h:35
KInstance
Access to KDE global objects for use in shared libraries.
Definition: kinstance.h:43
KIconLoader::DesktopIcon
QPixmap DesktopIcon(const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1288
KIconLoader::IconSize
int IconSize(KIcon::Group group, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1377
KIconLoader::UserIcon
QPixmap UserIcon(const QString &name, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1360
KGlobal::instance
static KInstance * instance()
Returns the global instance.
Definition: kglobal.cpp:82
KIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:48
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KIconLoader::DesktopIconSet
QIconSet DesktopIconSet(const QString &name, int size=0, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1300
KIconLoader::UserIconSet
QIconSet UserIconSet(const QString &name, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1371
KIconLoader::SmallIconSet
QIconSet SmallIconSet(const QString &name, int size=0, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1336
KIconLoader::SmallIcon
QPixmap SmallIcon(const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1324
KIconEffect
Applies effects to icons.
Definition: kiconeffect.h:34
KIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:186
KIcon::DefaultState
The default state.
Definition: kicontheme.h:129
KIconLoader
Iconloader for KDE.
Definition: kiconloader.h:77
KIconLoader::MainBarIcon
QPixmap MainBarIcon(const QString &name, int size=0, int state=KIcon::DefaultState, KInstance *instance=KGlobal::instance())
Definition: kiconloader.cpp:1342

KDE Home | KDE Accessibility Home | Description of Access Keys