summaryrefslogtreecommitdiff
path: root/src/websnap.h
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-02-07 00:01:52 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-02-07 00:01:52 +0100
commitf4f86382a7dc3f57a62820df19afd8b1b1d9355d (patch)
treefdb618f2877f61ddfc3f91504a1675420d8e2f78 /src/websnap.h
parentMerge commit 'refs/merge-requests/86' of git://gitorious.org/rekonq/mainline ... (diff)
parentFix loading previews : when load finished, result wasn't shown (diff)
downloadrekonq-f4f86382a7dc3f57a62820df19afd8b1b1d9355d.tar.xz
Merge commit 'refs/merge-requests/84' of git://gitorious.org/rekonq/mainline into matgic_tab_page
Diffstat (limited to 'src/websnap.h')
-rw-r--r--src/websnap.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/websnap.h b/src/websnap.h
index 6c5b4af9..e15c2dcf 100644
--- a/src/websnap.h
+++ b/src/websnap.h
@@ -37,6 +37,9 @@
#include <QImage>
#include <QWebPage>
+#define WIDTH 200
+#define HEIGHT 150
+
/**
* This class renders a site producing an image based
@@ -48,21 +51,25 @@ class WebSnap : public QObject
Q_OBJECT
public:
- WebSnap(const QUrl &url);
+ WebSnap(const QUrl &url, QWebPage *originatingPage, int previewIndex);
~WebSnap();
- QPixmap previewImage();
- static QPixmap renderPreview(const QWebPage &page, int w, int h);
+ QPixmap previewImage(); // TODO : remove
+
+ static QPixmap renderPreview(const QWebPage &page, int w = WIDTH, int h = HEIGHT);
+
+ static KUrl fileForUrl(KUrl url);
+
+ static QString guessNameFromUrl(QUrl url);
+
+ static void savePreview(QPixmap pm, KUrl url);
QString snapTitle();
QUrl snapUrl();
-signals:
- void finished();
-
private slots:
void load();
- void saveResult(bool ok);
+ void saveResult(bool ok = true);
private:
QWebPage m_page;
@@ -70,6 +77,9 @@ private:
QUrl m_url;
QString m_snapTitle;
+
+ QWebPage *m_originatingPage;
+ int m_previewIndex;
};
#endif // WEB_SNAP_H