1 // -*- c-basic-offset: 4; indent-tabs-mode:nil -*-
2 // vim: set ts=4 sts=4 sw=4 et:
3 /* This file is part of the KDE project
4 Copyright (C) 2003 Alexander Kellett <lypanov@kde.org>
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License, or (at your option) version 3.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>
23 #include <kbookmark.h>
24 #include "favicon_interface.h"
26 #include <kparts/part.h>
27 #include <kparts/browserinterface.h>
29 class FavIconWebGrabber
: public QObject
33 FavIconWebGrabber(KParts::ReadOnlyPart
*part
, const KUrl
&url
);
34 ~FavIconWebGrabber() {}
37 void slotMimetype(KIO::Job
*job
, const QString
&_type
);
38 void slotFinished(KJob
*job
);
41 KParts::ReadOnlyPart
*m_part
;
45 class FavIconBrowserInterface
;
47 class FavIconUpdater
: public QObject
52 FavIconUpdater(QObject
*parent
);
54 void downloadIcon(const KBookmark
&bk
);
55 void downloadIconActual(const KBookmark
&bk
);
58 void setIconURL(const KUrl
&iconURL
);
60 void notifyChange(bool isHost
, const QString
& hostOrURL
, const QString
& iconName
);
63 void done(bool succeeded
);
66 KParts::ReadOnlyPart
*m_part
;
67 FavIconBrowserInterface
*m_browserIface
;
68 FavIconWebGrabber
*m_webGrabber
;
71 org::kde::FavIcon m_favIconModule
;
74 class FavIconBrowserInterface
: public KParts::BrowserInterface
78 FavIconBrowserInterface(FavIconUpdater
*view
)
79 : KParts::BrowserInterface(view
), m_view(view
) {
83 FavIconUpdater
*m_view
;