KDEUI
kiconcache.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 KICONCACHE_H 00022 #define KICONCACHE_H 00023 00024 #include <kdeui_export.h> 00025 00026 #include <QtCore/QList> 00027 #include <QtCore/QSet> 00028 #include <kicontheme.h> 00029 #include <kpixmapcache.h> 00030 00031 class QString; 00032 class QStringList; 00033 class QPixmap; 00034 class QDataStream; 00035 00036 00046 // KDE5: Un-export the symbols for this. Better yet, remove it entirely 00047 // since KPixmapCache is deprecated. 00048 class KDEUI_EXPORT KIconCache : public KPixmapCache 00049 { 00050 public: 00054 explicit KIconCache(); 00055 virtual ~KIconCache(); 00056 00057 00058 bool find(const QString& key, QPixmap& pix, QString* path); 00059 void insert(const QString& key, const QPixmap& pix, const QString& path); 00060 00061 virtual bool find(const QString& key, QPixmap& pix); 00062 virtual void insert(const QString& key, const QPixmap& pix); 00063 00067 static void deleteCache(); 00068 00074 int defaultIconSize(KIconLoader::Group group) const; 00075 00076 void setThemeInfo(const QList<KIconTheme*>& themes); 00077 00078 00079 protected: 00080 virtual bool loadCustomIndexHeader(QDataStream& stream); 00081 virtual void writeCustomIndexHeader(QDataStream& stream); 00082 00083 virtual bool loadCustomData(QDataStream& stream); 00084 virtual bool writeCustomData(QDataStream& stream); 00085 00086 QSet<QString> existingIconThemeDirs(const QStringList& themeNames) const; 00087 unsigned int mostRecentMTime(const QSet<QString>& dirNames) const; 00088 00089 private: 00090 class Private; 00091 friend class Private; 00092 Private * const d; 00093 }; 00094 00095 #endif // KICONCACHE_H
KDE 4.6 API Reference