favicons.h
00001 /* This file is part of the KDE Project 00002 Copyright (c) 2001 Malte Starostik <malte@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Library General Public 00006 License version 2 as published by the Free Software Foundation. 00007 00008 This library is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 Library General Public License for more details. 00012 00013 You should have received a copy of the GNU Library General Public License 00014 along with this library; see the file COPYING.LIB. If not, write to 00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00016 Boston, MA 02110-1301, USA. 00017 */ 00018 00019 #ifndef _FAVICONS_H_ 00020 #define _FAVICONS_H_ 00021 00022 #include <kdedmodule.h> 00023 #include <kurl.h> 00024 00025 namespace KIO { class Job; } 00026 00045 class FaviconsModule : public KDEDModule 00046 { 00047 Q_OBJECT 00048 K_DCOP 00049 public: 00050 FaviconsModule(const TQCString &obj); 00051 virtual ~FaviconsModule(); 00052 00053 k_dcop: 00063 TQString iconForURL(const KURL &url); 00073 ASYNC setIconForURL(const KURL &url, const KURL &iconURL); 00081 ASYNC downloadHostIcon(const KURL &url); 00082 00083 k_dcop_signals: 00084 void iconChanged(bool isHost, TQString hostOrURL, TQString iconName); 00085 void infoMessage(KURL iconURL, TQString msg); 00086 00087 private: 00088 void startDownload(const TQString &, bool, const KURL &); 00089 TQString simplifyURL(const KURL &); 00090 TQString iconNameFromURL(const KURL &); 00091 bool isIconOld(const TQString &); 00092 00093 private slots: 00094 void slotData(KIO::Job *, const TQByteArray &); 00095 void slotResult(KIO::Job *); 00096 void slotInfoMessage(KIO::Job *, const TQString &); 00097 void slotKill(); 00098 00099 private: 00100 struct FaviconsModulePrivate *d; 00101 }; 00102 00103 #endif 00104 00105 // vim: ts=4 sw=4 et