File indexing completed on 2024-05-12 04:58:27
0001 /* ============================================================ 0002 * Falkon - Qt web browser 0003 * Copyright (C) 2010-2014 David Rosca <nowrep@gmail.com> 0004 * 0005 * This program is free software: you can redistribute it and/or modify 0006 * it under the terms of the GNU General Public License as published by 0007 * the Free Software Foundation, either version 3 of the License, or 0008 * (at your option) any later version. 0009 * 0010 * This program is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0013 * GNU General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU General Public License 0016 * along with this program. If not, see <http://www.gnu.org/licenses/>. 0017 * ============================================================ */ 0018 #ifndef PAGETHUMBNAILER_H 0019 #define PAGETHUMBNAILER_H 0020 0021 #include <QObject> 0022 #include <QSize> 0023 #include <QUrl> 0024 0025 #include "qzcommon.h" 0026 0027 class QQuickWidget; 0028 class QPixmap; 0029 0030 class FALKON_EXPORT PageThumbnailer : public QObject 0031 { 0032 Q_OBJECT 0033 0034 public: 0035 explicit PageThumbnailer(QObject* parent = nullptr); 0036 ~PageThumbnailer(); 0037 0038 void setSize(const QSize &size); 0039 0040 void setUrl(const QUrl &url); 0041 QUrl url(); 0042 0043 bool loadTitle(); 0044 void setLoadTitle(bool load); 0045 QString title(); 0046 0047 void start(); 0048 0049 Q_SIGNALS: 0050 void thumbnailCreated(const QPixmap &); 0051 0052 public Q_SLOTS: 0053 QString afterLoadScript() const; 0054 void createThumbnail(bool status); 0055 0056 private: 0057 QQuickWidget *m_view; 0058 0059 QSize m_size; 0060 QUrl m_url; 0061 QString m_title; 0062 bool m_loadTitle; 0063 }; 0064 0065 #endif // PAGETHUMBNAILER_H