• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.8.3 API Reference
  • KDE Home
  • 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     Q_ENUMS(Context)
00081     Q_ENUMS(Type)
00082     Q_ENUMS(MatchType)
00083     Q_ENUMS(Group)
00084     Q_ENUMS(StdSizes)
00085     Q_ENUMS(States)
00086 
00087 public:
00091     enum Context {
00092         Any,           
00093         Action,        
00094         Application,   
00095         Device,        
00096         FileSystem,    
00097         MimeType,      
00098         Animation,     
00099         Category,      
00100         Emblem,        
00101         Emote,         
00102         International, 
00103         Place,         
00104         StatusIcon     
00105     };
00106 
00110    enum Type {
00111        Fixed,    
00112        Scalable, 
00113        Threshold 
00114    };
00115 
00119     enum MatchType {
00120         MatchExact, 
00121         MatchBest   
00122     };
00123 
00127     enum Group {
00129         NoGroup=-1,
00131         Desktop=0,
00133         FirstGroup=0,
00135         Toolbar,
00137         MainToolbar,
00139         Small,
00141         Panel,
00143         Dialog,
00145         LastGroup,
00147         User
00148     };
00149 
00153     enum StdSizes {
00155         SizeSmall=16,
00157         SizeSmallMedium=22,
00159         SizeMedium=32,
00161         SizeLarge=48,
00163         SizeHuge=64,
00165         SizeEnormous=128
00166     };
00167 
00171     enum States {
00172         DefaultState,  
00173         ActiveState,   
00174         DisabledState, 
00175         LastState      
00176     };
00177 
00190     explicit KIconLoader(const QString& appname=QString(), KStandardDirs *dirs = 0, QObject* parent = 0);
00191 
00201     explicit KIconLoader(const KComponentData &componentData, QObject* parent = 0);
00202 
00206     ~KIconLoader();
00207 
00212     static KIconLoader* global();
00213 
00218     void addAppDir(const QString& appname);
00219 
00249     QPixmap loadIcon(const QString& name, KIconLoader::Group group, int size=0,
00250                      int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList(),
00251                      QString *path_store=0L,
00252                      bool canReturnNull=false) const;
00253 
00273     QPixmap loadMimeTypeIcon( const QString& iconName, KIconLoader::Group group, int size=0,
00274                               int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList(),
00275                               QString *path_store=0 ) const;
00276 
00294 #ifndef KDE_NO_DEPRECATED
00295     KDE_DEPRECATED QIcon loadIconSet(const QString& name, KIconLoader::Group group, int size = 0,
00296                                      bool canReturnNull = false);
00297 #endif
00298 
00313     QString iconPath(const QString& name, int group_or_size,
00314                      bool canReturnNull=false) const;
00315 
00326     QMovie *loadMovie(const QString& name, KIconLoader::Group group, int size=0, QObject *parent=0) const;
00327 
00337     QString moviePath(const QString& name, KIconLoader::Group group, int size=0) const;
00338 
00349     QStringList loadAnimated(const QString& name, KIconLoader::Group group, int size=0) const;
00350 
00361     QStringList queryIcons(int group_or_size, KIconLoader::Context context=KIconLoader::Any) const;
00362 
00374     QStringList queryIconsByContext(int group_or_size,
00375                                     KIconLoader::Context context=KIconLoader::Any) const;
00376 
00380     bool hasContext( KIconLoader::Context context ) const;
00381 
00388     QStringList queryIconsByDir( const QString& iconsDir ) const;
00389 
00399     int currentSize(KIconLoader::Group group) const;
00400 
00408     KIconTheme *theme() const;
00409 
00414     KIconEffect *iconEffect() const;
00415 
00422     void reconfigure( const QString& _appname, KStandardDirs *_dirs );
00423 
00429     static QPixmap unknown();
00430 
00438     bool alphaBlending( KIconLoader::Group group ) const;
00439 
00444     void addExtraDesktopThemes();
00445 
00450     bool extraDesktopThemesAdded() const;
00451 
00459     void drawOverlays(const QStringList &overlays, QPixmap &pixmap, KIconLoader::Group group, int state = KIconLoader::DefaultState) const;
00460 
00461  public Q_SLOTS:
00465     void newIconLoader();
00466 
00467 Q_SIGNALS:
00471     void iconLoaderSettingsChanged();
00472 
00473  private:
00474     // @internal the data object
00475     KIconLoaderPrivate *d;
00476 };
00477 
00482 KDEUI_EXPORT QPixmap DesktopIcon(const QString& name, int size=0,
00483                     int state=KIconLoader::DefaultState, const QStringList& overlays = QStringList());
00484 
00490 #ifndef KDE_NO_DEPRECATED
00491 KDEUI_EXPORT_DEPRECATED QIcon DesktopIconSet(const QString& name, int size=0);
00492 #endif
00493 
00498 KDEUI_EXPORT QPixmap BarIcon(const QString& name, int size=0, int state=KIconLoader::DefaultState,
00499                              const QStringList& overlays = QStringList());
00500 
00506 #ifndef KDE_NO_DEPRECATED
00507 KDEUI_EXPORT_DEPRECATED QIcon BarIconSet(const QString& name, int size=0);
00508 #endif
00509 
00514 KDEUI_EXPORT QPixmap SmallIcon(const QString& name, int size=0,
00515                   int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00516 
00522 #ifndef KDE_NO_DEPRECATED
00523 KDEUI_EXPORT_DEPRECATED QIcon SmallIconSet(const QString& name, int size=0);
00524 #endif
00525 
00530 KDEUI_EXPORT QPixmap MainBarIcon(const QString& name, int size=0,
00531                     int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00532 
00538 #ifndef KDE_NO_DEPRECATED
00539 KDEUI_EXPORT_DEPRECATED QIcon MainBarIconSet(const QString& name, int size=0);
00540 #endif
00541 
00546 KDEUI_EXPORT QPixmap UserIcon(const QString& name, int state=KIconLoader::DefaultState, const QStringList &overlays = QStringList());
00547 
00553 #ifndef KDE_NO_DEPRECATED
00554 KDEUI_EXPORT_DEPRECATED QIcon UserIconSet(const QString& name);
00555 #endif
00556 
00561 KDEUI_EXPORT int IconSize(KIconLoader::Group group);
00562 
00563 inline KIconLoader::Group& operator++(KIconLoader::Group& group) { group = static_cast<KIconLoader::Group>(group+1); return group; }
00564 inline KIconLoader::Group operator++(KIconLoader::Group& group,int) { KIconLoader::Group ret = group; ++group; return ret; }
00565 
00566 #endif // KICONLOADER_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Thu May 10 2012 20:53:03 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs-4.8.3 API Reference

Skip menu "kdelibs-4.8.3 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal