2
Copyright (C) 2008,2009 Nokia Corporation and/or its subsidiary(-ies)
3
Copyright (C) 2007 Staikos Computing Services Inc.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library 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 GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
24
#include <QtCore/qobject.h>
25
#include <QtCore/qurl.h>
26
#include <QtCore/qvariant.h>
27
#include <QtGui/qicon.h>
28
#include <QtNetwork/qnetworkaccessmanager.h>
29
#include "qwebkitglobal.h"
31
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
32
#include <QtScript/qscriptengine.h>
42
class QNetworkRequest;
47
class QWebNetworkRequest;
48
class QWebFramePrivate;
50
class QWebHitTestResult;
51
class QWebHistoryItem;
52
class QWebSecurityOrigin;
54
class QWebElementCollection;
55
class QWebScriptWorld;
57
class DumpRenderTreeSupportQt;
60
class FrameLoaderClientQt;
62
class TextureMapperLayerClientQt;
65
class QWebHitTestResultPrivate;
68
class QWEBKIT_EXPORT QWebHitTestResult {
71
QWebHitTestResult(const QWebHitTestResult &other);
72
QWebHitTestResult &operator=(const QWebHitTestResult &other);
78
QRect boundingRect() const;
79
QWebElement enclosingBlockElement() const;
80
QString title() const;
82
QString linkText() const;
84
QUrl linkTitle() const;
85
QWebFrame *linkTargetFrame() const;
86
QWebElement linkElement() const;
88
QString alternateText() const; // for img, area, input and applet
90
QUrl imageUrl() const;
91
QPixmap pixmap() const;
93
bool isContentEditable() const;
94
bool isContentSelected() const;
96
QWebElement element() const;
98
QWebFrame *frame() const;
101
QWebHitTestResult(QWebHitTestResultPrivate *priv);
102
QWebHitTestResultPrivate *d;
104
friend class QWebFrame;
105
friend class QWebPagePrivate;
106
friend class QWebPage;
109
class QWEBKIT_EXPORT QWebFrame : public QObject {
111
Q_PROPERTY(qreal textSizeMultiplier READ textSizeMultiplier WRITE setTextSizeMultiplier DESIGNABLE false)
112
Q_PROPERTY(qreal zoomFactor READ zoomFactor WRITE setZoomFactor)
113
Q_PROPERTY(QString title READ title)
114
Q_PROPERTY(QUrl url READ url WRITE setUrl)
115
Q_PROPERTY(QUrl requestedUrl READ requestedUrl)
116
Q_PROPERTY(QUrl baseUrl READ baseUrl)
117
Q_PROPERTY(QIcon icon READ icon)
118
Q_PROPERTY(QSize contentsSize READ contentsSize)
119
Q_PROPERTY(QPoint scrollPosition READ scrollPosition WRITE setScrollPosition)
120
Q_PROPERTY(bool focus READ hasFocus)
122
QWebFrame(QWebPage *parent, QWebFrameData *frameData);
123
QWebFrame(QWebFrame *parent, QWebFrameData *frameData);
127
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
128
enum ValueOwnership {
135
QWebPage *page() const;
137
void load(const QUrl &url);
138
void load(const QNetworkRequest &request, QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation, const QByteArray &body = QByteArray());
139
void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
140
void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
142
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
143
void addToJavaScriptWindowObject(const QString &name, QObject *object, ValueOwnership ownership = QtOwnership);
145
void addToJavaScriptWindowObject(const QString &name, QObject *object);
146
void addToJavaScriptWindowObject(const QString &name, QObject *object, QScriptEngine::ValueOwnership ownership);
148
QString toHtml() const;
149
QString toPlainText() const;
150
QString renderTreeDump() const;
152
QString title() const;
153
void setUrl(const QUrl &url);
155
QUrl requestedUrl() const;
156
QUrl baseUrl() const;
158
QMultiMap<QString, QString> metaData() const;
160
QString frameName() const;
162
QWebFrame *parentFrame() const;
163
QList<QWebFrame*> childFrames() const;
165
Qt::ScrollBarPolicy scrollBarPolicy(Qt::Orientation orientation) const;
166
void setScrollBarPolicy(Qt::Orientation orientation, Qt::ScrollBarPolicy policy);
168
void setScrollBarValue(Qt::Orientation orientation, int value);
169
int scrollBarValue(Qt::Orientation orientation) const;
170
int scrollBarMinimum(Qt::Orientation orientation) const;
171
int scrollBarMaximum(Qt::Orientation orientation) const;
172
QRect scrollBarGeometry(Qt::Orientation orientation) const;
174
void scroll(int, int);
175
QPoint scrollPosition() const;
176
void setScrollPosition(const QPoint &pos);
178
void scrollToAnchor(const QString& anchor);
181
ContentsLayer = 0x10,
182
ScrollBarLayer = 0x20,
188
void render(QPainter*);
189
void render(QPainter*, const QRegion& clip);
190
void render(QPainter*, RenderLayer layer, const QRegion& clip = QRegion());
192
void setTextSizeMultiplier(qreal factor);
193
qreal textSizeMultiplier() const;
195
qreal zoomFactor() const;
196
void setZoomFactor(qreal factor);
198
bool hasFocus() const;
202
QRect geometry() const;
203
QSize contentsSize() const;
205
QWebElement documentElement() const;
206
QWebElementCollection findAllElements(const QString &selectorQuery) const;
207
QWebElement findFirstElement(const QString &selectorQuery) const;
209
QWebHitTestResult hitTestContent(const QPoint &pos) const;
211
virtual bool event(QEvent *);
213
QWebSecurityOrigin securityOrigin() const;
216
QVariant evaluateJavaScript(const QString& scriptSource);
217
#ifndef QT_NO_PRINTER
218
void print(QPrinter *printer) const;
222
void javaScriptWindowObjectCleared();
224
void provisionalLoad();
225
void titleChanged(const QString &title);
226
void urlChanged(const QUrl &url);
228
void initialLayoutCompleted();
232
void contentsSizeChanged(const QSize &size);
235
void loadFinished(bool ok);
240
friend class QGraphicsWebView;
241
friend class QWebPage;
242
friend class QWebPagePrivate;
243
friend class QWebFramePrivate;
244
friend class DumpRenderTreeSupportQt;
245
friend class WebCore::WidgetPrivate;
246
friend class WebCore::FrameLoaderClientQt;
247
friend class WebCore::ChromeClientQt;
248
friend class WebCore::TextureMapperLayerClientQt;
250
Q_PRIVATE_SLOT(d, void _q_orientationChanged())