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

KDEUI

KIconTheme Class Reference

#include <kicontheme.h>

List of all members.

Public Types

enum  ContextMenus { TextEditor, ReadOnlyText }

Public Member Functions

int defaultSize (KIconLoader::Group group) const
int depth () const
QString description () const
QString dir () const
QString example () const
bool hasContext (KIconLoader::Context context) const
K3Icon iconPath (const QString &name, int size, KIconLoader::MatchType match) const
QStringList inherits () const
QString internalName () const
bool isHidden () const
bool isValid () const
 KIconTheme (const QString &name, const QString &appName=QString())
QString name () const
QStringList queryIcons (int size, KIconLoader::Context context=KIconLoader::Any) const
QStringList queryIconsByContext (int size, KIconLoader::Context context=KIconLoader::Any) const
QList< int > querySizes (KIconLoader::Group group) const
QString screenshot () const
 ~KIconTheme ()

Static Public Member Functions

static void assignIconsToContextMenu (ContextMenus type, QList< QAction * > actions)
static QString current ()
static QString defaultThemeName ()
static QStringList list ()
static void reconfigure ()

Detailed Description

For internal use only.

Class to use/access icon themes in KDE. This class is used by the iconloader but can be used by others too.

Warning:
You should not use this class externally. This class is exported because the KCM needs it.
See also:
KIconLoader

Definition at line 46 of file kicontheme.h.


Member Enumeration Documentation

enum KIconTheme::ContextMenus

Defines the context menus that assignIconsToContextMenus is aware of.

For ReadOnlyText the menu is expected to have one entry.

TextEditor is expected to have the full complement of undo, redo, cut, copy, paste and clear.

Enumerator:
TextEditor 
ReadOnlyText 

Definition at line 202 of file kicontheme.h.


Constructor & Destructor Documentation

KIconTheme::KIconTheme ( const QString &  name,
const QString &  appName = QString() 
) [explicit]

Load an icon theme by name.

Parameters:
name the name of the theme (e.g. "hicolor" or "keramik")
appName the name of the application. Can be null. This argument allows applications to have themed application icons.

Definition at line 127 of file kicontheme.cpp.

KIconTheme::~KIconTheme (  ) 

Definition at line 261 of file kicontheme.cpp.


Member Function Documentation

void KIconTheme::assignIconsToContextMenu ( ContextMenus  type,
QList< QAction * >  actions 
) [static]

Assigns standard icons to the various standard text edit context menus.

Definition at line 597 of file kicontheme.cpp.

QString KIconTheme::current (  )  [static]

Returns the current icon theme.

Returns:
the name of the current theme

Definition at line 520 of file kicontheme.cpp.

int KIconTheme::defaultSize ( KIconLoader::Group  group  )  const

The default size of this theme for a certain icon group.

Parameters:
group The icon group. See KIconLoader::Group.
Returns:
The default size in pixels for the given icon group.

Definition at line 317 of file kicontheme.cpp.

QString KIconTheme::defaultThemeName (  )  [static]

Returns the default icon theme.

Returns:
the name of the default theme name

Definition at line 592 of file kicontheme.cpp.

int KIconTheme::depth (  )  const

The minimum display depth required for this theme.

This can either be 8 or 32.

Returns:
the minimum bpp (8 or 32)

Definition at line 312 of file kicontheme.cpp.

QString KIconTheme::description (  )  const

A description for the icon theme.

Returns:
a human-readable description of the theme, QString() if there is none

Definition at line 277 of file kicontheme.cpp.

QString KIconTheme::dir (  )  const

Returns the toplevel theme directory.

Returns:
the directory of the theme

Definition at line 292 of file kicontheme.cpp.

QString KIconTheme::example (  )  const

Return the name of the "example" icon.

This can be used to present the theme to the user.

Returns:
the name of the example icon, QString() if there is none

Definition at line 282 of file kicontheme.cpp.

bool KIconTheme::hasContext ( KIconLoader::Context  context  )  const

Returns true if the theme has any icons for the given context.

Definition at line 414 of file kicontheme.cpp.

K3Icon KIconTheme::iconPath ( const QString &  name,
int  size,
KIconLoader::MatchType  match 
) const

Lookup an icon in the theme.

Parameters:
name The name of the icon, without extension.
size The desired size of the icon.
match The matching mode. KIconLoader::MatchExact returns an icon only if matches exactly. KIconLoader::MatchBest returns the best matching icon.
Returns:
A K3Icon class that describes the icon. If an icon is found, an invalid K3Icon object otherwise.
See also:
KIconLoader::isValid will return true, and false otherwise.

Definition at line 424 of file kicontheme.cpp.

QStringList KIconTheme::inherits (  )  const

The themes this icon theme falls back on.

Returns:
a list of icon themes that are used as fall-backs

Definition at line 297 of file kicontheme.cpp.

QString KIconTheme::internalName (  )  const

The internal name of the icon theme (same as the name argument passed to the constructor).

Returns:
the internal name of the theme

Definition at line 272 of file kicontheme.cpp.

bool KIconTheme::isHidden (  )  const

The icon theme should be hidden to the user?

Returns:
true if the icon theme is hidden

Definition at line 307 of file kicontheme.cpp.

bool KIconTheme::isValid (  )  const

The icon theme exists?

Returns:
true if the icon theme is valid

Definition at line 302 of file kicontheme.cpp.

QStringList KIconTheme::list (  )  [static]

List all icon themes installed on the system, global and local.

Returns:
the list of all icon themes

Definition at line 543 of file kicontheme.cpp.

QString KIconTheme::name (  )  const

The stylized name of the icon theme.

Returns:
the (human-readable) name of the theme

Definition at line 267 of file kicontheme.cpp.

QStringList KIconTheme::queryIcons ( int  size,
KIconLoader::Context  context = KIconLoader::Any 
) const

Query available icons for a size and context.

Parameters:
size the size of the icons
context the context of the icons
Returns:
the list of icon names

Definition at line 336 of file kicontheme.cpp.

QStringList KIconTheme::queryIconsByContext ( int  size,
KIconLoader::Context  context = KIconLoader::Any 
) const

Query available icons for a context and preferred size.

Parameters:
size the size of the icons
context the context of the icons
Returns:
the list of icon names

Definition at line 387 of file kicontheme.cpp.

QList< int > KIconTheme::querySizes ( KIconLoader::Group  group  )  const

Query available sizes for a group.

Parameters:
group The icon group. See KIconLoader::Group.
Returns:
a list of available sized for the given group

Definition at line 326 of file kicontheme.cpp.

void KIconTheme::reconfigure (  )  [static]

Reconfigure the theme.

Definition at line 585 of file kicontheme.cpp.

QString KIconTheme::screenshot (  )  const

Return the name of the screenshot.

Returns:
the name of the screenshot, QString() if there is none

Definition at line 287 of file kicontheme.cpp.


The documentation for this class was generated from the following files:
  • kicontheme.h
  • kicontheme.cpp

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