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

KDEUI

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KIconCache Class Reference

#include <kiconcache.h>

Inheritance diagram for KIconCache:
Inheritance graph
[legend]

Public Member Functions

 KIconCache ()
 
virtual ~KIconCache ()
 
int defaultIconSize (KIconLoader::Group group) const
 
bool find (const QString &key, QPixmap &pix, QString *path)
 
virtual bool find (const QString &key, QPixmap &pix)
 
void insert (const QString &key, const QPixmap &pix, const QString &path)
 
virtual void insert (const QString &key, const QPixmap &pix)
 
void setThemeInfo (const QList< KIconTheme * > &themes)
 
- Public Member Functions inherited from KPixmapCache
 KPixmapCache (const QString &name)
 
virtual ~KPixmapCache ()
 
int cacheLimit () const
 
void discard ()
 
bool isEnabled () const
 
bool isValid () const
 
QPixmap loadFromFile (const QString &filename)
 
QPixmap loadFromSvg (const QString &filename, const QSize &size=QSize())
 
void removeEntries (int newsize=0)
 
RemoveStrategy removeEntryStrategy () const
 
void setCacheLimit (int kbytes)
 
void setRemoveEntryStrategy (RemoveStrategy strategy)
 
void setTimestamp (unsigned int time)
 
void setUseQPixmapCache (bool use)
 
int size () const
 
unsigned int timestamp () const
 
bool useQPixmapCache () const
 

Static Public Member Functions

static void deleteCache ()
 
- Static Public Member Functions inherited from KPixmapCache
static void deleteCache (const QString &name)
 

Protected Member Functions

QSet< QString > existingIconThemeDirs (const QStringList &themeNames) const
 
virtual bool loadCustomData (QDataStream &stream)
 
virtual bool loadCustomIndexHeader (QDataStream &stream)
 
unsigned int mostRecentMTime (const QSet< QString > &dirNames) const
 
virtual bool writeCustomData (QDataStream &stream)
 
virtual void writeCustomIndexHeader (QDataStream &stream)
 
- Protected Member Functions inherited from KPixmapCache
void ensureInited () const
 
bool recreateCacheFiles ()
 
void setValid (bool valid)
 

Additional Inherited Members

- Public Types inherited from KPixmapCache
enum  RemoveStrategy { RemoveOldest, RemoveSeldomUsed, RemoveLeastRecentlyUsed }
 

Detailed Description

Icon cache for KDE.

Note that this is the KDE-wide cache for storing icons and should only be used by KIconLoader. If you want to cache your own pixmaps you should look at KImageCache or KSharedDataCache instead.

Definition at line 48 of file kiconcache.h.

Constructor & Destructor Documentation

KIconCache::KIconCache ( )
explicit

Constucts the icon cache object.

Definition at line 103 of file kiconcache.cpp.

KIconCache::~KIconCache ( )
virtual

Definition at line 111 of file kiconcache.cpp.

Member Function Documentation

int KIconCache::defaultIconSize ( KIconLoader::Group  group) const

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

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

Definition at line 229 of file kiconcache.cpp.

void KIconCache::deleteCache ( )
static

Deletes the icon cache.

Definition at line 116 of file kiconcache.cpp.

QSet< QString > KIconCache::existingIconThemeDirs ( const QStringList &  themeNames) const
protected

Definition at line 189 of file kiconcache.cpp.

bool KIconCache::find ( const QString &  key,
QPixmap &  pix,
QString *  path 
)

Definition at line 270 of file kiconcache.cpp.

bool KIconCache::find ( const QString &  key,
QPixmap &  pix 
)
virtual

Tries to load pixmap with the specified key from cache.

If the pixmap is found it is stored in pix, otherwise pix is unchanged.

Returns
true when pixmap was found and loaded from cache, false otherwise

Reimplemented from KPixmapCache.

Definition at line 290 of file kiconcache.cpp.

void KIconCache::insert ( const QString &  key,
const QPixmap &  pix,
const QString &  path 
)

Definition at line 283 of file kiconcache.cpp.

void KIconCache::insert ( const QString &  key,
const QPixmap &  pix 
)
virtual

Inserts the pixmap pix into the cache, associated with the key key.

Any existing pixmaps associated with key are overwritten.

Reimplemented from KPixmapCache.

Definition at line 296 of file kiconcache.cpp.

bool KIconCache::loadCustomData ( QDataStream &  stream)
protectedvirtual

Can be used by subclasses to load custom data from the stream.

This function will be called by KPixmapCache immediately following the image data for a single image being read from stream. (This function is called once for every single image).

See also
writeCustomData
loadCustomIndexHeader
Parameters
streamthe QDataStream to read data from
Returns
true if custom data was successfully loaded, false otherwise. If false is returned then the cached item is assumed to be invalid and will not be available to find() or contains().

Reimplemented from KPixmapCache.

Definition at line 302 of file kiconcache.cpp.

bool KIconCache::loadCustomIndexHeader ( QDataStream &  stream)
protectedvirtual

Can be used by subclasses to load custom data from cache's header.

This function will be called by KPixmapCache immediately after the index header has been written out. (This function is called one time only for the entire cache).

See also
loadCustomData
writeCustomIndexHeader
Parameters
streamthe QDataStream to read data from
Returns
true if custom index header data was successfully read, false otherwise. If false is returned then the cache is assumed to be invalid and further processing does not occur.

Reimplemented from KPixmapCache.

Definition at line 121 of file kiconcache.cpp.

unsigned int KIconCache::mostRecentMTime ( const QSet< QString > &  dirNames) const
protected

Definition at line 216 of file kiconcache.cpp.

void KIconCache::setThemeInfo ( const QList< KIconTheme * > &  themes)

Definition at line 239 of file kiconcache.cpp.

bool KIconCache::writeCustomData ( QDataStream &  stream)
protectedvirtual

Can be used by subclasses to write custom data into the stream.

This function will be called by KPixmapCache immediately after the image data for a single image has been written to stream. (This function is called once for every single image).

See also
loadCustomData
writeCustomIndexHeader
Parameters
streamthe QDataStream to write data to

Reimplemented from KPixmapCache.

Definition at line 313 of file kiconcache.cpp.

void KIconCache::writeCustomIndexHeader ( QDataStream &  stream)
protectedvirtual

Can be used by subclasses to write custom data into cache's header.

This function will be called by KPixmapCache immediately following the index header has being loaded. (This function is called one time only for the entire cache).

See also
writeCustomData
loadCustomIndexHeader
Parameters
streamthe QDataStream to write data to

Reimplemented from KPixmapCache.

Definition at line 167 of file kiconcache.cpp.


The documentation for this class was generated from the following files:
  • kiconcache.h
  • kiconcache.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:49:17 by doxygen 1.8.7 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 API Reference

Skip menu "kdelibs 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
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



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