2011-10-29 12:24:12 +02:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2012-01-01 15:29:55 +01:00
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
2011-10-29 12:24:12 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* ============================================================ */
|
2011-10-28 23:17:38 +02:00
|
|
|
#ifndef ICONFETCHER_H
|
|
|
|
#define ICONFETCHER_H
|
|
|
|
|
2012-02-29 18:33:50 +01:00
|
|
|
#include "qz_namespace.h"
|
|
|
|
|
2011-10-28 23:17:38 +02:00
|
|
|
#include <QObject>
|
|
|
|
#include <QIcon>
|
2012-03-06 15:28:52 +01:00
|
|
|
#include <QVariant>
|
|
|
|
#include <QUrl>
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QNetworkAccessManager;
|
|
|
|
class QUrl;
|
2011-10-28 23:17:38 +02:00
|
|
|
|
2011-10-29 13:36:04 +02:00
|
|
|
class FollowRedirectReply;
|
2012-02-29 18:33:50 +01:00
|
|
|
|
|
|
|
class QT_QUPZILLA_EXPORT IconFetcher : public QObject
|
2011-10-28 23:17:38 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit IconFetcher(QObject* parent = 0);
|
|
|
|
void setNetworkAccessManager(QNetworkAccessManager* manager) { m_manager = manager; }
|
|
|
|
void fetchIcon(const QUrl &url);
|
|
|
|
|
2012-03-06 15:28:52 +01:00
|
|
|
void setData(const QVariant &data) { m_data = data; }
|
|
|
|
QVariant data() { return m_data; }
|
|
|
|
|
|
|
|
QUrl url() { return m_url; }
|
|
|
|
|
2011-10-28 23:17:38 +02:00
|
|
|
signals:
|
2012-03-06 15:28:52 +01:00
|
|
|
void iconFetched(QImage);
|
2011-10-28 23:17:38 +02:00
|
|
|
void finished();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void pageDownloaded();
|
|
|
|
void iconDownloaded();
|
|
|
|
|
|
|
|
private:
|
|
|
|
QNetworkAccessManager* m_manager;
|
|
|
|
|
2012-03-06 15:28:52 +01:00
|
|
|
QVariant m_data;
|
|
|
|
QUrl m_url;
|
|
|
|
|
2011-10-28 23:17:38 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ICONFETCHER_H
|