2
Copyright (C) 2007 Trolltech ASA
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
19
This class provides all functionality needed for loading images, style sheets and html
20
pages from the web. It has a memory cache for these objects.
22
#ifndef QWEBNETWORKINTERFACE_H
23
#define QWEBNETWORKINTERFACE_H
28
#include <qbytearray.h>
30
#include <qwebkitglobal.h>
36
class QWebNetworkJobPrivate;
37
class QWebNetworkInterface;
38
class QWebObjectPluginConnector;
42
class ResourceRequest;
43
class FrameLoaderClientQt;
46
struct QWebNetworkRequestPrivate;
47
class QWEBKIT_EXPORT QWebNetworkRequest
57
explicit QWebNetworkRequest(const QUrl &url, Method method = Get, const QByteArray &postData = QByteArray());
58
QWebNetworkRequest(const QWebNetworkRequest &other);
60
QWebNetworkRequest &operator=(const QWebNetworkRequest &other);
61
~QWebNetworkRequest();
64
void setUrl(const QUrl &url);
66
QHttpRequestHeader httpHeader() const;
67
void setHttpHeader(const QHttpRequestHeader &header) const;
69
QString httpHeaderField(const QString &key) const;
70
void setHttpHeaderField(const QString &key, const QString &value);
72
QByteArray postData() const;
73
void setPostData(const QByteArray &data);
76
explicit QWebNetworkRequest(const QWebNetworkRequestPrivate &priv);
77
explicit QWebNetworkRequest(const WebCore::ResourceRequest &request);
78
friend class QWebNetworkJob;
79
friend class WebCore::FrameLoaderClientQt;
81
QWebNetworkRequestPrivate *d;
82
friend class QWebObjectPluginConnector;
85
class QWEBKIT_EXPORT QWebNetworkJob
89
QByteArray postData() const;
90
QHttpRequestHeader httpHeader() const;
91
QWebNetworkRequest request() const;
93
QHttpResponseHeader response() const;
94
void setResponse(const QHttpResponseHeader &response);
96
bool cancelled() const;
101
QWebNetworkInterface *networkInterface() const;
103
QWebFrame *frame() const;
109
friend class QWebNetworkManager;
110
friend class QWebObjectPluginConnector;
112
QWebNetworkJobPrivate *d;
115
class QWebNetworkInterfacePrivate;
117
class QWEBKIT_EXPORT QWebNetworkInterface : public QObject
121
QWebNetworkInterface(QObject *parent = 0);
122
~QWebNetworkInterface();
124
static void setDefaultInterface(QWebNetworkInterface *defaultInterface);
125
static QWebNetworkInterface *defaultInterface();
127
virtual void addJob(QWebNetworkJob *job);
128
virtual void cancelJob(QWebNetworkJob *job);
131
void started(QWebNetworkJob*);
132
void data(QWebNetworkJob*, const QByteArray &data);
133
void finished(QWebNetworkJob*, int errorCode);
135
* Signal is emitted when an SSL error occurs.
137
void sslErrors(QWebFrame *frame, const QUrl& url, const QList<QSslError>& errors, bool *continueAnyway);
139
* Signal is emitted when network authentication is required.
141
void authenticate(QWebFrame *frame, const QUrl& url, const QString& hostname, quint16 port, QAuthenticator *auth);
143
* Signal is emitted when proxy authentication is required.
145
void authenticateProxy(QWebFrame *frame, const QUrl& url, const QNetworkProxy& proxy, QAuthenticator *auth);
148
friend class QWebNetworkInterfacePrivate;
149
friend class WebCore::WebCoreHttp;
150
QWebNetworkInterfacePrivate *d;