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

KDEUI

kpixmapcache.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * This file is part of the KDE project.
00004  * Copyright (C) 2007 Rivo Laks <rivolaks@hot.ee>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License version 2 as published by the Free Software Foundation.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public License
00016  * along with this library; see the file COPYING.LIB.  If not, write to
00017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #ifndef KPIXMAPCACHE_H
00022 #define KPIXMAPCACHE_H
00023 
00024 #include <kdeui_export.h>
00025 
00026 #include <QtCore/QList>
00027 #include <QtCore/QSet>
00028 #include <QtCore/QSize>
00029 
00030 class QString;
00031 class QPixmap;
00032 
00033 
00076 class KDEUI_EXPORT KPixmapCache
00077 {
00078 public:
00083     explicit KPixmapCache(const QString& name);
00084     virtual ~KPixmapCache();
00085 
00090     virtual bool find(const QString& key, QPixmap& pix);
00096     virtual void insert(const QString& key, const QPixmap& pix);
00097 
00103     QPixmap loadFromFile(const QString& filename);
00109     QPixmap loadFromSvg(const QString& filename, const QSize& size = QSize());
00110 
00116     unsigned int timestamp() const;
00122     void setTimestamp(unsigned int time);
00128     void setUseQPixmapCache(bool use);
00133     bool useQPixmapCache() const;
00134 
00138     int size() const;
00143     int cacheLimit() const;
00153     void setCacheLimit(int kbytes);
00160     enum RemoveStrategy { RemoveOldest, RemoveSeldomUsed, RemoveLeastRecentlyUsed };
00165     RemoveStrategy removeEntryStrategy() const;
00169     void setRemoveEntryStrategy(RemoveStrategy strategy);
00170 
00176     bool isEnabled() const;
00182     bool isValid() const;
00187     static void deleteCache(const QString& name);
00191     void discard();
00192 
00203     void removeEntries(int newsize = 0);
00204 
00205 protected:
00209     void ensureInited() const;
00210 
00214     virtual bool loadCustomData(QDataStream& stream);
00215 
00219     virtual bool writeCustomData(QDataStream& stream);
00220 
00224     virtual bool loadCustomIndexHeader(QDataStream& stream);
00225 
00229     virtual void writeCustomIndexHeader(QDataStream& stream);
00230 
00235     void setValid(bool valid);
00236 
00240     bool recreateCacheFiles();
00241 
00242 private:
00243     class Private;
00244     friend class Private;
00245     Private * const d;
00246 };
00247 
00248 #endif // KPIXMAPCACHE_H

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
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
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