2
* Copyright 2014 Canonical Ltd.
4
* This file is part of webbrowser-app.
6
* webbrowser-app is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* webbrowser-app is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
#ifndef __FAVICON_IMAGE_PROVIDER_H__
20
#define __FAVICON_IMAGE_PROVIDER_H__
23
#include <QtCore/QScopedPointer>
24
#include <QtCore/QString>
25
#include <QtCore/QtGlobal>
26
#include <QtQuick/QQuickImageProvider>
28
class QNetworkAccessManager;
31
class FaviconImageProvider Q_DECL_FINAL : public QQuickImageProvider
34
FaviconImageProvider();
36
const QString& cacheLocation() const;
38
QImage requestImage(const QString& id, QSize* size, const QSize& requestedSize);
41
QImage downloadImage(const QUrl& url);
43
QString m_cacheLocation;
44
QScopedPointer<QNetworkAccessManager> m_manager;
47
#endif // __FAVICON_IMAGE_PROVIDER_H__