2011-12-04 16:54:57 +01:00
|
|
|
/* ============================================================
|
|
|
|
* QupZilla - WebKit based browser
|
2012-01-01 15:29:55 +01:00
|
|
|
* Copyright (C) 2010-2012 David Rosca <nowrep@gmail.com>
|
2011-12-04 16:54:57 +01: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-11-28 19:17:48 +01:00
|
|
|
#ifndef PAGETHUMBNAILER_H
|
|
|
|
#define PAGETHUMBNAILER_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QWebPage>
|
|
|
|
#include <QWebFrame>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QWebPluginFactory>
|
|
|
|
|
|
|
|
class CleanPluginFactory : public QWebPluginFactory
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit CleanPluginFactory(QObject* parent = 0);
|
|
|
|
|
|
|
|
QList<QWebPluginFactory::Plugin> plugins() const;
|
|
|
|
QObject* create(const QString &mimeType, const QUrl &url, const QStringList &argumentNames, const QStringList &argumentValues) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PageThumbnailer : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit PageThumbnailer(QObject* parent = 0);
|
2011-12-02 23:25:27 +01:00
|
|
|
~PageThumbnailer();
|
2011-11-28 19:17:48 +01:00
|
|
|
|
|
|
|
void setSize(const QSize &size);
|
2011-12-02 23:25:27 +01:00
|
|
|
|
2011-11-28 19:17:48 +01:00
|
|
|
void setUrl(const QUrl &url);
|
2011-12-02 23:25:27 +01:00
|
|
|
QUrl url();
|
|
|
|
|
2011-12-23 13:47:38 +01:00
|
|
|
bool loadTitle();
|
|
|
|
void setLoadTitle(bool load);
|
|
|
|
QString title();
|
|
|
|
|
2011-11-29 23:12:07 +01:00
|
|
|
void setEnableFlash(bool enable);
|
2011-11-28 19:17:48 +01:00
|
|
|
|
|
|
|
void start();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void thumbnailCreated(QPixmap);
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
private slots:
|
2011-12-11 12:34:51 +01:00
|
|
|
void createThumbnail(bool status);
|
2011-11-28 19:17:48 +01:00
|
|
|
|
|
|
|
private:
|
|
|
|
QWebPage* m_page;
|
|
|
|
|
|
|
|
QSize m_size;
|
|
|
|
QUrl m_url;
|
2011-12-23 13:47:38 +01:00
|
|
|
QString m_title;
|
|
|
|
bool m_loadTitle;
|
2011-11-28 19:17:48 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // PAGETHUMBNAILER_H
|