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 <tqmap.h> 00024 00025 #include <kpixmapprovider.h> 00026 #include "konq_faviconmgr.h" 00027 00028 #include <libkonq_export.h> 00029 00030 class TDEConfig; 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 TQPixmap pixmapFor( const TQString& url, int size = 0 ); 00043 00047 void load( TDEConfig * kc, const TQString& key ); 00052 void save( TDEConfig *, const TQString& key, const TQStringList& items ); 00053 00057 void clear(); 00058 00063 TQString iconNameFor( const TQString& url ); 00064 00065 protected: 00066 KonqPixmapProvider( TQObject *parent=0, const char *name=0 ); 00067 00071 virtual void notifyChange( bool isHost, TQString hostOrURL, TQString iconName ); 00072 00073 TQPixmap loadIcon( const TQString& url, const TQString& icon, int size ); 00074 00075 private: 00076 TQMap<TQString,TQString> iconMap; 00077 static KonqPixmapProvider * s_self; 00078 }; 00079 00080 00081 #endif // KONQ_PIXMAPPROVIDER_H