| # kdecore Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Source Files

# kiconloader.h

    00001 /* vi: ts=8 sts=4 sw=4
    00002  *
    00003  * $Id: kiconloader.h,v 1.115 2002/11/22 01:23:20 antlarr Exp $
    00004  *
    00005  * This file is part of the KDE project, module kdecore.
    00006  * Copyright (C) 2000 Geert Jansen <jansen@kde.org>
    00007  *                    Antonio Larrosa <larrosa@kde.org>
    00008  *
    00009  * This is free software; it comes under the GNU Library General
    00010  * Public License, version 2. See the file "COPYING.LIB" for the
    00011  * exact licensing terms.
    00012  */
    00013
    00014 #ifndef __KIconLoader_h_Included__
    00015 #define __KIconLoader_h_Included__
    00016
    00017 #include <qstring.h>
    00018 #include <qpixmap.h>
    00019 #include <qiconset.h>
    00020
    00021 // Grmbl, X headers.....
    00022 #ifdef Status
    00023 #define KIconLoaderXStatus Status
    00024 #undef Status
    00025 #endif
    00026 #include <qmovie.h>
    00027 #ifdef KIconLoaderXStatus
    00028 #define Status int
    00029 #undef KIconLoaderXStatus
    00030 #endif
    00031
    00032 #include <kglobal.h>
    00033 #include <kinstance.h>
    00034 #include <kicontheme.h>
    00035
    00036 class KIconGroup;
    00037 class KIconThemeNode;
    00038 class KConfig;
    00039 class KIconLoaderPrivate;
    00040 class KStandardDirs;
    00041 class KIconEffect;
    00042
    00043
    00079 class KIconLoader
    00080 {
    00081 public:
    00082
    00097     KIconLoader(const QString& appname=QString::null, KStandardDirs *dirs = 0);
    00098
    00102     ~KIconLoader();
    00103
    00108     void addAppDir(const QString& appname);
    00109
    00131     QPixmap loadIcon(const QString& name, KIcon::Group group, int size=0,
    00132                      int state=KIcon::DefaultState, QString *path_store=0L,
    00133                      bool canReturnNull=false) const;
    00134
    00151     QIconSet loadIconSet(const QString& name, KIcon::Group group, int size,
    00152                          bool canReturnNull);
    00153
    00154     // KDE4 merge as (const QString&,KIcon::Group,int=0,bool=false);
    00166     QIconSet loadIconSet(const QString& name, KIcon::Group group, int size=0);
    00167
    00182     QString iconPath(const QString& name, int group_or_size,
    00183                      bool canReturnNull=false) const;
    00184
    00193     QMovie loadMovie(const QString& name, KIcon::Group group, int size=0) const;
    00194
    00204     QString moviePath(const QString& name, KIcon::Group group, int size=0) const;
    00205
    00216     QStringList loadAnimated(const QString& name, KIcon::Group group, int size=0) const;
    00217
    00228     QStringList queryIcons(int group_or_size, KIcon::Context context=KIcon::Any) const;
    00229
    00241     QStringList queryIconsByContext(int group_or_size,
    00242                                     KIcon::Context context=KIcon::Any) const;
    00243
    00251     QStringList queryIconsByDir( const QString& iconsDir ) const;
    00252
    00258     int currentSize(KIcon::Group group) const;
    00259
    00265     KIconTheme *theme() const;
    00266
    00271     KIconEffect *iconEffect() const;
    00272
    00279     void reconfigure( const QString& _appname, KStandardDirs *_dirs );
    00280
    00286     static QPixmap unknown();
    00287
    00295     bool alphaBlending( KIcon::Group group ) const;
    00296
    00302     void addExtraDesktopThemes();
    00303
    00309     bool extraDesktopThemesAdded() const;
    00310
    00329     void enableDelayedIconSetLoading( bool enable );
    00330
    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
    00399 QPixmap DesktopIcon(const QString& name, int size=0,
    00400                     int state=KIcon::DefaultState,
    00401                     KInstance *instance=KGlobal::instance());
    00402
    00406 QPixmap DesktopIcon(const QString& name, KInstance *instance);
    00407
    00411 QIconSet DesktopIconSet(const QString& name, int size=0,
    00412                     KInstance *instance=KGlobal::instance());
    00413
    00417 QPixmap BarIcon(const QString& name, int size=0, int state=KIcon::DefaultState,
    00418         KInstance *instance=KGlobal::instance());
    00419
    00423 QPixmap BarIcon(const QString& name, KInstance *instance);
    00424
    00428 QIconSet BarIconSet(const QString& name, int size=0,
    00429                     KInstance *instance=KGlobal::instance());
    00430
    00434 QPixmap SmallIcon(const QString& name, int size=0,
    00435                   int state=KIcon::DefaultState,
    00436                   KInstance *instance=KGlobal::instance());
    00437
    00441 QPixmap SmallIcon(const QString& name, KInstance *instance);
    00442
    00446 QIconSet SmallIconSet(const QString& name, int size=0,
    00447                     KInstance *instance=KGlobal::instance());
    00448
    00452 QPixmap MainBarIcon(const QString& name, int size=0,
    00453                     int state=KIcon::DefaultState,
    00454                     KInstance *instance=KGlobal::instance());
    00455
    00459 QPixmap MainBarIcon(const QString& name, KInstance *instance);
    00460
    00464 QIconSet MainBarIconSet(const QString& name, int size=0,
    00465                     KInstance *instance=KGlobal::instance());
    00466
    00470 QPixmap UserIcon(const QString& name, int state=KIcon::DefaultState,
    00471         KInstance *instance=KGlobal::instance());
    00472
    00476 QPixmap UserIcon(const QString& name, KInstance *instance);
    00477
    00481 QIconSet UserIconSet(const QString& name,
    00482         KInstance *instance=KGlobal::instance());
    00483
    00487 int IconSize(KIcon::Group group, KInstance *instance=KGlobal::instance());
    00488
    00489 #endif // __KIconLoader_h_Included__

This file is part of the documentation for kdelibs Version 3.1.5.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Jan 28 12:46:34 2004 by doxygen 1.3.4 written by Dimitri van Heesch, © 1997-2001