• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kiconloader.h

Go to the documentation of this file.
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 library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Library General Public
00009  * License version 2 as published by the Free Software Foundation.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef KICONLOADER_H
00023 #define KICONLOADER_H
00024 
00025 #include <QtCore/QString>
00026 #include <QtCore/QStringList>
00027 #include <QtCore/QObject>
00028 
00029 #include <kglobal.h>
00030 #include <kdeui_export.h>
00031 
00032 class QIcon;
00033 class QMovie;
00034 class QPixmap;
00035 
00036 class KComponentData;
00037 class KIconLoaderPrivate;
00038 class KStandardDirs;
00039 class KIconEffect;
00040 class KIconTheme;
00041 
00077 class KDEUI_EXPORT KIconLoader : public QObject
00078 {
00079     Q_OBJECT
00080 
00081 public:
00085     enum Context {
00086         Any,           
00087         Action,        
00088         Application,   
00089         Device,        
00090         FileSystem,    
00091         MimeType,      
00092         Animation,     
00093         Category,      
00094         Emblem,        
00095         Emote,         
00096         International, 
00097         Place,         
00098         StatusIcon     
00099     };
00100 
00104    enum Type {
00105        Fixed,    
00106        Scalable, 
00107        Threshold 
00108    };
00109 
00113     enum MatchType {
00114         MatchExact, 
00115         MatchBest   
00116     };
00117 
00121     enum Group {
00123         NoGroup=-1,
00125         Desktop=0,
00127         FirstGroup=0,
00129         Toolbar,
00131         MainToolbar,
00133         Small,
00135         Panel,
00137         Dialog,
00139         LastGroup,
00141         User
00142     };
00143 
00147     enum StdSizes {
00149         SizeSmall=16,
00151         SizeSmallMedium=22,
00153         SizeMedium=32,
00155         SizeLarge=48,
00157         SizeHuge=64,
00159         SizeEnormous=128
00160     };
00161 
00165     enum States {
00166         DefaultState,  
00167         ActiveState,   
00168         DisabledState, 
00169         LastState      
00170     };
00171 
00184     explicit KIconLoader(const QString& appname=QString(), KStandardDirs *dirs = 0, QObject* parent = 0);
00185 
00195     explicit KIconLoader(const KComponentData &componentData, QObject* parent = 0);
00196 
00200     ~KIconLoader();
00201 
00207     static KIconLoader* global();
00208 
00213     void addAppDir(const QString& appname);
00214 
00239     QPixmap loadIcon(const QString& name, KIconLoader::Group group, int size=0,
00240                      int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList(),
00241                      QString *path_store=0L,
00242                      bool canReturnNull=false) const;
00243 
00263     QPixmap loadMimeTypeIcon( const QString& iconName, KIconLoader::Group group, int size=0,
00264                               int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList(),
00265                               QString *path_store=0 ) const;
00266 
00284     KDE_DEPRECATED QIcon loadIconSet(const QString& name, KIconLoader::Group group, int size = 0,
00285                                      bool canReturnNull = false);
00286 
00301     QString iconPath(const QString& name, int group_or_size,
00302                      bool canReturnNull=false) const;
00303 
00314     QMovie *loadMovie(const QString& name, KIconLoader::Group group, int size=0, QObject *parent=0) const;
00315 
00325     QString moviePath(const QString& name, KIconLoader::Group group, int size=0) const;
00326 
00337     QStringList loadAnimated(const QString& name, KIconLoader::Group group, int size=0) const;
00338 
00349     QStringList queryIcons(int group_or_size, KIconLoader::Context context=KIconLoader::Any) const;
00350 
00362     QStringList queryIconsByContext(int group_or_size,
00363                                     KIconLoader::Context context=KIconLoader::Any) const;
00364 
00368     bool hasContext( KIconLoader::Context context ) const;
00369 
00376     QStringList queryIconsByDir( const QString& iconsDir ) const;
00377 
00383     int currentSize(KIconLoader::Group group) const;
00384 
00392     KIconTheme *theme() const;
00393 
00398     KIconEffect *iconEffect() const;
00399 
00406     void reconfigure( const QString& _appname, KStandardDirs *_dirs );
00407 
00413     static QPixmap unknown();
00414 
00422     bool alphaBlending( KIconLoader::Group group ) const;
00423 
00428     void addExtraDesktopThemes();
00429 
00434     bool extraDesktopThemesAdded() const;
00435 
00436  public Q_SLOTS:
00440     void newIconLoader();
00441 
00442 Q_SIGNALS:
00446     void iconLoaderSettingsChanged();
00447 
00448  private:
00449     // @internal the data object
00450     KIconLoaderPrivate *d;
00451 };
00452 
00457 KDEUI_EXPORT QPixmap DesktopIcon(const QString& name, int size=0,
00458                     int state=KIconLoader::DefaultState, const QStringList& overlays = QStringList());
00459 
00465 KDEUI_EXPORT_DEPRECATED QIcon DesktopIconSet(const QString& name, int size=0);
00466 
00471 KDEUI_EXPORT QPixmap BarIcon(const QString& name, int size=0, int state=KIconLoader::DefaultState,
00472                              const QStringList& overlays = QStringList());
00473 
00479 KDEUI_EXPORT_DEPRECATED QIcon BarIconSet(const QString& name, int size=0);
00480 
00485 KDEUI_EXPORT QPixmap SmallIcon(const QString& name, int size=0,
00486                   int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00487 
00493 KDEUI_EXPORT_DEPRECATED QIcon SmallIconSet(const QString& name, int size=0);
00494 
00499 KDEUI_EXPORT QPixmap MainBarIcon(const QString& name, int size=0,
00500                     int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00501 
00507 KDEUI_EXPORT_DEPRECATED QIcon MainBarIconSet(const QString& name, int size=0);
00508 
00513 KDEUI_EXPORT QPixmap UserIcon(const QString& name, int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00514 
00520 KDEUI_EXPORT_DEPRECATED QIcon UserIconSet(const QString& name);
00521 
00526 KDEUI_EXPORT int IconSize(KIconLoader::Group group);
00527 
00528 inline KIconLoader::Group& operator++(KIconLoader::Group& group) { group = static_cast<KIconLoader::Group>(group+1); return group; }
00529 inline KIconLoader::Group operator++(KIconLoader::Group& group,int) { KIconLoader::Group ret = group; ++group; return ret; }
00530 
00531 #endif // KICONLOADER_H

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal