|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
|
8 * |
|
9 * This program 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 |
|
12 * GNU Lesser General Public License for more details. |
|
13 * |
|
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
|
19 * |
|
20 */ |
|
21 |
|
22 #ifndef WebContentViewWidget_h |
|
23 #define WebContentViewWidget_h |
|
24 |
|
25 #include <QGraphicsWidget> |
|
26 |
|
27 class QGraphicsWebView; |
|
28 class QWebPage; |
|
29 class QWebHitTestResult; |
|
30 struct ZoomMetaData; |
|
31 |
|
32 namespace GVA { |
|
33 |
|
34 class ScrollableWebContentView; |
|
35 class WebContentAnimationItem; |
|
36 class WebView; |
|
37 |
|
38 class WebContentViewWidget : public QGraphicsWidget { |
|
39 Q_OBJECT |
|
40 Q_PROPERTY(QWebPage* page READ page WRITE setPage) |
|
41 |
|
42 public: |
|
43 WebContentViewWidget(QObject* parent, QWebPage* page = 0); |
|
44 ~WebContentViewWidget(); |
|
45 |
|
46 void resizeEvent(QGraphicsSceneResizeEvent* event); |
|
47 |
|
48 QWebPage* page(); |
|
49 void setPage(QWebPage* page); |
|
50 |
|
51 QGraphicsWebView* webView(); |
|
52 void setPageZoom(bool zoomIn); |
|
53 |
|
54 ZoomMetaData currentPageInfo(); |
|
55 void setCurrentPageInfo(ZoomMetaData); |
|
56 ZoomMetaData defaultZoomData(); |
|
57 void showPage(bool isSuperPage); |
|
58 void updatePreferredContentSize(); |
|
59 |
|
60 Q_SIGNALS: |
|
61 void updateZoomActions(bool enableZoomIn, bool enableZoomOut); |
|
62 void contextEventObject(QWebHitTestResult* eventTarget); |
|
63 void viewScrolled(QPoint& scrollPos, QPoint& delta); |
|
64 |
|
65 private: |
|
66 WebView* m_webView; |
|
67 ScrollableWebContentView* m_webViewport; |
|
68 WebContentAnimationItem* m_webViewportProxy; |
|
69 }; |
|
70 |
|
71 }// namespace GVA |
|
72 |
|
73 #endif //WebContentViewWidget_h |