2 Copyright (C) 2007 Trolltech ASA
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.
20 This class provides all functionality needed for loading images, style sheets and html
21 pages from the web. It has a memory cache for these objects.
27 #include <QtCore/qobject.h>
28 #include <QtCore/qurl.h>
29 #if QT_VERSION >= 0x040400
30 #include <QtNetwork/qnetworkaccessmanager.h>
32 #include "qwebkitglobal.h"
40 class QWebNetworkRequest;
41 class QNetworkRequest;
43 class QWebFramePrivate;
48 class FrameLoaderClientQt;
53 class QWEBKIT_EXPORT QWebFrame : public QObject
57 QWebFrame(QWebPage *parent, QWebFrameData *frameData);
58 QWebFrame(QWebFrame *parent, QWebFrameData *frameData);
62 QWebPage *page() const;
64 void load(const QUrl &url);
65 #if QT_VERSION < 0x040400
66 void load(const QWebNetworkRequest &request);
68 void load(const QNetworkRequest &request,
69 QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
70 const QByteArray &body = QByteArray());
72 void setHtml(const QString &html, const QUrl &baseUrl = QUrl());
73 void setHtml(const QByteArray &html, const QUrl &baseUrl = QUrl());
74 void setContent(const QByteArray &data, const QString &mimeType = QString(), const QUrl &baseUrl = QUrl());
76 void addToJSWindowObject(const QString &name, QObject *object);
77 QString markup() const;
78 QString innerText() const;
79 QString renderTreeDump() const;
81 QString title() const;
87 QList<QWebFrame*> childFrames() const;
89 Qt::ScrollBarPolicy verticalScrollBarPolicy() const;
90 void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy);
91 Qt::ScrollBarPolicy horizontalScrollBarPolicy() const;
92 void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy);
94 void render(QPainter *painter, const QRect &source);
98 QRect geometry() const;
101 QString evaluateJavaScript(const QString& scriptSource);
105 void loadDone(bool ok);
106 void provisionalLoad();
107 void titleChanged(const QString &title);
108 void hoveringOverLink(const QString &link, const QString &title, const QString &textContent);
114 * Signal is emitted when the mainframe()'s initial layout is completed.
116 void initialLayoutComplete();
119 * Signal is emitted when an icon ("favicon") is loaded from the site.
124 friend class QWebPage;
125 friend class QWebPagePrivate;
126 friend class WebCore::WidgetPrivate;
127 friend class WebCore::FrameLoaderClientQt;
128 friend class WebCore::ChromeClientQt;