kicontheme.h
/* vi: ts=8 sts=4 sw=4
*
* This file is part of the KDE project, module kdecore.
* Copyright (C) 2000 Geert Jansen <jansen@kde.org>
* Antonio Larrosa <larrosa@kde.org>
*
* This is free software; it comes under the GNU Library General
* Public License, version 2. See the file "COPYING.LIB" for the
* exact licensing terms.
*
*/
#ifndef __KIconTheme_h_Included__
#define __KIconTheme_h_Included__
#include <qstring.h>
#include <qstringlist.h>
#include <qptrlist.h>
#include "kdelibs_export.h"
class KConfig;
class KIconThemeDir;
class KIconThemePrivate;
class KIconPrivate;
class KDECORE_EXPORT KIcon
{
public:
KIcon() { size = 0; }
bool isValid() const { return size != 0; }
enum Context {
Any,
Action,
Application,
Device,
FileSystem,
MimeType,
Animation,
Category,
Emblem,
Emote,
International,
Place,
StatusIcon
};
enum Type {
Fixed,
Scalable,
Threshold
};
enum MatchType {
MatchExact,
MatchBest
};
// if you add a group here, make sure to change the config reading in
// KIconLoader too
enum Group {
NoGroup=-1,
Desktop=0,
FirstGroup=0,
Toolbar,
MainToolbar,
Small,
Panel,
LastGroup,
User
};
enum StdSizes {
SizeSmall=16,
SizeSmallMedium=22,
SizeMedium=32,
SizeLarge=48,
SizeHuge=64,
SizeEnormous=128
};
enum States { DefaultState,
ActiveState,
DisabledState,
LastState
};
enum Overlays {
LockOverlay=0x100,
ZipOverlay=0x200,
LinkOverlay=0x400,
HiddenOverlay=0x800,
ShareOverlay=0x1000,
OverlayMask = ~0xff
};
int size;
Context context;
Type type;
int threshold;
QString path;
private:
KIconPrivate *d;
};
inline KIcon::Group& operator++(KIcon::Group& group) { group = static_cast<KIcon::Group>(group+1); return group; }
inline KIcon::Group operator++(KIcon::Group& group,int) { KIcon::Group ret = group; ++group; return ret; }
class KDECORE_EXPORT KIconTheme
{
public:
KIconTheme(const QString& name, const QString& appName=QString::null);
~KIconTheme();
QString name() const { return mName; }
QString description() const { return mDesc; }
QString example() const;
QString screenshot() const;
QString linkOverlay() const;
QString zipOverlay() const;
QString lockOverlay() const;
QString shareOverlay () const;
QString dir() const { return mDir; }
QStringList inherits() const { return mInherits; }
bool isValid() const;
bool isHidden() const;
int depth() const { return mDepth; }
int defaultSize(KIcon::Group group) const;
QValueList<int> querySizes(KIcon::Group group) const;
QStringList queryIcons(int size, KIcon::Context context = KIcon::Any) const;
QStringList queryIconsByContext(int size, KIcon::Context context = KIcon::Any) const;
KIcon iconPath(const QString& name, int size, KIcon::MatchType match) const;
bool hasContext( KIcon::Context context ) const;
static QStringList list();
static QString current();
static void reconfigure();
static QString defaultThemeName();
private:
int mDefSize[8];
QValueList<int> mSizes[8];
int mDepth;
QString mDir, mName, mDesc;
QStringList mInherits;
QPtrList<KIconThemeDir> mDirs;
KIconThemePrivate *d;
static QString *_theme;
static QStringList *_theme_list;
};
#endif
KIcon::Toolbar
Toolbar icons.
Definition: kicontheme.h:95
KIcon::Overlays
Overlays
This defines an overlay, a semi-transparent image that is projected onto the icon.
Definition: kicontheme.h:140
KIcon::Any
Some icon with unknown purpose.
Definition: kicontheme.h:49
KIcon::Small
Small icons.
Definition: kicontheme.h:99
KIcon::Group
Group
The group of the icon.
Definition: kicontheme.h:87
KIconTheme::depth
int depth() const
The minimum display depth required for this theme.
Definition: kicontheme.h:279
KIconTheme::dir
QString dir() const
Returns the toplevel theme directory.
Definition: kicontheme.h:253
KIcon::Emblem
An icon that adds information to an existing icon.
Definition: kicontheme.h:57
KIcon::size
int size
The size in pixels of the icon.
Definition: kicontheme.h:152
KIcon::path
QString path
The full path of the icon.
Definition: kicontheme.h:172
KIcon::Application
An icon that represents an application.
Definition: kicontheme.h:51
KIcon::Scalable
Scalable-size icon.
Definition: kicontheme.h:69
KIcon::Animation
An icon that is animated.
Definition: kicontheme.h:55
KIcon::MatchExact
Only try to find an exact match.
Definition: kicontheme.h:77
KIcon::LastGroup
Last group.
Definition: kicontheme.h:103
KIcon::MimeType
An icon that represents a mime type (or file type).
Definition: kicontheme.h:54
KIcon::International
An icon that represents a country's flag.
Definition: kicontheme.h:59
KIcon::context
Context context
The context of the icon.
Definition: kicontheme.h:157
KIcon
One icon as found by KIconTheme.
Definition: kicontheme.h:35
KIcon::type
Type type
The type of the icon: Fixed, Scalable or Threshold.
Definition: kicontheme.h:162
KIcon::isValid
bool isValid() const
Return true if this icon is valid, false otherwise.
Definition: kicontheme.h:43
KIcon::States
States
Defines the possible states of an icon.
Definition: kicontheme.h:129
KIcon::Place
An icon that represents a location (e.g. 'home', 'trash').
Definition: kicontheme.h:60
KIconTheme::inherits
QStringList inherits() const
The themes this icon theme falls back on.
Definition: kicontheme.h:259
KIcon::FileSystem
An icon that represents a file system.
Definition: kicontheme.h:53
KIcon::DisabledState
Icon is disabled.
Definition: kicontheme.h:131
KIcon::Context
Context
Defines the context of the icon.
Definition: kicontheme.h:48
KIcon::threshold
int threshold
The threshold in case type == Threshold.
Definition: kicontheme.h:167
KIcon::Type
Type
The type of the icon.
Definition: kicontheme.h:67
KIcon::StdSizes
StdSizes
These are the standard sizes for icons.
Definition: kicontheme.h:111
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43
KIcon::Device
An icon that represents a device.
Definition: kicontheme.h:52
KIcon::Panel
Panel (Kicker) icons.
Definition: kicontheme.h:101
KIcon::MatchType
MatchType
The type of a match.
Definition: kicontheme.h:76
KIcon::Fixed
Fixed-size icon.
Definition: kicontheme.h:68
KIcon::ActiveState
Icon is active.
Definition: kicontheme.h:130
KIcon::Emote
An icon that expresses an emotion.
Definition: kicontheme.h:58
KIcon::Category
An icon that represents a category.
Definition: kicontheme.h:56
KIconTheme::description
QString description() const
A description for the icon theme.
Definition: kicontheme.h:209
KIconTheme::name
QString name() const
The stylized name of the icon theme.
Definition: kicontheme.h:202
KIconTheme
Class to use/access icon themes in KDE.
Definition: kicontheme.h:186
KIcon::Action
An action icon (e.g. 'save', 'print').
Definition: kicontheme.h:50
KIcon::MainToolbar
Main toolbar icons.
Definition: kicontheme.h:97

KDE Home | KDE Accessibility Home | Description of Access Keys