source: wkhtmltox/trunk/fuentes/include/wkhtmltox/multipageloader.hh @ 51

Last change on this file since 51 was 51, checked in by mabarracus, 4 years ago

wip

File size: 2.1 KB
Line 
1// Copyright 2010 wkhtmltopdf authors
2//
3// This file is part of wkhtmltopdf.
4//
5// wkhtmltopdf is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// wkhtmltopdf 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.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
17
18#ifndef __MULTIPAGELOADER_HH__
19#define __MULTIPAGELOADER_HH__
20
21#include <QFile>
22#include <QObject>
23#include <QUrl>
24#if QT_VERSION >= 0x050000
25#include <QtWebKitWidgets>
26#else
27#include <QWebPage>
28#endif
29#include <wkhtmltox/loadsettings.hh>
30
31#include <wkhtmltox/dllbegin.inc>
32namespace wkhtmltopdf {
33
34class DLL_LOCAL MyQWebPage;
35
36class DLL_LOCAL LoaderObject {
37public:
38        QWebPage & page;
39        bool skip;
40
41        LoaderObject(QWebPage & page);
42};
43
44class DLL_LOCAL MultiPageLoaderPrivate;
45class DLL_LOCAL MultiPageLoader: public QObject {
46        Q_OBJECT
47public:
48        MultiPageLoader(settings::LoadGlobal & s, bool mainLoader = false);
49        ~MultiPageLoader();
50        LoaderObject * addResource(const QString & url, const settings::LoadPage & settings, const QString * data=NULL);
51        LoaderObject * addResource(const QUrl & url, const settings::LoadPage & settings);
52        static QUrl guessUrlFromString(const QString &string);
53        int httpErrorCode();
54        static bool copyFile(QFile & src, QFile & dst);
55public slots:
56        void load();
57        void clearResources();
58        void cancel();
59signals:
60        void loadFinished(bool ok);
61        void loadProgress(int progress);
62        void loadStarted();
63        void warning(QString text);
64        void error(QString text);
65private:
66        MultiPageLoaderPrivate * d;
67        friend class MultiPageLoaderPrivate;
68        friend class MyQWebPage;
69        friend class ResourceObject;
70};
71
72}
73#include <wkhtmltox/dllend.inc>
74#endif //__MULTIPAGELOADER_HH__
Note: See TracBrowser for help on using the repository browser.