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., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, 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.
25 #include <qnetworkproxy.h>
29 #include "qwebframe.h"
31 #include <wtf/RefPtr.h>
36 class ContextMenuClientQt;
37 class ContextMenuItem;
47 class QWebPageContextPrivate
55 QPointer<QWebFrame> targetFrame;
56 RefPtr<WebCore::Node> innerNonSharedNode;
63 QWebPageContext(const QWebPageContext &other);
64 QWebPageContext &operator=(const QWebPageContext &other);
70 QUrl imageUrl() const;
71 // ### we have a pixmap internally, should this be called pixmap() instead?
72 QPixmap image() const;
74 QWebFrame *targetFrame() const;
77 QWebPageContext(const WebCore::HitTestResult &hitTest);
78 QWebPageContextPrivate *d;
80 friend class QWebPage;
86 QWebPagePrivate(QWebPage *);
88 void createMainFrame();
89 QMenu *createContextMenu(const WebCore::ContextMenu *webcoreMenu, const QList<WebCore::ContextMenuItem> *items);
91 QWebFrame *frameAt(const QPoint &pos) const;
93 void _q_onLoadProgressChanged(int);
94 void _q_webActionTriggered(bool checked);
95 void updateAction(QWebPage::WebAction action);
96 void updateNavigationActions();
97 void updateEditorActions();
99 WebCore::ChromeClientQt *chromeClient;
100 WebCore::ContextMenuClientQt *contextMenuClient;
101 WebCore::EditorClientQt *editorClient;
104 QPointer<QWebFrame> mainFrame;
105 QPointer<QWebFrame> frameUnderMouse;
107 inline QWebFrame *currentFrame(const QPoint &pos) const
108 { return frameUnderMouse ? static_cast<QWebFrame *>(frameUnderMouse) : frameAt(pos); }
111 QUndoStack *undoStack;
114 QWebNetworkInterface *networkInterface;
119 quint64 m_totalBytes;
120 quint64 m_bytesReceived;
122 QWebPage::NavigationRequestResponse navigationRequested(QWebFrame *frame, const QWebNetworkRequest &request, QWebPage::NavigationType type);
123 #ifndef QT_NO_NETWORKPROXY
124 QNetworkProxy networkProxy;
127 QWebPageHistory history;
128 QWebPageContext currentContext;
129 QWebSettings *settings;
131 QAction *actions[QWebPage::WebActionCount];