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 00044 class KDEUI_EXPORT KIconCache : public KPixmapCache 00045 { 00046 public: 00050 explicit KIconCache(); 00051 virtual ~KIconCache(); 00052 00053 00054 bool find(const QString& key, QPixmap& pix, QString* path); 00055 void insert(const QString& key, const QPixmap& pix, const QString& path); 00056 00057 virtual bool find(const QString& key, QPixmap& pix); 00058 virtual void insert(const QString& key, const QPixmap& pix); 00059 00063 static void deleteCache(); 00064 00070 int defaultIconSize(KIconLoader::Group group) const; 00071 00072 void setThemeInfo(const QList<KIconTheme*>& themes); 00073 00074 00075 protected: 00076 virtual bool loadCustomIndexHeader(QDataStream& stream); 00077 virtual void writeCustomIndexHeader(QDataStream& stream); 00078 00079 virtual bool loadCustomData(QDataStream& stream); 00080 virtual bool writeCustomData(QDataStream& stream); 00081 00082 QSet<QString> existingIconThemeDirs(const QStringList& themeNames) const; 00083 unsigned int mostRecentMTime(const QSet<QString>& dirNames) const; 00084 00085 private: 00086 class Private; 00087 friend class Private; 00088 Private * const d; 00089 }; 00090 00091 #endif // KICONCACHE_H