Fix crash if key bindings specified in profile cannot be found. Improve
[personal-kdebase.git] / apps / keditbookmarks / updater.h
blob71b2aa0416bf14def04b90bbaeb5cdecc81baea3
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/>
20 #ifndef __updater_h
21 #define __updater_h
23 #include <kbookmark.h>
24 #include "favicon_interface.h"
26 #include <kparts/part.h>
27 #include <kparts/browserinterface.h>
29 class FavIconWebGrabber : public QObject
31 Q_OBJECT
32 public:
33 FavIconWebGrabber(KParts::ReadOnlyPart *part, const KUrl &url);
34 ~FavIconWebGrabber() {}
36 protected Q_SLOTS:
37 void slotMimetype(KIO::Job *job, const QString &_type);
38 void slotFinished(KJob *job);
40 private:
41 KParts::ReadOnlyPart *m_part;
42 KUrl m_url;
45 class FavIconBrowserInterface;
47 class FavIconUpdater : public QObject
49 Q_OBJECT
51 public:
52 FavIconUpdater(QObject *parent);
53 ~FavIconUpdater();
54 void downloadIcon(const KBookmark &bk);
55 void downloadIconActual(const KBookmark &bk);
57 private Q_SLOTS:
58 void setIconURL(const KUrl &iconURL);
59 void slotCompleted();
60 void notifyChange(bool isHost, const QString& hostOrURL, const QString& iconName);
62 Q_SIGNALS:
63 void done(bool succeeded);
65 private:
66 KParts::ReadOnlyPart *m_part;
67 FavIconBrowserInterface *m_browserIface;
68 FavIconWebGrabber *m_webGrabber;
69 KBookmark m_bk;
70 bool webupdate;
71 org::kde::FavIcon m_favIconModule;
74 class FavIconBrowserInterface : public KParts::BrowserInterface
76 Q_OBJECT
77 public:
78 FavIconBrowserInterface(FavIconUpdater *view)
79 : KParts::BrowserInterface(view), m_view(view) {
82 private:
83 FavIconUpdater *m_view;
86 #endif