akregator/src

feediconmanager.h
1 /*
2  This file is part of Akregator.
3 
4  Copyright (C) 2004 Sashmit Bhaduri <smt@vfemail.net>
5  2005 Frank Osterfeld <frank.osterfeld at kdemail.net>
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 
21  As a special exception, permission is given to link this program
22  with any edition of TQt, and distribute the resulting executable,
23  without including the source code for TQt in the source distribution.
24 */
25 
26 #ifndef FEEDICONMGR_H
27 #define FEEDICONMGR_H
28 
29 #include <dcopobject.h>
30 
31 #include <tqobject.h>
32 
33 class TQPixmap;
34 class TQString;
35 
36 class DCOPClient;
37 class KURL;
38 
39 
40 namespace Akregator
41 {
42  class Feed;
43  class TreeNode;
44 
45  class FeedIconManager:public TQObject, public DCOPObject
46  {
47  TQ_OBJECT
48 //
49  K_DCOP
50 
51  public:
52 
53  FeedIconManager(TQObject * = 0L, const char * = 0L);
54  ~FeedIconManager();
55 
56  static FeedIconManager *self();
57 
58  void fetchIcon(Feed* feed);
59 
60  TQString iconLocation(const KURL &) const;
61 
62  k_dcop:
63  void slotIconChanged(bool, const TQString&, const TQString&);
64 
65  signals:
66  void signalIconChanged(const TQString &, const TQPixmap &);
67 
68  public slots:
69  void slotFeedDestroyed(TreeNode* node);
70 
71  protected:
72 
75  TQString getIconURL(const KURL& url);
76 
77  void loadIcon(const TQString &);
78 
79  private:
80  static FeedIconManager *m_instance;
81 
82  class FeedIconManagerPrivate;
83  FeedIconManagerPrivate* d;
84  };
85 }
86 
87 #endif