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-12-02 23:25:27 +01:00
|
|
|
#ifndef SPEEDDIAL_H
|
|
|
|
#define SPEEDDIAL_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QCryptographicHash>
|
|
|
|
#include <QDir>
|
2012-01-11 21:58:25 +01:00
|
|
|
#include <QDebug>
|
2011-12-02 23:25:27 +01:00
|
|
|
#include <QWebFrame>
|
2011-12-09 21:56:01 +01:00
|
|
|
#include <QWeakPointer>
|
2012-01-18 15:05:50 +01:00
|
|
|
#include <QFileDialog>
|
2011-12-02 23:25:27 +01:00
|
|
|
|
|
|
|
class PageThumbnailer;
|
|
|
|
class SpeedDial : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit SpeedDial(QObject* parent = 0);
|
|
|
|
|
|
|
|
void loadSettings();
|
|
|
|
void saveSettings();
|
|
|
|
|
|
|
|
void addWebFrame(QWebFrame* frame);
|
2011-12-24 13:31:32 +01:00
|
|
|
void addPage(const QUrl &url, const QString &title);
|
|
|
|
|
2012-01-09 16:23:03 +01:00
|
|
|
QString backgroundImage();
|
|
|
|
QString backgroundImageSize();
|
2011-12-02 23:25:27 +01:00
|
|
|
QString initialScript();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
Q_INVOKABLE void changed(const QString &allPages);
|
2011-12-23 13:47:38 +01:00
|
|
|
Q_INVOKABLE void loadThumbnail(const QString &url, bool loadTitle = false);
|
2011-12-02 23:25:27 +01:00
|
|
|
Q_INVOKABLE void removeImageForUrl(const QString &url);
|
|
|
|
|
2012-01-18 15:05:50 +01:00
|
|
|
Q_INVOKABLE QString getOpenFileName();
|
|
|
|
|
2011-12-02 23:25:27 +01:00
|
|
|
private slots:
|
|
|
|
void thumbnailCreated(const QPixmap &image);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QString m_initialScript;
|
|
|
|
QString m_allPages;
|
|
|
|
QString m_thumbnailsDir;
|
2012-01-09 16:23:03 +01:00
|
|
|
QString m_bgImg;
|
|
|
|
QString m_bgImgSize;
|
2011-12-02 23:25:27 +01:00
|
|
|
|
2011-12-09 21:56:01 +01:00
|
|
|
QList<QWeakPointer<QWebFrame> > m_webFrames;
|
2011-12-02 23:25:27 +01:00
|
|
|
|
|
|
|
bool m_loaded;
|
|
|
|
bool m_regenerateScript;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SPEEDDIAL_H
|