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

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

wip

File size: 3.3 KB
Line 
1// Copyright 2010, 2012 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 __LOADSETTINGS_HH__
19#define __LOADSETTINGS_HH__
20
21#include <QNetworkProxy>
22#include <QString>
23
24#include <wkhtmltox/dllbegin.inc>
25namespace wkhtmltopdf {
26namespace settings {
27
28/*! \brief Settings considering proxy */
29struct DLL_PUBLIC Proxy {
30        Proxy();
31        //! Type of proxy to use
32        QNetworkProxy::ProxyType type;
33        //! The port of the proxy to use
34        int port;
35        //! The host name of the proxy to use or NULL
36        QString host;
37        //! Username for the said proxy or NULL
38        QString user;
39        //! Password for the said proxy or NULL
40        QString password;
41};
42
43struct DLL_PUBLIC PostItem {
44        QString name;
45        QString value;
46        bool file;
47};
48
49struct DLL_PUBLIC LoadGlobal {
50        LoadGlobal();
51        //! Path of the cookie jar file
52        QString cookieJar;
53};
54
55struct DLL_PUBLIC LoadPage {
56        LoadPage();
57
58        enum LoadErrorHandling {
59                abort,
60                skip,
61                ignore
62        };
63
64        //! Username used for http auth login
65        QString username;
66
67        //! Password used for http auth login
68        QString password;
69
70        //! How many milliseconds should we wait for a Javascript redirect
71        int jsdelay;
72
73        //! What window.status value should we wait for
74        QString windowStatus;
75
76        //! What zoom factor should we apply when printing
77        // TODO MOVE
78        float zoomFactor;
79
80        //! Map of custom header variables
81        QList< QPair<QString, QString> > customHeaders;
82
83        //! Set if the custom header should be repeated for each resource request
84        bool repeatCustomHeaders;
85
86        //! Map of cookies
87        QList< QPair<QString, QString> > cookies;
88
89        QList< PostItem > post;
90
91        //! Block access to local files for the given page
92        bool blockLocalFileAccess;
93
94        //! If access to local files is not allowed in general, allow it for these files
95        QList< QString > allowed;
96
97        //! Stop Javascript from running too long
98        bool stopSlowScripts;
99
100        //! Output Javascript debug messages
101        bool debugJavascript;
102
103        //! What should we do about load errors
104        LoadErrorHandling loadErrorHandling;
105        LoadErrorHandling mediaLoadErrorHandling;
106
107        //! Proxy related settings
108        Proxy proxy;
109
110        //! Additional javascript to run on a page once it has loaded
111        QList< QString > runScript;
112
113        QString checkboxSvg;
114        QString checkboxCheckedSvg;
115        QString radiobuttonSvg;
116        QString radiobuttonCheckedSvg;
117
118        QString cacheDir;
119        static QList<QString> mediaFilesExtensions;
120
121        // Hosts to bypass
122        QList< QString > bypassProxyForHosts;
123};
124
125DLL_PUBLIC LoadPage::LoadErrorHandling strToLoadErrorHandling(const char * s, bool * ok=0);
126DLL_PUBLIC QString loadErrorHandlingToStr(LoadPage::LoadErrorHandling leh);
127
128DLL_PUBLIC Proxy strToProxy(const char * s, bool * ok=0);
129DLL_PUBLIC QString proxyToStr(const Proxy & proxy);
130
131}
132}
133#include <wkhtmltox/dllend.inc>
134#endif //__LOADSETTINGS_HH__
Note: See TracBrowser for help on using the repository browser.