|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef _GINEBRA_CHROME_DOM_H_ |
|
20 #define _GINEBRA_CHROME_DOM_H_ |
|
21 |
|
22 #include <QObject> |
|
23 #include <QtCore/qvariant.h> |
|
24 #include <QList> |
|
25 #include <QHash> |
|
26 #include <QWebElement> |
|
27 #include "CachedHandler.h" |
|
28 |
|
29 class QWebPage; |
|
30 class QGraphicsItem; |
|
31 |
|
32 namespace GVA { |
|
33 |
|
34 class ChromeSnippet; |
|
35 class ChromeWidget; |
|
36 class ChromeRenderer; |
|
37 |
|
38 class ChromeDOM : public QObject //TBD: Need QObject here? |
|
39 { |
|
40 Q_OBJECT |
|
41 |
|
42 public: |
|
43 ChromeDOM(QWebPage * page, ChromeWidget * chrome); |
|
44 ~ChromeDOM(); |
|
45 QVariant evalInChromeContext(QString js); |
|
46 QWebElement getElementById(const QString &id); |
|
47 QSize getElementSize(const QString &id); |
|
48 QRect getElementRect(const QString &id); |
|
49 QString getElementAttribute(const QString &id, const QString &attribute); |
|
50 QList <QWebElement> getInitialElements(); |
|
51 ChromeSnippet * getSnippet(const QString &docElementId, QGraphicsItem* parent = 0); |
|
52 //QString getCacheableScript(); |
|
53 QList<CachedHandler> getCachedHandlers(const QString &elementId, const QRectF & ownerArea); |
|
54 int height() { return m_height; } |
|
55 private: |
|
56 QWebPage * m_page; |
|
57 ChromeRenderer * m_renderer; |
|
58 ChromeWidget * m_chrome; |
|
59 int m_height; |
|
60 int m_bytes; |
|
61 }; |
|
62 |
|
63 } // end of namespace GVA |
|
64 |
|
65 #endif |