feediconmanager.h
00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net> 00005 2005 Frank Osterfeld <frank.osterfeld at kdemail.net> 00006 00007 This program is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU General Public License as published by 00009 the Free Software Foundation; either version 2 of the License, or 00010 (at your option) any later version. 00011 00012 This program is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 GNU General Public License for more details. 00016 00017 You should have received a copy of the GNU General Public License 00018 along with this program; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00020 00021 As a special exception, permission is given to link this program 00022 with any edition of TQt, and distribute the resulting executable, 00023 without including the source code for TQt in the source distribution. 00024 */ 00025 00026 #ifndef FEEDICONMGR_H 00027 #define FEEDICONMGR_H 00028 00029 #include <dcopobject.h> 00030 00031 #include <tqobject.h> 00032 00033 class TQPixmap; 00034 class TQString; 00035 00036 class DCOPClient; 00037 class KURL; 00038 00039 00040 namespace Akregator 00041 { 00042 class Feed; 00043 class TreeNode; 00044 00045 class FeedIconManager:public TQObject, public DCOPObject 00046 { 00047 Q_OBJECT 00048 // TQ_OBJECT 00049 K_DCOP 00050 00051 public: 00052 00053 FeedIconManager(TQObject * = 0L, const char * = 0L); 00054 ~FeedIconManager(); 00055 00056 static FeedIconManager *self(); 00057 00058 void fetchIcon(Feed* feed); 00059 00060 TQString iconLocation(const KURL &) const; 00061 00062 k_dcop: 00063 void slotIconChanged(bool, const TQString&, const TQString&); 00064 00065 signals: 00066 void signalIconChanged(const TQString &, const TQPixmap &); 00067 00068 public slots: 00069 void slotFeedDestroyed(TreeNode* node); 00070 00071 protected: 00072 00075 TQString getIconURL(const KURL& url); 00076 00077 void loadIcon(const TQString &); 00078 00079 private: 00080 static FeedIconManager *m_instance; 00081 00082 class FeedIconManagerPrivate; 00083 FeedIconManagerPrivate* d; 00084 }; 00085 } 00086 00087 #endif