konq_pixmapprovider.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2000 Carsten Pfeiffer <pfeiffer@kde.org>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This program 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     General Public License for more details.
00013 
00014    You should have received a copy of the GNU General Public License
00015    along with this program; see the file COPYING.  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 KONQ_PIXMAPPROVIDER_H
00021 #define KONQ_PIXMAPPROVIDER_H
00022 
00023 #include <qmap.h>
00024 
00025 #include <kpixmapprovider.h>
00026 #include "konq_faviconmgr.h"
00027 
00028 #include <libkonq_export.h>
00029 
00030 class KConfig;
00031 
00032 class LIBKONQ_EXPORT KonqPixmapProvider : public KonqFavIconMgr, virtual public KPixmapProvider
00033 {
00034 public:
00035     static KonqPixmapProvider * self();
00036 
00037     virtual ~KonqPixmapProvider();
00038 
00042     virtual QPixmap pixmapFor( const QString& url, int size = 0 );
00043 
00047     void load( KConfig * kc, const QString& key );
00052     void save( KConfig *, const QString& key, const QStringList& items );
00053 
00057     void clear();
00058 
00063     QString iconNameFor( const QString& url );
00064 
00065 protected:
00066     KonqPixmapProvider( QObject *parent=0, const char *name=0 );
00067 
00071     virtual void notifyChange( bool isHost, QString hostOrURL, QString iconName );
00072 
00073     QPixmap loadIcon( const QString& url, const QString& icon, int size );
00074 
00075 private:
00076     QMap<QString,QString> iconMap;
00077     static KonqPixmapProvider * s_self;
00078 };
00079 
00080 
00081 #endif // KONQ_PIXMAPPROVIDER_H
KDE Home | KDE Accessibility Home | Description of Access Keys