|
1 /* |
|
2 Copyright (C) 2007 Trolltech ASA |
|
3 Copyright (C) 2007 Staikos Computing Services Inc. |
|
4 |
|
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. |
|
9 |
|
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. |
|
14 |
|
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. |
|
19 |
|
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. |
|
22 */ |
|
23 |
|
24 #ifndef QWEBFRAME_H |
|
25 #define QWEBFRAME_H |
|
26 |
|
27 #include <qobject.h> |
|
28 |
|
29 #include <qwebkitglobal.h> |
|
30 |
|
31 class QRect; |
|
32 class QPoint; |
|
33 class QPainter; |
|
34 class QMouseEvent; |
|
35 class QWheelEvent; |
|
36 |
|
37 class QWebFramePrivate; |
|
38 class QWebPage; |
|
39 |
|
40 namespace WebCore { |
|
41 class WidgetPrivate; |
|
42 class FrameLoaderClientQt; |
|
43 class ChromeClientQt; |
|
44 } |
|
45 class QWebFrameData; |
|
46 |
|
47 class QWEBKIT_EXPORT QWebFrame : public QObject |
|
48 { |
|
49 Q_OBJECT |
|
50 protected: |
|
51 QWebFrame(QWebPage *parent, QWebFrameData *frameData); |
|
52 QWebFrame(QWebFrame *parent, QWebFrameData *frameData); |
|
53 ~QWebFrame(); |
|
54 |
|
55 public: |
|
56 QWebPage *page() const; |
|
57 |
|
58 void addToJSWindowObject(const QByteArray &name, QObject *object); |
|
59 QString markup() const; |
|
60 QString innerText() const; |
|
61 QString renderTreeDump() const; |
|
62 QString selectedText() const; |
|
63 QString title() const; |
|
64 QString name() const; |
|
65 |
|
66 QList<QWebFrame*> childFrames() const; |
|
67 |
|
68 Qt::ScrollBarPolicy verticalScrollBarPolicy() const; |
|
69 void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy); |
|
70 Qt::ScrollBarPolicy horizontalScrollBarPolicy() const; |
|
71 void setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy); |
|
72 |
|
73 void render(QPainter *painter, const QRect &source); |
|
74 void layout(); |
|
75 |
|
76 QPoint pos() const; |
|
77 QRect geometry() const; |
|
78 |
|
79 public Q_SLOTS: |
|
80 QString evaluateJavaScript(const QString& scriptSource); |
|
81 |
|
82 signals: |
|
83 void cleared(); |
|
84 void loadDone(bool ok); |
|
85 void provisionalLoad(); |
|
86 void titleChanged(const QString &title); |
|
87 void hoveringOverLink(const QString &link, const QString &title); |
|
88 |
|
89 protected: |
|
90 //for dumprendertree |
|
91 virtual void mouseMoveEvent(QMouseEvent*); |
|
92 virtual void mousePressEvent(QMouseEvent*); |
|
93 virtual void mouseDoubleClickEvent(QMouseEvent*); |
|
94 virtual void mouseReleaseEvent(QMouseEvent*); |
|
95 virtual void wheelEvent(QWheelEvent*); |
|
96 |
|
97 private: |
|
98 friend class QWebPage; |
|
99 friend class QWebPagePrivate; |
|
100 friend class WebCore::WidgetPrivate; |
|
101 friend class WebCore::FrameLoaderClientQt; |
|
102 friend class WebCore::ChromeClientQt; |
|
103 QWebFramePrivate *d; |
|
104 }; |
|
105 |
|
106 #endif |