akregator/src

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 Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 
00026 #ifndef FEEDICONMGR_H
00027 #define FEEDICONMGR_H
00028 
00029 #include <dcopobject.h>
00030 
00031 #include <qobject.h>
00032 
00033 class QPixmap;
00034 class QString;
00035 
00036 class DCOPClient;
00037 class KURL;
00038 
00039 
00040 namespace Akregator
00041 {
00042     class Feed;
00043     class TreeNode;
00044     
00045     class FeedIconManager:public QObject, public DCOPObject
00046     {
00047         Q_OBJECT
00048         K_DCOP
00049         
00050         public:
00051 
00052             FeedIconManager(QObject * = 0L, const char * = 0L);
00053             ~FeedIconManager();
00054             
00055             static FeedIconManager *self();
00056 
00057             void fetchIcon(Feed* feed);
00058             
00059             QString iconLocation(const KURL &) const;
00060             
00061         k_dcop:
00062             void slotIconChanged(bool, const QString&, const QString&);
00063 
00064         signals:
00065             void signalIconChanged(const QString &, const QPixmap &);
00066 
00067         public slots:
00068             void slotFeedDestroyed(TreeNode* node);
00069 
00070       protected:
00071 
00074             QString getIconURL(const KURL& url);
00075 
00076             void loadIcon(const QString &);
00077       
00078       private:
00079             static FeedIconManager *m_instance;
00080 
00081             class FeedIconManagerPrivate;
00082             FeedIconManagerPrivate* d;
00083     };
00084 }
00085 
00086 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys