# kdecore Library API Documentation

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

# kicontheme.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
    00013 #ifndef __KIconTheme_h_Included__
    00014 #define __KIconTheme_h_Included__
    00015
    00016 #include <qstring.h>
    00017 #include <qstringlist.h>
    00018 #include <qptrlist.h>
    00019 #include "kdelibs_export.h"
    00020
    00021 class KConfig;
    00022 class KIconThemeDir;
    00023
    00024 class KIconThemePrivate;
    00025
    00026 class KIconPrivate;
    00027
    00035 class KDECORE_EXPORT KIcon
    00036 {
    00037 public:
    00038     KIcon() { size = 0; }
    00039
    00043     bool isValid() const { return size != 0; }
    00044
    00048     enum Context {
    00049       Any,
    00050       Action,
    00051       Application,
    00052       Device,
    00053       FileSystem,
    00054       MimeType
    00055     };
    00056
    00060     enum Type {
    00061       Fixed,
    00062       Scalable,
    00063       Threshold
    00064     };
    00065
    00069     enum MatchType {
    00070       MatchExact,
    00071       MatchBest
    00072
    00073     };
    00074
    00075     // if you add a group here, make sure to change the config reading in
    00076     // KIconLoader too
    00080     enum Group {
    00082     NoGroup=-1,
    00084     Desktop=0,
    00086     FirstGroup=0,
    00088     Toolbar,
    00090         MainToolbar,
    00092     Small,
    00094     Panel,
    00096     LastGroup,
    00098     User
    00099          };
    00100
    00104     enum StdSizes {
    00106         SizeSmall=16,
    00108         SizeSmallMedium=22,
    00110         SizeMedium=32,
    00112         SizeLarge=48,
    00114         SizeHuge=64,
    00116         SizeEnormous=128
    00117          };
    00118
    00122     enum States { DefaultState,
    00123           ActiveState,
    00124           DisabledState,
    00125           LastState
    00126     };
    00127
    00133     enum Overlays {
    00134       LockOverlay=0x100,
    00135       ZipOverlay=0x200,
    00136       LinkOverlay=0x400,
    00137       HiddenOverlay=0x800,
    00138       ShareOverlay=0x1000,
    00139       OverlayMask = ~0xff
    00140     };
    00141
    00145     int size;
    00146
    00150     Context context;
    00151
    00155     Type type;
    00156
    00160     int threshold;
    00161
    00165     QString path;
    00166
    00167 private:
    00168     KIconPrivate *d;
    00169 };
    00170
    00171 inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; }
    00172 inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; }
    00173
    00179 class KDECORE_EXPORT KIconTheme
    00180 {
    00181 public:
    00188     KIconTheme(const QString& name, const QString& appName=QString::null);
    00189     ~KIconTheme();
    00190
    00195     QString name() const { return mName; }
    00196
    00202     QString description() const { return mDesc; }
    00203
    00209     QString example() const;
    00210
    00215     QString screenshot() const;
    00216
    00221     QString linkOverlay() const;
    00222
    00227     QString zipOverlay() const;
    00228
    00233     QString lockOverlay() const;
    00234
    00240     QString shareOverlay () const;
    00241
    00246     QString dir() const { return mDir; }
    00247
    00252     QStringList inherits() const { return mInherits; }
    00253
    00258     bool isValid() const;
    00259
    00265     bool isHidden() const;
    00266
    00272     int depth() const { return mDepth; }
    00273
    00279     int defaultSize(KIcon::Group group) const;
    00280
    00286     QValueList<int> querySizes(KIcon::Group group) const;
    00287
    00294     QStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const;
    00295
    00302     QStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const;
    00303
    00304
    00315     KIcon iconPath(const QString& name, int size, KIcon::MatchType match) const;
    00316
    00321     static QStringList list();
    00322
    00327     static QString current();
    00328
    00332     static void reconfigure();
    00333
    00339     static QString defaultThemeName();
    00340
    00341 private:
    00342     int mDefSize[8];
    00343     QValueList<int> mSizes[8];
    00344
    00345     int mDepth;
    00346     QString mDir, mName, mDesc;
    00347     QStringList mInherits;
    00348     QPtrList<KIconThemeDir> mDirs;
    00349     KIconThemePrivate *d;
    00350
    00351     static QString *_theme;
    00352     static QStringList *_theme_list;
    00353 };
    00354
    00355 #endif

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