# kdecore Library API Documentation

Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# kiconloader.h

    00001 /* vi: ts=8 sts=4 sw=4
    00002  *
    00003  * This file is part of the KDE project, module kdecore.
    00004  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
    00005  *                    Antonio Larrosa <larrosa@kde.org>
    00006  *
    00007  * This is free software; it comes under the GNU Library General
    00008  * Public License, version 2. See the file "COPYING.LIB" for the
    00009  * exact licensing terms.
    00010  */
    00011
    00012 #ifndef __KIconLoader_h_Included__
    00013 #define __KIconLoader_h_Included__
    00014
    00015 #include <qstring.h>
    00016 #include <qpixmap.h>
    00017 #include <qiconset.h>
    00018
    00019 // Grmbl, X headers.....
    00020 #ifdef Status
    00021 #define KIconLoaderXStatus Status
    00022 #undef Status
    00023 #endif
    00024 #include <qmovie.h>
    00025 #ifdef KIconLoaderXStatus
    00026 #define Status int
    00027 #undef KIconLoaderXStatus
    00028 #endif
    00029
    00030 #include <kglobal.h>
    00031 #include <kinstance.h>
    00032 #include <kicontheme.h>
    00033
    00034 struct KIconGroup;
    00035 class KIconThemeNode;
    00036 class KConfig;
    00037 struct KIconLoaderPrivate;
    00038 class KStandardDirs;
    00039 class KIconEffect;
    00040
    00041
    00077 class KDECORE_EXPORT KIconLoader
    00078 {
    00079 public:
    00080
    00095     KIconLoader(const QString& appname=QString::null, KStandardDirs *dirs = 0);
    00096
    00100     ~KIconLoader();
    00101
    00106     void addAppDir(const QString& appname);
    00107
    00129     QPixmap loadIcon(const QString& name, KIcon::Group group, int size=0,
    00130              int state=KIcon::DefaultState, QString *path_store=0L,
    00131              bool canReturnNull=false) const;
    00132
    00149     QIconSet loadIconSet(const QString& name, KIcon::Group group, int size,
    00150                          bool canReturnNull);
    00151
    00152     // KDE4 merge as (const QString&,KIcon::Group,int=0,bool=false);
    00164     QIconSet loadIconSet(const QString& name, KIcon::Group group, int size=0);
    00165
    00180     QString iconPath(const QString& name, int group_or_size,
    00181              bool canReturnNull=false) const;
    00182
    00191     QMovie loadMovie(const QString& name, KIcon::Group group, int size=0) const;
    00192
    00202     QString moviePath(const QString& name, KIcon::Group group, int size=0) const;
    00203
    00214     QStringList loadAnimated(const QString& name, KIcon::Group group, int size=0) const;
    00215
    00226     QStringList queryIcons(int group_or_size, KIcon::Context context=KIcon::Any) const;
    00227
    00239     QStringList queryIconsByContext(int group_or_size,
    00240                     KIcon::Context context=KIcon::Any) const;
    00241
    00249     QStringList queryIconsByDir( const QString& iconsDir ) const;
    00250
    00256     int currentSize(KIcon::Group group) const;
    00257
    00263     KIconTheme *theme() const;
    00264
    00269     KIconEffect *iconEffect() const;
    00270
    00277     void reconfigure( const QString& _appname, KStandardDirs *_dirs );
    00278
    00284     static QPixmap unknown();
    00285
    00293     bool alphaBlending( KIcon::Group group ) const;
    00294
    00300     void addExtraDesktopThemes();
    00301
    00307     bool extraDesktopThemesAdded() const;
    00308
    00328     void enableDelayedIconSetLoading( bool enable );
    00329
    00337     bool isDelayedIconSetLoadingEnabled() const;
    00338
    00339
    00340  private:
    00344     void init( const QString& _appname, KStandardDirs *_dirs );
    00345
    00351     KIcon findMatchingIcon(const QString& name, int size) const;
    00352
    00357      QImage *loadOverlay(const QString& name, int size) const;
    00358
    00363     void addAppThemes(const QString& appname);
    00364
    00370     void addBaseThemes(KIconThemeNode *node, const QString &appname);
    00371
    00377     QString unknownIconPath( int size ) const;
    00378
    00384     QString removeIconExtension(const QString &name) const;
    00385
    00389     QIconSet loadIconSetNonDelayed( const QString& name, KIcon::Group group,
    00390                                     int size, bool canReturnNull );
    00391
    00392     // @internal the data object
    00393     KIconLoaderPrivate *d;
    00394 };
    00395
    00400 KDECORE_EXPORT QPixmap DesktopIcon(const QString& name, int size=0,
    00401             int state=KIcon::DefaultState,
    00402             KInstance *instance=KGlobal::instance());
    00403
    00408 KDECORE_EXPORT QPixmap DesktopIcon(const QString& name, KInstance *instance);
    00409
    00414 KDECORE_EXPORT QIconSet DesktopIconSet(const QString& name, int size=0,
    00415             KInstance *instance=KGlobal::instance());
    00416
    00421 KDECORE_EXPORT QPixmap BarIcon(const QString& name, int size=0, int state=KIcon::DefaultState,
    00422     KInstance *instance=KGlobal::instance());
    00423
    00428 KDECORE_EXPORT QPixmap BarIcon(const QString& name, KInstance *instance);
    00429
    00434 KDECORE_EXPORT QIconSet BarIconSet(const QString& name, int size=0,
    00435             KInstance *instance=KGlobal::instance());
    00436
    00441 KDECORE_EXPORT QPixmap SmallIcon(const QString& name, int size=0,
    00442           int state=KIcon::DefaultState,
    00443           KInstance *instance=KGlobal::instance());
    00444
    00449 KDECORE_EXPORT QPixmap SmallIcon(const QString& name, KInstance *instance);
    00450
    00455 KDECORE_EXPORT QIconSet SmallIconSet(const QString& name, int size=0,
    00456             KInstance *instance=KGlobal::instance());
    00457
    00462 KDECORE_EXPORT QPixmap MainBarIcon(const QString& name, int size=0,
    00463             int state=KIcon::DefaultState,
    00464             KInstance *instance=KGlobal::instance());
    00465
    00470 KDECORE_EXPORT QPixmap MainBarIcon(const QString& name, KInstance *instance);
    00471
    00476 KDECORE_EXPORT QIconSet MainBarIconSet(const QString& name, int size=0,
    00477             KInstance *instance=KGlobal::instance());
    00478
    00483 KDECORE_EXPORT QPixmap UserIcon(const QString& name, int state=KIcon::DefaultState,
    00484     KInstance *instance=KGlobal::instance());
    00485
    00490 KDECORE_EXPORT QPixmap UserIcon(const QString& name, KInstance *instance);
    00491
    00496 KDECORE_EXPORT QIconSet UserIconSet(const QString& name,
    00497     KInstance *instance=KGlobal::instance());
    00498
    00503 KDECORE_EXPORT int IconSize(KIcon::Group group, KInstance *instance=KGlobal::instance());
    00504
    00505 #endif // __KIconLoader_h_Included__

This file is part of the documentation for kdecore Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:18:05 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003