KDEUI
kimagecache.h
Go to the documentation of this file.
00001 /* 00002 * This file is part of the KDE project. 00003 * Copyright © 2010 Michael Pyne <mpyne@kde.org> 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License version 2 as published by the Free Software Foundation. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Library General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this library; see the file COPYING.LIB. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KIMAGECACHE_H 00021 #define KIMAGECACHE_H 00022 00023 #include <kdeui_export.h> 00024 #include <kshareddatacache.h> 00025 00026 #include <time.h> 00027 00028 class QImage; 00029 class QPixmap; 00030 00058 class KDEUI_EXPORT KImageCache : public KSharedDataCache 00059 { 00060 public: 00074 KImageCache(const QString &cacheName, 00075 unsigned defaultCacheSize, 00076 unsigned expectedItemSize = 0); 00077 00081 ~KImageCache(); 00082 00096 bool insertPixmap(const QString &key, const QPixmap &pixmap); 00097 00109 bool insertImage(const QString &key, const QImage &image); 00110 00118 bool findPixmap(const QString &key, QPixmap *destination) const; 00119 00126 bool findImage(const QString &key, QImage *destination) const; 00127 00132 void clear(); 00133 00137 time_t lastModifiedTime() const; 00138 00144 bool pixmapCaching() const; 00145 00154 void setPixmapCaching(bool enable); 00155 00160 int pixmapCacheLimit() const; 00161 00168 void setPixmapCacheLimit(int size); 00169 00170 private: 00171 class Private; 00172 Private *const d; 00173 }; 00174 00175 #endif /* KIMAGECACHE_H */
KDE 4.6 API Reference